PHP Scripts open_basedir Restriction in Effect Error PHP Scripts open_basedir Omejevanje Effect Napaka
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 zaščita poteg je Safe Mode varnostni ukrep, ki uporabnikom preprečuje odpiranje datotek ali skripte, ki se nahajajo zunaj svoje matične imenika s PHP, razen če ni izrecno izključena mapo. 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 nastavitev če je omogočeno, bo zagotovila, da je treba omejiti vse datoteke operacije datotek pod določenimi imenik, in tako preprečujejo php skripte za določenega uporabnika dostop do datotek v nepooblaščeno uporabniškega računa. When a script tries to open a file with, for example, fopen() or gzopen(), the location of the file is checked. Ko scenarij skuša odpreti datoteko, na primer, fopen () ali gzopen (), se preveri lokacijo datoteke. When the file is outside the specified or permissible directory-tree, PHP will refuse to open it and the following errors may occur: Ko datoteko ali zunaj določene dovoljene imenik-drevo, bo PHP zavrne, da jo odprete in se lahko pojavijo naslednje napake:
Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. Opozorilo: file_exists () [function.file-exists]: open_basedir omejitev v veljavi. 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) ni dovoljeno v poti (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
The above error message appears on a Apache httpd web server error log (error_log) hosting Wordpress blog. Zgornje sporočilo o napaki se prikaže na spletni strežnik Apache httpd error log (error_log) hosting Wordpress blog. However, the problem may happen to all system or websites that use PHP as scripting language. Vendar pa lahko problem zgodilo z vsemi sistema ali spletne strani, ki uporabljajo PHP kot skriptni jezik.
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. Raztopina ali workaround open_basedir omejitev, problem je, da onesposobiti varstvo open_basedir PHP celoti, ali izključitev varstva za nekatere privilegirane uporabniške račune, ali da se omogoči dostop do dodatnih imenik za skripte PHP.
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. Če uporabljate cPanel webhost Manager (WHM), lahko enostavno onemogočijo PHP open_basedir zaščite ali izključijo nekatere uporabnike iz varstva pri WHM. Simply go to “Tweak Security” under the “Security” section, then select “Configure” link for “Php open_basedir Tweak”. Simply go to "poteg Security" pod "Security", poglavje, torej izbrati "Configure" link za "Php open_basedir poteg". Inside it, you can enable or disable php open_basedir Protection, or exclude and include hosts from the protection. Notranjost je, lahko omogočite ali onemogočite php open_basedir varstvo, ali izključijo in vključujejo gosti iz zaščite.
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: Če uporabljate gostovanje Plesk nadzorno ploščo, boste morda morali ročno urediti Apache zunanja podoba pila od vhost.conf in vhost_ssl.conf, ter dodate ali uredite naslednje php_admin_value open_basedir vrstice na naslednje:
<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 none
</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 / full / path / to / dir: / full / path / to / imenik / httpdocs: / tmp
</Directory> </ Directory>
Note: For SSL hosts in the vhost_ssl.conf file, the Directory path will end with “httpsdocs” instead of “httpdocs”. Opomba: Za SSL gosti v vhost_ssl.conf datoteko, bo pot Directory končati s "httpsdocs" namesto "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 “:”. Poti (zgoraj je samo primer in ga je treba zamenjati z dejanskimi poti), ki zaostaja open_basedir so imeniki, da je izrecno dovoljeno za skripte PHP v vhost račun za dostop do domene, tako da lahko dodate v več direktorijih, ki so bile datoteke shranjene, in potrebnih , ki jih odprejo PHP, vsak ločeni z barvo ":". But be careful as it might expose your system to security fraud. Toda bodite previdni, da bi lahko izpostavi vaš sistem varnosti goljufije.
Once done, run the command below to make the changes effective, and then restart Apache httpd web server (apache2ctl restart or httpd restart): Nekoč velja, zaženite ukaz spodaj, da bi spremembe učinkovito, in nato ponovno zaženite spletni strežnik Apache httpd (apache2ctl zopet začeti ali zopet začeti httpd):
$PRODUCT_ROOT_D/admin/sbin/websrvmng -v -a $ PRODUCT_ROOT_D / admin / sbin / websrvmng-v -
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: Če imate ročno urejanje konfiguracijske datoteke Apache onemogočiti open_basedir PHP zaščito, preprosto odpirajo httpd.conf datoteko in iskanje proge, ki se začne z naslednjimi znaki:
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: Zamenjajte celotno postavke v virtualni gostitelj uporabniški račun domene, ki ga želite onemogočiti zaščito z naslednjo vrstico v onesposobiti to:
php_admin_value open_basedir none php_admin_value open_basedir none
You can also opt to allow your PHP scripts to access additional directory instead without disabling the protection. Prav tako lahko odločijo, da se omogoči vaš PHP skripte za dostop do dodatnih imenika, namesto ne da bi onemogočili zaščite. Additional directory can be added to the line, separated with color “:”. Dodatne imenik lahko dodate vrstico, ločene z barvo ":". For example, to add /new_directory to the allow list: Na primer, če želite dodati / new_directory, da bi seznam:
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 / lib / php: / usr / local / lib / 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 / lib / php: / usr / local / lib / php: / tmp: / new_directory"
Restart the Apache after finished editing. Restart Apache, ko končate z urejanjem. Note that the directory allowed list restriction above is actually a prefix, not a directory name. Upoštevajte, da imenik dovoljena seznam omejitev zgoraj je dejansko predpone, ne imenika ime. This means that “open_basedir = /dir/incl” also allows access to “/dir/include” and “/dir/incls” if they exist. To pomeni, da "open_basedir = / dir / incl", prav tako omogoča dostop do "/ dir / include" in "/ dir / incls", če ti obstajajo. When you want to restrict access to only the specified directory, end with a slash. Če želite omejiti dostop do le določenih imenik, konča s črto. For example: “open_basedir = /dir/incl/”. Na primer: "open_basedir = / dir / incl /".
IMPORTANT : The page is machine translated and provided "as is" without warranty. POMEMBNO: stran je stroj prevod in če "kot je" brez garancije. Machine translation may be difficult to understand. Strojno prevajanje je lahko težko razumeti. Please refer to Prosimo, da original English article original angleški člen whenever possible. kadar je to mogoče.
Related Articles Povezani članki
- Group Policy Login or Logon Scripts Not Running, Not Working or Not Executing Skupina zvitost prepričevalnost ali samoznak scenarij ne tekmovanje v teku, ne ki dela ali ne usmrtitev
- cPanel WHM Failed to Receive Status Information From Apache Error cPanel WHM ne zadostovati za prejemanje informacij o statusu From Apache zmota
- PHP Parse Error: syntax error, unexpected $end PHP Parse Error: syntax error, nepričakovanih $ end
- winnt_accept: Asynchronous AcceptEx failed Error in Apache Log winnt_accept: Asynchronous AcceptEx ni zmota v Apache Log
- Request URL /server-status or 404 Page Not Found Apache Error Request URL / server-status ali 404 Page Not Found Apache zmota
- Apache Warn NameVirtualHost *:80 Has No VirtualHosts Error When Start Apache Opozori NameVirtualHost *: 80 Has No VirtualHosts zmota čas začetek
- Bypass and Remove 3 Plays or 3 Days Restriction on Zune WiFi Sharing Bypass ter premestitev 3 objesten ali 3 Days Omejitev Zune ženka črepina
- gmmktime Error in WordPress and MagpieRSS gmmktime zmota v WordPress in MagpieRSS
- Fix Internal Server Error When Accessing Easy Apache in cPanel WebHosting Manager Pritrditi notranji pomočnik zmota čas postranski neprisiljen Apache v cPanel Gostovanje Manager
- PHP Allowed Memory Size Exchausted Fatal Error PHP Dovoljeno Memory Size Exchausted Fatal Error










































July 26th, 2009 18:12 26. julij 2009 18:12
[...] [...] [...] [...]
December 21st, 2007 16:58 21. december 2007 16:58
Great article. Great article.
Thanks for the WHM tip. Hvala za nasvet WHM.
You saved my ass. Rešil si mi rit.
December 3rd, 2007 16:21 3. december 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, hay un artículo muy interesante sobre este error en Moje digitalno življenje. Etiquetas: Desarrollo, hosting, open_basedir, [...] Etiquetas: Desarrollo, gostovanje, open_basedir, [...]