PHP Scripts open_basedir Restriction in Effect Error PHP Scripts open_basedir ierobežojums Effect kļūdu
PHP open_basedir protection tweak is a Safe Mode security measure that prevents users from opening files or scripts located outside of their home directory with PHP, unless the folder has specifically excluded. PHP open_basedir aizsardzības kniebiens ir Safe Mode drošības pasākums, kas novērš users atvērt failus vai skriptus kas atrodas ārpus viņu mājas katalogu ar PHP, ja mape ir īpaši izslēgts. PHP open_basedir setting if enabled, will ensure that all file operations to be limited to files under certain directory, and thus prevent php scripts for a particular user from accessing files in unauthorized user's account. PHP open_basedir, kurā, ja iespējota, nodrošinās, ka visas failu operācijas jāierobežo, lai faili ar noteiktiem katalogs, un tādējādi novērstu php skriptus par konkrētu lietotāju piekļuvi failus nesankcionētu lietotāja kontā. When a script tries to open a file with, for example, fopen() or gzopen(), the location of the file is checked. Kad skripts mēģina atvērt failu ar, piemēram, fopen () vai gzopen (), atrašanās vietu, fails ir pārbaudīti. When the file is outside the specified or permissible directory-tree, PHP will refuse to open it and the following errors may occur: Kad fails ir ārpus norādīti vai pieļaujamā direktoriju koks, PHP atsaka atvērt to un šādas kļūdas var rasties:
Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. Warning: file_exists () [function.file-exists]: open_basedir restriction spēkā. File(/home/user_name/public_html/wp-content/uploads/2006/12/picture.jpg) is not within the allowed path(s): (/home/user_name:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/user_name/public_html/wp-admin/inline-uploading.php on line 226 File (/ home/user_name/public_html/wp-content/uploads/2006/12/picture.jpg) ir ne ar atļauto ceļš (-i): (/ home / Lietotāja_vārds: / usr / pārliecinamies / php: / usr / local / pārliecinamies / php: / tmp) in / home / Lietotāja_vārds / public_html / wp-admin / inline-uploading.php on line 226
The above error message appears on a Apache httpd web server error log (error_log) hosting Wordpress blog. Iepriekš kļūdas ziņojums parādās uz Apache httpd web server error log (error_log) hosting WordPress blog. However, the problem may happen to all system or websites that use PHP as scripting language. Tomēr šo problēmu var notikt visiem sistēmu vai mājas lapas, kas izmanto PHP kā skriptu valodu.
The solution or workaround to open_basedir restriction problem is that disable the PHP open_basedir protection altogether, or to exclude the protection for certain privileged user accounts, or to allow access to the additional directory for PHP scripts. Risinājumu vai PROFILAKSE Lai open_basedir restriction problēma ir tā, ka atspējot PHP open_basedir aizsardzību kopumā, vai izslēgt aizsardzību noteiktām priviliģētu lietotāju kontus, vai arī lai dotu iespēju piekļūt papildu direktoriju PHP skriptus.
If you're using cPanel WebHost Manager (WHM), you can easily disable PHP open_basedir protection or exclude certain users from the protection with WHM. Ja jūs izmantojat cPanel WebHost Manager (WHM), varat viegli atslēgt PHP open_basedir aizsardzības vai izslēgt noteiktas lietotājiem no aizsardzības ar WHM. Simply go to “Tweak Security” under the “Security” section, then select “Configure” link for “Php open_basedir Tweak”. Vienkārši iet uz "iekniebt Drošība" saskaņā ar "Drošības" sadaļā, tad izvēlieties "Configure" saite ar "PHP open_basedir iekniebt". Inside it, you can enable or disable php open_basedir Protection, or exclude and include hosts from the protection. Tā iekšpusē, varat iespējot vai atspējot php open_basedir aizsardzību, vai izslēgt un ietver saimniekiem no aizsardzības.
If you're using Plesk hosting control panel, you may need to manually edit Apache configuration file of vhost.conf and vhost_ssl.conf, and add in or edit the following php_admin_value open_basedir lines to the following: Ja jūs izmantojat plesk hostinga vadības panelī, jums var būt nepieciešams manuāli rediģēt Apache konfigurācijas fails vhost.conf un vhost_ssl.conf un pievienot vai rediģēt šādu php_admin_value open_basedir līnijām ar šādu:
<Directory /full/path/to/the/directory/httpdocs> <Directory /full/path/to/the/directory/httpdocs>
php_admin_value open_basedir none php_admin_value open_basedir neviens
</Directory> </ Directory>
<Directory /full/path/to/the/directory/httpdocs> <Directory /full/path/to/the/directory/httpdocs>
php_admin_value open_basedir /full/path/to/dir:/full/path/to/directory/httpdocs:/tmp php_admin_value open_basedir / pilnīga / ceļš / uz / dir: / pilnīga / ceļš / uz / direktoriju / httpdocs: / tmp
</Directory> </ Directory>
Note: For SSL hosts in the vhost_ssl.conf file, the Directory path will end with “httpsdocs” instead of “httpdocs”. Piezīme: SSL mājotne ar vhost_ssl.conf failu, direktoriju ceļš beigsies ar "httpsdocs", nevis "httpdocs".
The paths (above is example only and to be replaced with real path) that behind open_basedir are the directories that specifically allowed for the PHP scripts in the vhost domain account to access, so you can add in more directories that files are been stored and needed to be opened by PHP, each seperated by color “:”. Ceļus (virs ir piemēram, tikai un kas jāaizstāj ar reālu ceļā), ka aiz open_basedir ir katalogi, kas īpaši par tām PHP skriptus, kas vhost domēna kontu piekļūt, lai jūs varētu pievienot vairāk katalogi, ka faili ir ir uzglabāta un kas vajadzīgi kas jāatver PHP, katra atdalīta ar krāsu ":". But be careful as it might expose your system to security fraud. Tomēr jābūt uzmanīgiem, jo tā var pakļaut jūsu sistēmas drošības krāpšanu.
Once done, run the command below to make the changes effective, and then restart Apache httpd web server (apache2ctl restart or httpd restart): Pēc tam, kad izdarīts, vadīt komandu zem veikt izmaiņas, efektīvu, un tad restart Apache httpd web serveri (apache2ctl restart vai httpd restart):
$PRODUCT_ROOT_D/admin/sbin/websrvmng -v -a $ PRODUCT_ROOT_D / admin / sbin / websrvmng-v-a
If you have to manually edit the Apache configuration file to disable PHP open_basedir protection, simply open up the httpd.conf file, and search for the lines that starts with the following characters: Ja jums ir manuāli rediģētu Apache konfigurācijas failu atspējot PHP open_basedir aizsardzība, vienkārši atvērt httpd.conf failu un meklēt līnijas, kas sākas ar šādas rakstzīmes:
php_admin_value open_basedir ….. php_admin_value open_basedir ... ..
Replace the whole line under the virtual host for the domain user account that you want to disable protection with the following line to disable it: Aizvietot visu līnijas virtuālo saimniekdators domēna lietotāja kontu, ko vēlaties atspējot aizsardzībai ar šādu rindu atspējot tā:
php_admin_value open_basedir none php_admin_value open_basedir neviens
You can also opt to allow your PHP scripts to access additional directory instead without disabling the protection. Varat arī izvēlēties, lai varētu savu PHP skriptus, lai piekļūtu papildu directory vietā bez atspējošanas aizsardzību. Additional directory can be added to the line, separated with color “:”. Papildu direktorijā var pievienot līnijas, atdalīti ar krāsu ":". For example, to add /new_directory to the allow list: Piemēram, lai pievienotu / new_directory uz atļaut saraksts:
php_admin_value open_basedir “/home/user_account/:/usr/lib/php:/usr/local/lib/php:/tmp” php_admin_value open_basedir "/ home / user_account /: / usr / pārliecinamies / php: / usr / local / pārliecinamies / php: / tmp"
php_admin_value open_basedir “/home/user_account/:/usr/lib/php:/usr/local/lib/php:/tmp:/new_directory” php_admin_value open_basedir "/ home / user_account /: / usr / pārliecinamies / php: / usr / local / pārliecinamies / php: / tmp: / new_directory"
Restart the Apache after finished editing. Restart ar Apache pēc tam, kad pabeigts editing. Note that the directory allowed list restriction above is actually a prefix, not a directory name. Ievērojiet, ka directory atļauts saraksts ierobežojums iepriekš faktiski ir prefikss, kas nav direktorija nosaukumu. This means that “open_basedir = /dir/incl” also allows access to “/dir/include” and “/dir/incls” if they exist. Tas nozīmē, ka "open_basedir = / dir / incl" arī ļauj piekļūt "/ dir / ietver" un "/ dir / incls", ja tie pastāv. When you want to restrict access to only the specified directory, end with a slash. Ja jūs vēlaties ierobežot piekļuvi tikai norādītajā direktorijā, gala ar slīpsvītra. For example: “open_basedir = /dir/incl/”. Piemēram: "open_basedir = / dir / incl /".
IMPORTANT : The page is machine translated and provided "as is" without warranty. SVARĪGI: Šī lapa ir mašīna tulkoto un ar nosacījumu ", kas ir" bez garantijas. Machine translation may be difficult to understand. Machine translation var būt grūti saprast. Please refer to Lūdzu, skatiet original English article oriģināls angļu rakstu whenever possible. kad vien iespējams.
Related Articles Saistītie raksti
- Group Policy Login or Logon Scripts Not Running, Not Working or Not Executing Grupas politikas Login or Logon Skripti Nedarbojas, nevis darba vai nav Izpildes
- cPanel WHM Failed to Receive Status Information From Apache Error cPanel WHM Neizdevās Receive Statuss Informācija no Apache kļūdu
- PHP Parse Error: syntax error, unexpected $end PHP parsēt Kļūda: syntax error, negaidītu $ end
- winnt_accept: Asynchronous AcceptEx failed Error in Apache Log winnt_accept: Asinhroni AcceptEx failed Kļūda Apache Log
- Request URL /server-status or 404 Page Not Found Apache Error Pieprasījums URL / servera statusu vai 404 Page Not Found Apache kļūdu
- Apache Warn NameVirtualHost *:80 Has No VirtualHosts Error When Start Apache brīdināt NameVirtualHost *: 80 nav VirtualHosts kļūdu Kad Sākums
- Bypass and Remove 3 Plays or 3 Days Restriction on Zune WiFi Sharing Derivāciju un Noņemt 3 Lugas vai 3 dienas ierobežojums Zune WiFi Sharing
- gmmktime Error in WordPress and MagpieRSS gmmktime Kļūda WordPress un MagpieRSS
- Fix Internal Server Error When Accessing Easy Apache in cPanel WebHosting Manager Fix Internal Server Error Kad Piekļuve Easy Apache in cPanel WebHosting Manager
- PHP Allowed Memory Size Exchausted Fatal Error PHP Atļautā Memory Size Exchausted Fatāla kļūda










































July 26th, 2009 18:12 Jūlijs 26, 2009 18:12
[...] [...] [...] [...]
December 21st, 2007 16:58 Decembris 21, 2007 16:58
Great article. Great article.
Thanks for the WHM tip. Thanks for the WHM tip.
You saved my ass. Jūs saglabāta mana Ass.
December 3rd, 2007 16:21 Decembris 3, 2007 16:21
[...] queréis más información sobre este tema, hay un artículo muy interesante sobre este error en My Digital Life. [...] Queréis más información sobre este tema, siens un artículo muy interesante sobre este error en Mani Digital Life. Etiquetas: Desarrollo, hosting, open_basedir, [...] Etiquetas: Desarrollo, hosting, open_basedir, [...]