Recent Posts

Showing posts with label Apache. Show all posts
Showing posts with label Apache. Show all posts

How to fix: open_basedir restriction in effect.

Modify the open_basedir settings in your PHP configuration (See Runtime Configuration).

The open_basedir setting is primarily used to prevent PHP scripts for a particular user from accessing files in another user's account. So usually, any files in your own account should be readable by your own scripts.

Example settings via .htaccess if PHP runs as Apache module on a Linux system:

<DirectoryMatch "/home/sites/site81/">
    php_admin_value open_basedir "/home/sites/site81/:/tmp/:/"
</DirectoryMatch>

How to solve: Warning: open_basedir restriction in effect

This warning can appear with various functions that are related to file and directory access. It warns about a configuration issue.
When it appears, it means that access has been forbidden to some files.
The warning itself does not break anything, but most often a script does not properly work if file-access is prevented.
The fix is normally to change the PHP configuration, the related setting is called open_basedir.
Sometimes the wrong file or directory names are used, the fix is then to use the right ones.
The open_basedir setting is primarily used to prevent PHP scripts for a particular user from accessing files in another user's account. So usually, any files in your own account should be readable by your own scripts.
Example settings via .htaccess if PHP runs as Apache module on a Linux system:
<DirectoryMatch "/home/sites/site81/">
    php_admin_value open_basedir "/home/sites/site81/:/tmp/:/"
</DirectoryMatch>