Unrestrict open_basedir

Asked 2 years ago, Updated 2 years ago, 97 views

When I try to run a PHP script, I get the following error:

 WARNING: is_readable() [function.is-readable]: 
    open_basedir restriction in effect.
    File(/usr/share/php/Am/View/Helper/HeadScript.php) is not with the
    allowed path(s): (/home/1205915141/members-net/:/tmp:/usr/share/pear/)
    inline 198 of file 
    /home/1205915141/membersnet/public_html/library/Zend/Loader.php

When I asked the server administrator, he told me that open_basedir cannot be changed for security reasons, so I tried to use htaccess to release it as follows, but it doesn't seem to work.

php_value open_basedir/usr/share/php/ 

I don't know if the pass is wrong or the writing itself is wrong, but I would appreciate it if you could let me know as it will not work.

php .htaccess

2022-09-30 20:30

3 Answers

Try using php_admin_value instead of php_value.

php_admin_value open_basedir/usr/share/php/

Note: PHP: Core php.ini Directive Description - Manual http://php.net/manual/ja/ini.core.php#ini.open-basedir


2022-09-30 20:30

Is it a shared server or something like that? Place all files and libraries you want in a directory where you can manage them yourself.

The contents that can and cannot be configured in Htaccess are listed in the php documentation. I think this is a system level that administrators can only set per system.

All files handled, including scripts, frameworks and libraries, are subject to permission checks. Change settings and programs to avoid loading files from shared directories.


2022-09-30 20:30

Is the PHP version used less than 5.3.0?

If open_basedir is less than 5.3.0, it is PHP_INI_SYSTEM, so you cannot change it with .htaccess.

http://php.net/manual/ja/ini.core.php#ini.sect.path-directory

In httpd.conf, you can use php_admin_value, but you can't do that with a shared server.

Even if it is 5.3.0 or higher, I don't think it is possible to change the setting to a loose one such as .htaccess.


2022-09-30 20:30

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.