PHP Scripts open_basedir Restriction in Effect Error PHP腳本和open_basedir的限制,實際上是錯誤

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保護調整,是一種安全模式,安全的措施,阻止用戶打開文件或腳本位於以外的其主目錄用PHP ,除非該文件夾已明確排除在外。 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設置如果啟用,將可確保所有的文件操作是有限的檔案在某些目錄中,從而防止PHP腳本為某特定用戶從存取檔案,在未經授權的用戶的帳戶中。 When a script tries to open a file with, for example, fopen() or gzopen(), the location of the file is checked.當一個腳本試圖打開一個文件,例如fopen ( )或者gzopen ( ) ,該文件的位置被選中。 When the file is outside the specified or permissible directory-tree, PHP will refuse to open it and the following errors may occur:當文件以外的指定或許可的目錄樹, PHP將拒絕打開它和下面的錯誤,可能會發生:

Warning: file_exists() [function.file-exists]: open_basedir restriction in effect.警告: file_exists ( ) [ function.file -存在] : open_basedir上的限制作用。 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文件( / home/user_name/public_html/wp-content/uploads/2006/12/picture.jpg )不屬於允許路徑( ) : ( /首頁/用戶名:在/ usr /庫/ PHP的:在/ usr / local / lib中/ PHP的: / tmp的)在/ home /用戶名/ public_html /可濕性粉劑-政府當局/內置- uploading.php上線226

The above error message appears on a Apache httpd web server error log (error_log) hosting Wordpress blog.上述錯誤訊息出現在阿帕奇的httpd的Web Server錯誤日誌( error_log )主辦的WordPress博客。 However, the problem may happen to all system or websites that use PHP as scripting language.不過,問題可能出現的所有系統或網站使用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.該解決方案或替代方法,以和open_basedir的限制,問題是禁用的PHP和open_basedir的保護完全,或排除保護某些特權用戶帳戶,或讓獲得額外的目錄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.如果您使用的cPanel網頁主機服務經理(的WHM ) ,您可以輕鬆地禁用的PHP和open_basedir保護或排除某些用戶從保護的WHM 。 Simply go to “Tweak Security” under the “Security” section, then select “Configure” link for “Php open_basedir Tweak”.簡單地去“調整安全”下“安全”一節,然後選擇“配置”鏈接“的PHP和open_basedir調整” 。 Inside it, you can enable or disable php open_basedir Protection, or exclude and include hosts from the protection.內,您可以啟用或禁用的PHP和open_basedir的保護,或排除和包括主機保護。

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:如果您使用的plesk主機控制面板,您可能需要手動編輯Apache配置文件vhost.conf和vhost_ssl.conf ,並在添加或編輯以下php_admin_value open_basedir上線如下:

<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上無
</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上/全/路徑/ /迪爾: /充分/路徑/ /目錄/ httpdocs : /川芎嗪
</Directory> < /目錄>

Note: For SSL hosts in the vhost_ssl.conf file, the Directory path will end with “httpsdocs” instead of “httpdocs”.注意:對於SSL主機,在vhost_ssl.conf文件,目錄路徑將結束與“ httpsdocs ” ,而不是“ 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 “:”.路徑(以上是例子,只需要更換與實際路徑)的背後,和open_basedir是目錄,明確允許為PHP腳本,在vhost網域帳戶來訪問,使您可以添加更多的目錄,檔案被存放和需要以開放,由PHP ,每個分隔的顏色“ : ” 。 But be careful as it might expose your system to security fraud.但要小心,因為它可能暴露您的系統安全的欺詐行為。

Once done, run the command below to make the changes effective, and then restart Apache httpd web server (apache2ctl restart or httpd restart):一旦這樣做,運行該命令下面作出的變化,有效,然後重新啟動的Apache的httpd Web伺服器( apache2ctl重新啟動或重新啟動的httpd ) :

$PRODUCT_ROOT_D/admin/sbin/websrvmng -v -a元product_root_d /管理/ sbin / websrvmng - V型1

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:如果您有手動編輯Apache配置文件中禁用的PHP和open_basedir的保護,只要打開了httpd.conf文件,並搜索該行開始與以下字符:

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:取代整個線下,虛擬主機為域用戶帳戶您想要停用的保護與下列命令行以禁用它:

php_admin_value open_basedir none php_admin_value open_basedir上無

You can also opt to allow your PHP scripts to access additional directory instead without disabling the protection.您也可以選擇,讓您的PHP腳本,以獲得更多目錄,而不是無禁用的保障。 Additional directory can be added to the line, separated with color “:”.額外的目錄中可以添加到線,分離與顏色“ : ” 。 For example, to add /new_directory to the allow list:例如,要添加/ new_directory ,以允許名單:

php_admin_value open_basedir “/home/user_account/:/usr/lib/php:/usr/local/lib/php:/tmp” php_admin_value open_basedir上“ /首頁/ 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上“ /首頁/ user_account / :是/ usr / lib中/ PHP的:是/ usr / local / lib目錄/ PHP的: / tmp的: / new_directory ”

Restart the Apache after finished editing.重新啟動的Apache後,完成編輯。 Note that the directory allowed list restriction above is actually a prefix, not a directory name.請注意,目錄獲准名單的限制,上述實際上是一個前綴,而非一個目錄名。 This means that “open_basedir = /dir/incl” also allows access to “/dir/include” and “/dir/incls” if they exist.這也就是說“ open_basedir = /迪爾/ incl ”也會允許訪問“ / dir /包括”和“ / dir / incls ” ,如果它們存在的話。 When you want to restrict access to only the specified directory, end with a slash.當您要將訪問限制在僅為指定的目錄,在結尾加上一個斜線。 For example: “open_basedir = /dir/incl/”.例如: “ open_basedir = /迪爾/含/ ” 。

