Jfolder create could not create folder joomla lỗi năm 2024

This process also means that consistent information is gathered and presented in every case, enabling helpers to quickly target information relevant to the specific problem observed by the user.

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

Source: http://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:

This error occurs when you move from one host to another host. It is because when we move a Joomla site from one server to another server, the log & tmp functions present in the configuration.php file contains the directory path where you had previously installed Joomla i.e. on the old server.

Fix for ‘JFolder::create: Could not create directory’ Error

Unlike other Errors, the fix for this error is pretty Simple. Follow the steps below to fix it.

  1. Goto your Hosting panel >> File Manager >> Select your Domain/Sub-Domain and then open the configuration.php file.
  2. Find var $log_path, it will contain the Directory path of your Old Server. Just replace the whole line with the code var $log_path = './logs';
  3. Find var $tmp_path, it will also have the Directory path of your Old Server. Replace the whole line with the code var $tmp_path = './tmp';

That’s it! Your problem will be solved with this small tweak in the code. Make sure that you properly copy paste the code. If you still face any problem then don’t hesitate to put in a Comment with your query. Subscribe to Our RSS Feeds / Daily Updates if you don’t want to miss the ‘Top 10 Joomla Extensions’ post which I will be making soon. Meanwhile read the top 10 WordPress Plugins I use on DailyBlogging. Did this tweak help you to fix your problem ??

Yes, logged into cPanel and checked with File Manager. All folders are set to 755. I have never had a problem with installing Components. I have installed SOBI2 JCE Xmap and have had no problems.

Note: We know that this Joomla error has been covered in other places before – but in many cases, the solutions presented elsewhere do not solve the problem and none of the other places explains why this problem happens in the first place. We will try our best to present an actual solution that will work for anyone and we will also explain why this problem happens!

First we would like to apologize. We have seen and fixed this problem so many times now (for years) but we have never written about it. So here’s a post explaining when the “JFolder::create: Could not create directory” error happens, why it happens, and what you can do to solve the problem.

When does this problem happen?

The problem happens when you try to install an extension or a template from the backend on your Joomla website. Instead of seeing a Success message, you will see the JFolder::create: Could not create directory error message. The aforementioned error message is usually accompanied by the Warning: Failed to move file! error message.

Essentially, when you see this error then most likely you are not able to install any extensions or templates on your website.

Why does this problem happen?

This problem happens because of one of the following reasons:

  • The tmp directory does not exist or is not correctly referenced in the configuration.php file.
  • The tmp directory exists, but Joomla doesn’t have the permissions to write to it.
  • Joomla doesn’t have the permissions to write to one of the following directories: /administrator/components, /administrator/modules, /administrator/templates, /components, /modules, /plugins, /templates.

The latter case is very common nowadays and usually happens when there is something wrong with Joomla’s hosting environment – for example, the Apache user is in a separate group than that of the cPanel user (the user responsible for uploading files through cPanel and FTP). We have seen this on both cPanel and Plesk environments (although we have to say that this issue is far more common on Plesk).

What can you do to fix this problem?

Besides creating the tmp directory if it doesn’t exist and give Joomla the proper permissions to write to it, a quick and dirty fix will be to chmod the following directories to 777 through your FTP client:

  • /administrator
  • /administrator/components
  • /administrator/modules
  • /administrator/templates
  • /components
  • /logs (not necessary to solve this problem but if Joomla has write permissions across the board then doing this will ensure that you don’t have a problem elsewhere on your website)
  • /modules
  • /plugins
  • /templates
  • /tmp

As we said – the above is a quick and dirty fix – but it will render your website completely insecure. So, you must leave the above as a last resort if you’re stranded on time and only as a temporary fix.

So, what’s a better solution?

A better solution would be to call your hosting company and tell them that you’re having a problem with your Apache user not being able to write on the Joomla directories. What they will do probably (if they decide to take any action) is that they’ll chown (change ownership) of all the Joomla files and directories to the Apache user, this will solve your problem immediately. Some lazy hosts may just chmod everything to 777 – make sure that they don’t do that!

OK, so what’s the best solution?

The best solution to this problem requires some work on your side – but it’s the cleanest solution and requires that you only have FTP access to your website. You see, the reason why the cPanel (or Plesk) user owned the Joomla files and directories in the first place is because that user was the one uploading the folders/files – in other words – that user was responsbile for creating those folders/files on the server’s filesystem. So, what can we do to make Apache create (own) those files instead? Easy! All we need to do is the following:

  • Zip the Joomla website (all of it – e.g. all files and directories) using cPanel’s File Manager – call the resulting zip file joomlawebsitebackup.zip. The resulting zip file must be placed under the root directory of the website.
  • Append 1_ to all the top level folders and files in Joomla. This means renaming the folder administrator to 1_administrator, and index.php to 1_index.php
  • Create an unzip.php file that contains the following code: <?php ini_set("memory_limit", "4096M"); set_time_limit (0); $objZip = new ZipArchive; $isZipOpen = $objZip->open('joomlawebsitebackup.zip'); if ($isZipOpen === TRUE) {
    $objZip->extractTo('/home/[yourcpanelusername]/public_html/');  
    $objZip->close();  
    echo "Finished unzipping";  
    
    } else {
    echo "Failed unzipping";  
    
    } ?>
  • Run the unzip.php by going to yourjoomlawebsite.com/unzip.php on your browser. The unzipping might take several minutes to several hours, depending on the size of your website. Please be patient. Once the process is done, you should see a message telling you that the PHP script has finished unzipping the file.
  • Now login to your Joomla's backend and you'll notice that you are now able to install any extension, while the permissions on your directories are still 755. This is because Apache is now the owner of all the Joomla files and folders, because it (Apache) was the one creating them with the unzip script.
  • Test your website thoroughly - once you are sure that everything works as it should, then delete all the folders and files that start with 1_. Once you do that, do another test on your website to make sure that everything's OK.

Can this error happen on Joomla 2.5 as well?

Yes - in fact, the JFolder::create error exists on nearly all versions of Joomla. You can run but you can't hide!

Do you still have this problem? Read on!

We have presented a solid solution to this problem - if it doesn't work for you, then please retrace your steps and double check that you're following the process with no modification whatsoever. If you're still experiencing problems doing the above (even after retracing your steps) or if you need help, then contact us! We're fast, we're professional, we're friendly, we're always there, and our rates are affordable!