Fixing open_basedir in Joomla

yellowwebmonkey web services

Many security tools and blogs suggest setting the open_basedir in the php.ini file.  The open_basedir directive “Limits the files that can be accessed by PHP to the specified directory-tree, including the file itself. … When the file is outside the specified directory-tree, PHP will refuse to access it.” *

 

However, it can often trigger the error:

JFolder::create: Path not in open_basedir paths

 

In order to solve this, you have three options:

1. Disable it:  

Open your php.ini file and comment out the line below with a semi-colon ;

;open_basedir = /home/username/public_html

 

If you do not see it in there, you can check your .htaccess and comment out with a number sign (that’s hashtag for younger folks) #

#php_admin_value open_basedir /home/username/public_html

 

2. Set to null:  

Open your php.ini file and comment out the line below with a semi-colon ;

open_basedir = none

 

In the htaccess, it is 

php_admin_value open_basedir none

 

2. Fix it:  

Since Joomla needs access to your tmp folder, you need to adjust the line to below**:

open_basedir = /home/username/public_html:/tmp/

 

In the htaccess, it is 

php_admin_value open_basedir /home/username/public_html:/tmp/

 

/home/username/public_html:/tmp/

 

* Source:
http://php.net/manual/en/ini.core.php#ini.open-basedir

** Source:https://docs.joomla.org/Security_Checklist_2_-_Hosting_and_Server_Setup#Consider_Using_PHP_open_basedir

 

 

 

About YellowWebMonkey

YellowWebMonkey Web design offers reliable website design, SEO and digital marketing services for Joomla, WordPress and Shopify sites. We strive to be a one-stop shop for all your web needs.

Recent Posts

Follow Us