PHP Scripts open_basedir Restriction in Effect Error Script PHP open_basedir Restriction Kesalahan dalam Efek
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 perlindungan tweak adalah Safe Mode mengukur keamanan yang mencegah pengguna membuka file atau skrip yang terletak di luar rumah mereka dengan direktori PHP, kecuali folder yang khusus dikecualikan. 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 pengaturan jika diaktifkan, akan memastikan bahwa semua operasi file yang akan terbatas pada file di bawah direktori tertentu, dan dengan demikian mencegah script php untuk pengguna tertentu mengakses file dalam account pengguna yang tidak sah. When a script tries to open a file with, for example, fopen() or gzopen(), the location of the file is checked. Ketika skrip mencoba untuk membuka file dengan, misalnya, fopen () atau gzopen (), lokasi file dicentang. When the file is outside the specified or permissible directory-tree, PHP will refuse to open it and the following errors may occur: Bila file di luar direktori ditentukan atau diizinkan-pohon, PHP akan menolak untuk membukanya dan mungkin terjadi kesalahan berikut:
Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. Peringatan: file_exists () [function.file-exists]: open_basedir batasan yang berlaku. 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) tidak diperbolehkan dalam 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
The above error message appears on a Apache httpd web server error log (error_log) hosting Wordpress blog. Pesan kesalahan di atas muncul di sebuah web server 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. Namun, masalah bisa terjadi pada semua sistem atau situs-situs yang menggunakan PHP sebagai bahasa scripting.
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. Solusi atau ke Workaround open_basedir pembatasan masalah adalah bahwa PHP open_basedir menonaktifkan perlindungan sekaligus, atau untuk mengecualikan perlindungan hak istimewa untuk beberapa account pengguna, atau untuk membolehkan akses ke direktori tambahan untuk PHP script.
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. Jika Anda menggunakan cPanel webhost Manager (WHM), Anda dapat menonaktifkan PHP open_basedir perlindungan pengguna tertentu atau dikecualikan dari perlindungan dengan WHM. Simply go to “Tweak Security” under the “Security” section, then select “Configure” link for “Php open_basedir Tweak”. Cukup pergi ke "Tweak Pengamanan" di bawah "Keamanan" bagian, kemudian pilih "Configure" link "Php open_basedir Tweak". Inside it, you can enable or disable php open_basedir Protection, or exclude and include hosts from the protection. Di dalamnya, Anda dapat mengaktifkan atau menonaktifkan php open_basedir Perlindungan, dan menyertakan atau mengecualikan dari perlindungan alam.
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: Jika anda menggunakan Plesk control panel hosting, Anda harus secara manual mengedit file konfigurasi Apache yang vhost.conf dan vhost_ssl.conf, dan menambah atau mengedit php_admin_value open_basedir berikut ke baris berikut ini:
<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 / ke / dir: / full / path / ke / direktori / httpdocs: / tmp
</Directory> </ Directory>
Note: For SSL hosts in the vhost_ssl.conf file, the Directory path will end with “httpsdocs” instead of “httpdocs”. Catatan: Untuk SSL hosts di vhost_ssl.conf file, Direktori jalan akan berakhir dengan "httpsdocs" bukan "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 “:”. The path (di atas adalah contoh dan hanya untuk diganti dengan jalan) yang berada di belakang open_basedir direktori khusus yang diizinkan untuk skrip PHP di vhost domain untuk mengakses account, sehingga Anda dapat menambahkan lebih banyak file-file tersebut direktori yang telah disimpan dan diperlukan dibuka oleh PHP, warna masing-masing dipisahkan oleh ":". But be careful as it might expose your system to security fraud. Tapi hati-hati karena akan memamerkan sistem keamanan penipuan.
Once done, run the command below to make the changes effective, and then restart Apache httpd web server (apache2ctl restart or httpd restart): Setelah selesai, jalankan perintah berikut untuk membuat perubahan yang efektif, kemudian restart web server Apache httpd (apache2ctl httpd restart atau restart):
$PRODUCT_ROOT_D/admin/sbin/websrvmng -v -a $ PRODUCT_ROOT_D / admin / sbin / websrvmng-a-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: Jika Anda harus secara manual mengedit file konfigurasi Apache disable PHP open_basedir perlindungan, cukup dengan membuka file httpd.conf, dan mencari baris yang dimulai dengan karakter sebagai berikut:
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: Ganti seluruh baris di bawah virtual host untuk domain user account yang Anda ingin menonaktifkan perlindungan dengan baris berikut ini untuk menonaktifkannya:
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. Anda juga dapat memilih untuk membolehkan Anda skrip PHP untuk mengakses direktori bukan tanpa tambahan menonaktifkan perlindungan. Additional directory can be added to the line, separated with color “:”. Direktori tambahan dapat ditambahkan ke baris, dipisahkan dengan warna ":". For example, to add /new_directory to the allow list: Misalnya, untuk menambahkan / new_directory ke daftar mengijinkan pengiriman pesan:
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 setelah selesai mengedit. Note that the directory allowed list restriction above is actually a prefix, not a directory name. Perlu diketahui bahwa daftar direktori diizinkan batasan di atas sebenarnya adalah sebuah awalan, bukan nama direktori. This means that “open_basedir = /dir/incl” also allows access to “/dir/include” and “/dir/incls” if they exist. Ini berarti bahwa "open_basedir = / dir / termasuk" juga memungkinkan akses ke "/ dir / include" dan "/ dir / incls" jika mereka ada. When you want to restrict access to only the specified directory, end with a slash. Bila Anda ingin membatasi akses ke direktori tertentu saja, diakhiri dengan tanda garis miring. For example: “open_basedir = /dir/incl/”. Sebagai contoh: "open_basedir = / dir / termasuk /".
IMPORTANT : The page is machine translated and provided "as is" without warranty. PENTING: Halaman yang diterjemahkan mesin dan diberikan "sebagaimana adanya" tanpa jaminan. Machine translation may be difficult to understand. Mesin terjemahan mungkin sulit dimengerti. Please refer to Silakan merujuk ke original English article artikel asli Inggris whenever possible. bila memungkinkan.
Related Articles Artikel Terkait
- Group Policy Login or Logon Scripts Not Running, Not Working or Not Executing Kebijakan Grup Login atau Tidak Menjalankan Skrip logon, Tidak Bekerja atau Tidak Pelaksana
- cPanel WHM Failed to Receive Status Information From Apache Error cPanel WHM Gagal Menerima Informasi Status Dari Apache Error
- PHP Parse Error: syntax error, unexpected $end PHP Parse Error: syntax error, unexpected $ end
- winnt_accept: Asynchronous AcceptEx failed Error in Apache Log winnt_accept: Asynchronous AcceptEx gagal di Apache Error Log
- Request URL /server-status or 404 Page Not Found Apache Error Meminta URL / server-status atau 404 Halaman Tidak Ditemukan Apache Error
- Apache Warn NameVirtualHost *:80 Has No VirtualHosts Error When Start Apache Peringatkanlah NameVirtualHost *: 80 Tidak Ada Kesalahan Saat Mulai VirtualHosts
- Bypass and Remove 3 Plays or 3 Days Restriction on Zune WiFi Sharing Memotong dan Hapus Plays 3 atau 3 hari Restriction pada Zune WiFi Berbagi
- gmmktime Error in WordPress and MagpieRSS Kesalahan dalam gmmktime Wordpress dan MagpieRSS
- Fix Internal Server Error When Accessing Easy Apache in cPanel WebHosting Manager Perbaiki Internal Server Error Ketika Mengakses Mudah Apache WebHosting Manager di cPanel
- PHP Allowed Memory Size Exchausted Fatal Error PHP Allowed Memory Size Exchausted Fatal Error










































December 21st, 2007 16:58 21 Des 2007 16:58
Great article. Great artikel.
Thanks for the WHM tip. Thanks for the tip WHM.
You saved my ass. You saved my ass.
December 3rd, 2007 16:21 3 Des 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. [...] Informasi queréis más sobre este tema, hay un artículo muy interesante sobre este error en Saya Digital Life. Etiquetas: Desarrollo, hosting, open_basedir, [...] Etiquetas: desarrollo, hosting, open_basedir, [...]