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. הגדרת open_basedir PHP אם הוא מופעל, תוודא שכל הקבצים פעולות יוגבלו קבצים תחת ספריה מסוימת, ובכך למנוע הסקריפטים 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. Warning: 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) היא לא בתוך הנתיב המותר (s): (/ home / user_name: / usr / lib / php: / usr / local / lib / php: / tmp) in / home / user_name / public_html / wp-admin / מוטבעות-uploading.php על קו 226
The above error message appears on a Apache httpd web server error log (error_log) hosting Wordpress blog. הודעת השגיאה הנ"ל מופיעה על יומן של שרת אינטרנט Apache httpd שגיאה (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 Tweak". Inside it, you can enable or disable php open_basedir Protection, or exclude and include hosts from the protection. בתוך זה, אתה יכול להפעיל או לבטל הגנה open_basedir PHP, או לכלול וכוללים מארח מן ההגנה.
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 אירוח, ייתכן שיהיה עליך לערוך ידנית קובץ תצורה של אפאצ 'י vhost.conf ו vhost_ssl.conf, ולהוסיף או לערוך את השורות הבאות open_basedir php_admin_value הבאה:
<Directory /full/path/to/the/directory/httpdocs> <Directory /full/path/to/the/directory/httpdocs>
php_admin_value open_basedir none open_basedir לא php_admin_value
</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 open_basedir php_admin_value / מלא / path / to / dir: / מלא / path / to / directory / httpdocs: / tmp
</Directory> </ 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 את הספריות כי הם הורשו במפורש עבור בחשבון תחום vhost הסקריפטים PHP לגשת, כדי שתוכל להוסיף בספריות יותר כי הקבצים שנשמרו ואת הצורך להיפתח על ידי 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 (apache2ctl 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: אם אתה צריך לערוך באופן ידני את התצורה של אפאצ 'י הקובץ להגנה PHP open_basedir להשבית, פשוט לפתוח את הקובץ httpd.conf, ולחפש את השורות שמתחיל את התווים הבאים:
php_admin_value open_basedir ….. open_basedir php_admin_value ... ..
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 open_basedir לא php_admin_value
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” open_basedir php_admin_value "/ 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” open_basedir php_admin_value "/ home / user_account /: / usr / lib / php: / usr / local / lib / php: / tmp: / new_directory"
Restart the Apache after finished editing. הפעל מחדש את אפאצ 'י לאחר עריכת גמר. 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 "= / dir / כולל" מאפשר גם גישה "/ 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 = / / Dir כולל /".
IMPORTANT : The page is machine translated and provided "as is" without warranty. חשוב: הדף מכונת תירגם מתפרסם "כמות שהוא" ללא אחריות. Machine translation may be difficult to understand. תרגום מכונה יכול להיות קשה להבין. Please refer to נא עיין original English article המאמר המקורי באנגלית whenever possible. בכל הזדמנות אפשרית.
Related Articles מאמרים קשורים
- Group Policy Login or Logon Scripts Not Running, Not Working or Not Executing מדיניות קבוצתית או התחברות script להתחברות לא רץ, לא תקין או לא מפעיל
- cPanel WHM Failed to Receive Status Information From Apache Error cPanel WHM נכשלה לקבל מעמד אפאצ 'י מידע מאת שגיאה
- PHP Parse Error: syntax error, unexpected $end PHP Parse שגיאה: שגיאת תחביר, לא צפוי סוף $
- winnt_accept: Asynchronous AcceptEx failed Error in Apache Log winnt_accept: Asynchronous AcceptEx נכשל שגיאה ב-Apache התחבר
- Request URL /server-status or 404 Page Not Found Apache Error בקשת כתובת / שרת מעמד או 404 דף לא נמצא שגיאה אפאצ 'י
- Apache Warn NameVirtualHost *:80 Has No VirtualHosts Error When Start אפאצ 'י NameVirtualHost הזהר *: 80 אין שגיאה VirtualHosts תאריך התחלה
- Bypass and Remove 3 Plays or 3 Days Restriction on Zune WiFi Sharing עוקפים הסר Plays 3 או 3 ימי הגבלה על שיתוף WiFi-Zune
- gmmktime Error in WordPress and MagpieRSS שגיאה gmmktime ב WordPress ו MagpieRSS
- Fix Internal Server Error When Accessing Easy Apache in cPanel WebHosting Manager תקן Internal Server Error אפאצ 'י בעת גישה נוחה במנהל WebHosting cPanel
- PHP Allowed Memory Size Exchausted Fatal Error PHP גודל זיכרון מותרים Exchausted שגיאה חמורה










































July 26th, 2009 18:12 26 יולי 2009 18:12
[...] [...] [...] [...]
December 21st, 2007 16:58 21 דצמבר 2007 16:58
Great article. מאמר נהדר.
Thanks for the WHM tip. תודה על הטיפ WHM.
You saved my ass. הצלת את התחת שלי.
December 3rd, 2007 16:21 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, Articulo האו"ם חציר שגיאה muy interesante sobre este en החיים הדיגיטליים שלי. Etiquetas: Desarrollo, hosting, open_basedir, [...] Etiquetas: ועדכונים, אירוח, open_basedir, [...]