PHP Scripts open_basedir Restriction in Effect Error PHP skripty open_basedir Obmedzenie Effect Chyba
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 ochrany zatahání je núdzovom režime bezpečnostné opatrenia, ktoré zabránia používateľom otváraní súborov alebo skriptov umiestnených mimo ich domovskej adresára s PHP, ak zložka výslovne vylúčená. 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 nastavení povolená, ak bude zabezpečené, že všetky operácie so súbormi, ktoré majú byť obmedzené na súbory podľa určitého adresára, a tým zabrániť php skripty pre konkrétneho užívateľa od prístupu k súborom na neoprávnené užívateľského účtu. When a script tries to open a file with, for example, fopen() or gzopen(), the location of the file is checked. Keď skript sa pokúsi otvoriť súbor, napríklad s fopen () alebo gzopen (), umiestnenie súboru je kontrolovaná. When the file is outside the specified or permissible directory-tree, PHP will refuse to open it and the following errors may occur: Keď je súbor mimo stanovenej alebo dovolenky adresár-strom, PHP odmietne ju otvorte a tieto chyby sa môžu objaviť:
Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. Upozornenie: file_exists () [function.file-exists]: open_basedir obmedzenie účinku. 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) nie je v rámci povolenej cesty (s): (/ home / meno_používateľa: / usr / lib / php: / usr / local / lib / php: / tmp) in / home / meno_používateľa / 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. Vyššie uvedené chybové hlásenie sa objaví na webovom serveri Apache httpd error (error_log) hosťovaní Wordpress blog. However, the problem may happen to all system or websites that use PHP as scripting language. Avšak, tento problém môže nastať na všetkých systému alebo webových stránok, ktoré používajú ako skriptovací jazyk PHP.
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. Toto riešenie alebo riešenia na open_basedir obmedzenia Problém je, že zakázať PHP open_basedir ochranu úplne, alebo vylúčiť ochranu pre určité výsadné užívateľské účty, alebo umožniť prístup k dodatočné adresára pre PHP skripty.
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. Ak používate cPanel webhost Manager (WHM), môžete jednoducho zakázať PHP open_basedir ochranu či vylúčenie niektorých užívateľov z ochrany s WHM. Simply go to “Tweak Security” under the “Security” section, then select “Configure” link for “Php open_basedir Tweak”. Stačí ísť na "Vylepšenie Bezpečnosť" v rámci "Bezpečnosť" bod, potom vyberte "Nastavenia" odkaz "PHP open_basedir Vylepšenie". Inside it, you can enable or disable php open_basedir Protection, or exclude and include hosts from the protection. Vnútri to, môžete povoliť alebo zakázať php open_basedir ochranu alebo vylúčenie a zahŕňajú hostí od ochranu.
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: Ak používate ovládací panel Plesk hosting, možno budete musieť ručne upraviť konfiguračný súbor Apache vhost.conf a vhost_ssl.conf a pridať alebo upraviť nasledujúce php_admin_value open_basedir liniek na nasledujúce:
<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 nemá
</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 / cesta / k / adresári / httpdocs: / tmp
</Directory> </ Directory>
Note: For SSL hosts in the vhost_ssl.conf file, the Directory path will end with “httpsdocs” instead of “httpdocs”. Poznámka: Pre SSL hostí v vhost_ssl.conf súbor, adresár, cesta skončí s "httpsdocs" miesto "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 “:”. Ciest (vyššia je len príkladom a byť nahradený skutočnú cestu), že za open_basedir adresára, ktoré sú povolené pre PHP skripty v vhost domény pre prístup k účtu, takže si môžete pridať do viacerých zoznamov súborov, ktoré sú uskladnené a potrebných , ktoré majú byť otvorené v PHP, každý oddelené color ":". But be careful as it might expose your system to security fraud. Ale pozor, ak by mohol vystaviť svoj systém pre zabezpečenie podvodu.
Once done, run the command below to make the changes effective, and then restart Apache httpd web server (apache2ctl restart or httpd restart): Potom, čo urobiť, spustiť príkaz pod urobiť zmeny účinné, a potom reštartovať webový server Apache httpd (apache2ctl alebo restart 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: Máte-li ručne upraviť konfiguračný súbor Apache zakázať PHP open_basedir ochrany, jednoducho otvoriť httpd.conf súboru a hľadanie na tratiach, ktoré začína nasledovné znaky:
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: Nahradiť celý riadok pod virtuálnej hostiteľa v doméne užívateľský účet, ktorý chcete zakázať ochrany nasledujúci riadok deaktivovať:
php_admin_value open_basedir none php_admin_value open_basedir nemá
You can also opt to allow your PHP scripts to access additional directory instead without disabling the protection. Môžete tiež zvoliť, aby vaše PHP skripty pre prístup k adresáru dodatočné miesto bez vypnutia ochrany. Additional directory can be added to the line, separated with color “:”. Additional adresára môže byť pridaný do riadku, oddelené s farbou ":". For example, to add /new_directory to the allow list:
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. Reštartujte Apache po finálnej úpravy. Note that the directory allowed list restriction above is actually a prefix, not a directory name. Poznamenajme, že adresár, zoznam povolených obmedzení vyššie je vlastne prefix, nie názov adresára. This means that “open_basedir = /dir/incl” also allows access to “/dir/include” and “/dir/incls” if they exist. To znamená, že "open_basedir = / dir / incl" tiež umožňuje prístup k "/ dir / include" a "/ dir / incls" ak existujú. When you want to restrict access to only the specified directory, end with a slash. Keď chcete obmedziť prístup iba tento adresár, koniec s lomkou. For example: “open_basedir = /dir/incl/”. Napríklad: "open_basedir = / dir / vrátane /."
IMPORTANT : The page is machine translated and provided "as is" without warranty. Upozornenie: Stránka je stroje preložené a poskytované "tak ako sú" bez záruky. Machine translation may be difficult to understand. Strojový preklad môže byť ťažké pochopiť. Please refer to Obráťte sa prosím na original English article Anglický originál článku whenever possible. kedykoľvek je to možné.
Related Articles Súvisiace články
- Group Policy Login or Logon Scripts Not Running, Not Working or Not Executing Zásady skupiny Prihlásenie Užívateľské skripty alebo nebežia, nie je tiež Vykonávajúci
- cPanel WHM Failed to Receive Status Information From Apache Error cPanel WHM Zlyhalo Dostávať Status Informácie z Apache Chyba
- PHP Parse Error: syntax error, unexpected $end PHP Parse Error: syntax error, neočakávané $ konca
- winnt_accept: Asynchronous AcceptEx failed Error in Apache Log winnt_accept: Asynchrónny AcceptEx zlyhalo Chyba v Apache Prihlásenie
- Request URL /server-status or 404 Page Not Found Apache Error Žiadosť URL / server-status alebo 404 Strana Nenájdené Apache Chyba
- Apache Warn NameVirtualHost *:80 Has No VirtualHosts Error When Start Apache Varovat NameVirtualHost *: 80 Bolo č VirtualHosts Chyba Keď Štart
- Bypass and Remove 3 Plays or 3 Days Restriction on Zune WiFi Sharing Obchvat a odobrať 3 hry alebo 3 dni Obmedzenie Zune WiFi Zdieľanie
- gmmktime Error in WordPress and MagpieRSS gmmktime Chyba vo WordPress a MagpieRSS
- Fix Internal Server Error When Accessing Easy Apache in cPanel WebHosting Manager Fix Interná chyba servera pri prístupe Easy Apache v cPanel Webhosting Manager
- PHP Allowed Memory Size Exchausted Fatal Error PHP povolená veľkosť pamäte Exchausted Fatal Error










































July 26th, 2009 18:12 26. júl 2009 18:12
[...] [...] [...] [...]
December 21st, 2007 16:58 21. decembra 2007 16:58
Great article. Veľká článku.
Thanks for the WHM tip. Vďaka za tip WHM.
You saved my ass. Zachránil ste mi prdel.
December 3rd, 2007 16:21 3. decembra 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 chyba en My Digital Life. Etiquetas: Desarrollo, hosting, open_basedir, [...] Etiquetas: Desarrollo, hosting, open_basedir, [...]