Joomla Error – “JFolder::create: Could not create directory” while installing extension
I recently got the following error while trying to install a custom extension on Joomla.
JFolder::create: Could not create directory
This kind of error is generally related with folder permission. I checked for the folder permission in my Joomla installation and it seems to be fine. The folders have 755 permission.
The other reason is the folder owner. This kind of error occurs if your folders’ owner is other than your Apache server’s user. If so then you have to change your folders’ owner to Apache user.
You can find the apache server user with the following command:
ps aux | grep -v root | grep apache | cut -d\ -f1 | sort | uniq
For Ubuntu, it’s
After you know the apache user name, then you can change the owner of all the folders and files of your Joomla installation. You can use the following command to do so:
(I suppose that your apache user is
sudo chown -R www-data:www-data /path/to/your/joomla
If you are already inside your Joomla directory, then you can run the following command:
sudo chown -R www-data:www-data .
Now, you should be able to install any custom extension from your Joomla admin.
Hope this helps.