Thursday, May 03, 2012

How to solve the problem "JFolder::create: Could not create directory" or "JFolder::create: Path not in open_basedir paths;

If you have tried everything else on your installation (changing the $log_path to ./log, change $tmp_path to ./tmp, chmod folders to 777) and you still can't install any module or component in Joomla, then continue reading.
This solution is helpfull if you can't change the ownership of the files and directories on your server (usually shared hosts) and you don't want to wait for help from your hosting provider.

First you need to chmod to 777 the following directories:


/administrator/backups/

/administrator/components/

/administrator/language/

/administrator/language/en-GB/ 
/administrator/modules/

/administrator/templates/

/components/

/language/

/language/en-GB/

/modules/

/plugins/

/plugins/content/

/plugins/editors/

/plugins/editors-xtd/

/plugins/search/

/plugins/system/

/plugins/user/

/plugins/xmlrpc/

/tmp/

/templates/

/cache/
 
1. Open "your-website.com/libraries/joomla/filesystem" with your default FTP client.
Please make backup of the file first.
2. Download filename "folder.php".
3. Open folder.php in your default text editor
4. Go to line 210
5. Look for:     " if (strpos($path, $test) === 0) { "  and change it to "if (strpos($path, $test) === 1) { "
6. Than look for (line 216):  " if ($inBaseDir == false) { "  and change to  " if ($inBaseDir == true) { "
7. Save your file (folder.php)
8. Upload it to the location "your-website.com/libraries/joomla/filesystem". 

That's it!
No more errors when you want to install any component, plugins, module, etc.. in backend of joomla

No comments: