JFolder::create: Could not create directory - Joomla
Asked Answered
B

4

7

I end up with below error when I try to install a component,module or plugin.

JFolder::create: Could not create directory

What could be the issue?

Benzocaine answered 4/4, 2013 at 4:16 Comment(1)
possible duplicate of JFolder::create: Could not create directory in all pagesSender
B
26

Change the below variable to in your configuration file(configuration.php) as shown.

public $log_path = '/logs';
public $tmp_path = '/tmp';

Also make sure that these folder has the folder permission 755.

Read more

Benzocaine answered 4/4, 2013 at 4:16 Comment(2)
i have same problem and did this but nothing changes. what can i do? i'm using joomla 2.5Samples
make sure apache can write to those folders, and is the owner of everything in your joomla projectHemocyte
L
4

Now I found two solutions for resolving this issue,and both of them has been worked very well:

Solution One:

First find the exact absolute path to your tmp folder by using this trick:

Create a PHP file in your website root,for example path.php

Place this snippet of code in the file and hit the save button

<?php
$path = getcwd();
echo "Your Absolute Path is: ";
echo $path;
?>

Navigate to yourdomain.com/path.php in your browser

From now on:

  1. Login to your Joomla Administartor panel.
  2. Go to Global Configuration
  3. Click on the "Server" tab
  4. Change the path to the "Absolute Path(you've just found)"/tmp
  5. Insert this line of code in your .htaccess file: php_value open_basedir NULL

    This solution has been worked very well for me,and it's doesn't deal with any Joomla's core file hacking.

Solution Two:

  1. Login to your Joomla Administartor panel.
  2. Go to Global Configuration
  3. Click no the "Server" tab
  4. Change the path from /public_html/tmp to just tmp
  5. Login to control Panel(CPanel),(Or you can use a FTP account for this purpose)
  6. Open File Manager (if you are using FTP,this step must be skipped)
  7. Open Folder "libraries"
  8. Open Folder "joomla"
  9. Open Folder "filesystem"
  10. Right Click on "folder.php" and click Edit.
  11. Look for the line, (search = obd): $obd = ini_get('open_basedir'); Comment out that line with // at the beginning so it becomes://$obd = ini_get('open_basedir');
  12. Save and Close.
Laodicea answered 27/9, 2014 at 3:22 Comment(3)
Editing core files are not recommended.Benzocaine
just so you know - if the tmp and logs folders are incorrect you can't login to the administrator back end of Joomla as you get the same message. I've found the best way is to use the getcwd () php code in a file called path.php in the root of your joomla installation, load up path.php and copy the right path then open up configuration.php and add it to the beginning of the $log_path and $tmp_path variablesFiedler
I struggled with this for an hour thinking "/home/MYWEBISTE/public_html/tmp" was the absolute path. Instead, I tried /Applications/MAMP/htdocs/home/MYWEBSITE/public_html/tmp as the absolute path (which it is!). This worked for me (using a Mac and MAMP obviously).Farnham
E
1

You can change the owner of Joomla folders to your apache server user.

You can find the apache server user with the following command:

ps aux | grep -v root | grep apache | cut -d\  -f1 | sort | uniq

Source: https://serverfault.com/questions/125865/finding-out-what-user-apache-is-running-as

For Ubuntu, it's www-data.

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 www-data)

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 .
Epizoon answered 10/6, 2016 at 12:6 Comment(0)
C
0

After a lot of trouble with this error, I got a break through. In the configuration.php file, edit the var logpath n tmppath values as below var $log_path = '/home/public_html/sitename/logs'; var $tmp_path = '/home/public_html/sitename/tmp';

This definately will work. And works for me.

Crossbones answered 4/4, 2013 at 4:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.