IMPORTANT : This is a machine translated page which is provided "as is" without warranty. 重要說明 :這是一個機器翻譯網頁是“按原樣”提供的擔保。 Machine translation may be difficult to understand.機器翻譯可能很難理解。 Please refer to請參閱 original English article英文原版的文章 whenever possible.只要有可能。

Share and contribute or get technical support and help at分享和貢獻,或取得技術的支持和幫助,在 My Digital Life Forums 我的數字生活論壇 .



2 Responses to “PHP Scripts open_basedir Restriction in Effect Error” 2反應“ PHP腳本和open_basedir的限制,實際上是錯誤”

  1. Error open_basedir restriction in effect en Agamum.net錯誤和open_basedir的限制,實際上是英文agamum.net
    December 3rd, 2007 16:21 2007年12月3日16時21分
    1

    [...] queréis más información sobre este tema, hay un artículo muy interesante sobre este error en My Digital Life. [ … … ] queréis更多資訊,關於埃斯特特馬,乾草聯合國artículo muy interesante關於埃斯特錯誤恩,我的數位生活。 Etiquetas: Desarrollo, hosting, open_basedir, [...] etiquetas :與發展,主機託管, open_basedir上, [ … … ]

  2. Amateur Dating Club業餘交友俱樂部
    December 21st, 2007 16:58 2007年12月21日16時58分
    2

    Great article.偉大的文章。
    Thanks for the WHM tip.感謝為的WHM秘訣。

    You saved my ass.你救了我驢。

Leave a Reply離開的答复

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> 您可以使用這些標籤:的<a href="" title=""> <abbr title=""> <acronym title="">的<b> <blockquote cite=""> <cite>的<code> <刪除日期時間= “ ” >的<em>的<i> <q cite=""> <strike>的<strong>

Subscribe without commenting訂閱無評論


Custom Search

New Articles新的條款,

Incoming Search Terms for the Article傳入的搜索條件文章

open_basedir restriction in effect 和open_basedir的限制,效果 - - open_basedir restriction in effect. 和open_basedir的限制作用。 - - open_basedir restriction 和open_basedir限制 - - "open_basedir restriction in effect" “和open_basedir的限制效應” - - php_admin_value open_basedir php_admin_value open_basedir上 - - php open_basedir PHP中的open_basedir - - apache open_basedir 阿帕奇和open_basedir - - open_basedir restriction in effect. 和open_basedir的限制作用。 - - open_basedir restriction 和open_basedir限制 - - open_basedir disable open_basedir上禁用 - - open_basedir php open_basedir上的PHP - - wordpress open_basedir 在WordPress和open_basedir - - wordpress open_basedir restriction in effect 在WordPress和open_basedir的限制,效果 - - php open_basedir restriction PHP中的open_basedir限制 - - php open_basedir restriction in effect PHP中的open_basedir的限制,效果 - - disable open_basedir 禁用和open_basedir - - Plesk open_basedir restriction in effect. plesk和open_basedir的限制作用。 - - open_basedir restriction in effec 和open_basedir的限制,在有效 - - open_basedir 和open_basedir - - "open_basedir restriction in effect." “和open_basedir的限制效應” 。 - - open_basedir restriction in effect 和open_basedir的限制,效果 - - php open_basedir plesk PHP中的open_basedir plesk - - php_admin_value open_basedir php_admin_value open_basedir上 - - plesk open_basedir restriction in effect plesk和open_basedir的限制,效果 - - open_basedir wordpress open_basedir上的WordPress - - open_basedir restriction in effect cpanel 和open_basedir的限制效果的cPanel - - open_basedir restriction in effect 和open_basedir的限制,效果 - - php_admin_value open_basedir none php_admin_value open_basedir上無 - - open_basedir restriction in effect plesk 和open_basedir的限制,效果plesk - - Tweak PHP open_basedir Security 調整的PHP和open_basedir安全 - - open_basedir restriction plesk 和open_basedir的限制, plesk - - plesk disable open_basedir plesk禁用和open_basedir - - plesk php open_basedir plesk的PHP和open_basedir - - cPanel open_basedir restriction in effect 的cPanel和open_basedir的限制,效果 - - remove open_basedir 刪除和open_basedir - - open_basedir restriction in effect. 和open_basedir的限制作用。 File 文件 - - open_basedir cpanel 和open_basedir的cPanel - - fix open_basedir restriction in effect error config file 修復和open_basedir的限制,實際上是錯誤的config檔 - - apache open_basedir restriction in effect. 阿帕奇和open_basedir的限制作用。 - - PHP open_basedir Protection PHP中的open_basedir保護 - - plesk jaring plesk jaring - - open_basedir restriction in effect include 和open_basedir的限制,實際上是包括 - - cPanel open_basedir 的cPanel的open_basedir - - disable open_basedir restriction in effect. 禁用和open_basedir的限制作用。 - - cpanel disable open_basedir 的cPanel禁用和open_basedir - - php_admin_value errors php_admin_value錯誤 - - plesk php_admin_value plesk php_admin_value - - how to remove open_basedir restriction 如何刪除和open_basedir限制 - - How do I enable error logging for PHP scripts? 我要如何使錯誤記錄為PHP腳本? - - php open_basedir PHP中的open_basedir - -