Solution for the JFolder::create: Could not create directory error

If you are getting this with your Joomla 1.5.x, then you error is simple, you got to check the directory permissions for the module, templates and tmp folder.

Check as well the tmp folder location with your Hosting. If you point to the wrong location it will not be able to create a temporary directory and move files. Usually the /tmp used on the configuration file should do the deal (this was my issue, I was using an folder other the the tmp as temporary folder and it was failing).

Have fun.

About mcloide

Making things simpler, just check: http://www.mcloide.com View all posts by mcloide

48 responses to “Solution for the JFolder::create: Could not create directory error

  • kishore

    * JFolder::create: Could not create directory
    * Warning! Failed to move file.

    when i will try to installed component &module

    what is solution

    • mcloide

      You got make sure that the permissions for your user on the host has write and execute permissions (755) for at least the components, module, template and tmp directories otherwise you won’t be able to install the component or module.

    • Eddie

      I had the same problem and in my case it was a stupid easy solution! My hosting account was over quota! So I assigned more disc space and that solved my problem.

      Hope it helps!

  • Tito

    This is so simple you will not believe it.If you host with UCVHOST they would give you the solution which is changing your configuration.php in the following section -var $tmp_path and var $log_path to the following.
    var $tmp_path = ‘C:\Inetpub\vhosts\mtandaowireless.com\httpdocs\tmp’;
    var $log_path = ‘C:\Inetpub\vhosts\mtandaowireless.com\httpdocs\logs’;

  • Tito

    I forgot to add that part that says mtandaowireless.com ahould be your domain name.

    • mcloide

      Great tip.

      Basically is the same concept. You need a directory where you can write tmp and log files. If you can set that up, even in another place, then the solution is set.

      If you already have a tmp or log dir set on your host account and know the path then the solution suggested by UCVHOST is a great exit.

  • Reiko Arashi

    I think you may have fixed my problem! 🙂
    Hopefullllllyyy this works and i didnt screw something up XD

  • Thai Min

    The solution for Windows users:
    If you are using Windows Vista (the procedures almost same for other vesin of Windows), you need to browse the Joomla folder. Right click on the folder -> click Properties -> click Secrity tab -> click Edit button -> choose “USERS” in “Group or user names:” -> tick Allow checkbox at “Full Control” -> Click OK and done!!

    It worked for me. Good luck.

  • ali ebrahimi

    set $tmp_path and clear all files in tmp dir (no index.html)

  • Larus Runar

    Hi – I’ve been trying to read through your suggestions, but I must omit that I do not understand them. I am working on a mac (snow leopard) if that matters? I downloaded a free joomla template from: http://www.joomla24.com/remository/Download/Templates_for_Joomla_1.5/General_Joomla_1.5_Templates/1sr_First.html

    But when I try to upload this template, by following Joomla help directions, I keep getting the below messages:

    JFolder::create: Could not create directory
    Template Install: Failed to create directory. “/Applications/XAMPP/xamppfiles/htdocs/joomla15/templates/1sr_first”

    What am I doing wrong? I am not sure where to make the changes recommended above – so I change these settings in Terminal, configure.php or ?

    • mcloide

      Hi Laurus,

      The issue with the JFolder create is simple, therefore will need some knowledge of the server from your part.

      The error happens because the site does not have permissions to write in the directories:

      – temporay files
      – templates
      – modules
      – components

      Basically any directory where it needs to install / upload files. For those directories you must set to write / execute permissions, otherwise, whenever it tries to create a folder, the error is thrown.

      Make sure that you can write on your temporary files directory too and make sure that your temporary files directory is the one that the configuration file is pointing at, otherwise, you will also need to set the write / execute permissions to this directory as well.

      I have just noticed that your XAMPP is under the Applications directory, there is a very good chance that you cant write in that dir. A good way to test this out is to move the htdocs folder from inside the Applications directory to another folder externally to it (like the user folder). Make sure to configure Apache to point to the new location.

      In the comments above there are also a bunch of good techniques to fix the issue. If the suggestion that I have made is not working, try the other ones that the readers have done, if it worked for one, it might work for another 🙂

  • 8trust8

    Usually this is what will work in Joomla 1.5 configuration.php file:

    var $log_path = ‘../logs’;
    var $tmp_path = ‘../tmp’;
    var $live_site = ‘http://www.yoursite.com/sub-directory’;

  • Novica

    Ok people i DESPERATELY need help! I already UPLOADED my site to the host and it is up and working.Now i want to add the extension for the games! When i try to install the package file it says : JFolder::create: Could not create directory
    Component Install: Failed to create directory.: “/home/myusername/public_html/administrator/components/com_mochigames”
    What is wrong with this?? i have set permission to 777 to : TMP,COMPONENTS,TEMPLATES,PLUGINS even IMAGES but it is still not working! 😦
    My path to tmp fplder looks like : “/home/my username/public_html/tmp”
    Thats it,i dont have my path like : /var/www/webhost(should the webhost end with “.com” or without it?)/my site .cz.cc (should i put www in front of my site,or without it?)/home/my username/public_html/tmp
    I dont know trully which one of those two is the answer,pls help me!

    • mcloide

      Most likely your tmp path is wrong. With some hosts the tmp path is different from the html-root folder (external). Contact your hosting provider and ask them what would be the tmp path for your site and point the configuration to that, or, if they can, to set the tmp folder to be internal yours public+html directory so you have control.

      Hope it helps.

      Cheers

  • idrapsion

    I received this error:

    * JFolder::create: Could not create directory
    * Template Install: Failed to create directory. “/home/psioni/domains/psionics.mxhoste.com/public_html/joomla/templates/allrounder”

    The permissions for my components, module, template and tmp directories are 755 or 777. I only know basic HTML and I don’t know how to determine if I need to change something with my tmp folder. Can you please explain to me in simple terms what I should do? Thank you.

    • mcloide

      Hey,

      Check first where is the location of your tmp directory and compare it with the path that is on the Global configuration. Probably the error being thrown is because it is trying to create a dir inside a tmp dir that is different from the one from the Global config and breaking from there.

      If not so, make sure that:
      /home/psioni/domains/psionics.mxhoste.com/public_html/joomla/templates

      have the 777 or 755 permissions.

      Other than this, you should be able to correctly install the template.

  • Jules

    Hi guys,

    I read through all the fixes you suggest in this instance but I’m afraid none of them work for me. All of the above mentioned folders have permissions of 755. However, there are 2 tmp folders. One is in the root and the other is in the public_html directory. If I change the configuration.php to the tmp folder outside the public_html, my problems worsen. And keeping it pointed at the tmp folder inside the public_html folder, doesn’t change anything.

    Not to put too fine a point on it, but here are my paths for log and tmp:

    var $log_path = ‘/home/upnorth411/public_html/logs’;
    var $tmp_path = ‘/home/upnorth411/public_html/tmp’;

    I don’t have a clue. I’ve tried to call my host and they told me it’s a third party problem which they can’t do anything about.

    Any help would be appreciated.

    Thanks.

    • mcloide

      Check with your host provider where is the correct path for your tmp folder and set that into the Global config file. This should solve your issues. Same for the logs. Most likely the service provider will ask for you to create on folder and they will set that as your log directory for the Apache server.

  • Jules

    Ok here’s the solution that worked for me. It seems the path was wrong. Instead of it being the full url i.e. upnorth411, the host only required the “upnorth4” part.

    Took me all day to figure this out after I moved the site from one domain to another. Really bad mistake but I bet I’m not the only one with this problem.

    • mcloide

      I had a similar problem with my host provider. They pretty much cut the name of the domain to create the username, but after you got that around all works.

      It is a good point to keep track here.

      Thanks 🙂

  • vinay

    try

    var $log_path = ‘../logs’;
    var $tmp_path = ‘../tmp’;

    instead of

    var $log_path = ‘./logs’;
    var $tmp_path = ‘./tmp’;

    it worked for me

  • Morten

    Insert correct FTP settins and it is resolved

  • ardy ferdiansyah

    thank you
    This forum really helped me … to mcloide on and everyone who has been providing solutions for joomla problem that I experienced in terms of installation
    thank you for your help

  • kashif

    JFolder::create: Could not create directory

    plese ned help even this error is showing in the front page so I just make the website offlien for a time being.. need help urgently..

    • mcloide

      You surely have a permissions problem. If none of these helped, then check your server settings and in a last case scenario, talk to the server admin to see if your settings are actually being done.

  • Henrikas

    Good day. I spent whole day reading various solutions about this problem. Thing is I still can’t get over it.. Got tmp path from host using mentioned methods above here. Made that correction in configuration.php file, on joomla Global Config, Path to Temp Folder copied whole path with /tmp, have made ALL folders 777 for debug purpose and it still doesnt work. Any ideas or comments welcome. Appreciate you help.

  • Kingdom Hearts Media

    I found out that CHMOD-ing the folders in question to 777 provide a solution to the problem. Yes, it’s bad for security of course, so once it’s done it should be changed back, but it provides a temporary solution until a better one is found.
    From what I’ve read, this is a pretty big problem with Joomla 1.5
    Nonetheless, this was a very helpful page! Kudos to Mcloide and all the others who offered solutions.

  • vijay

    If i am using wamp on my pc as local server then what to do??

    • mcloide

      On a Windows OS you shouldn’t be having a problem, but check if the folders are writable including the temps folders (windows also). The whole problem with this issue is that some folders from the Joomla installation cannot be written and that is what throws the error.

  • raman kumar

    hello friends i have uploaded a website but is shows error jfolder:could not create directory
    please help me …

  • game news

    game news…

    […]Solution for the JFolder::create: Could not create directory error « PHP Libraries, API's and Frameworks[…]…

  • Michael

    Hi everyone,

    Thanks heaps for all the suggestions. Took me just a few minutes to learn a stack of stuff. Someone said check your FTP settings… then I found this unrelated suggestion.

    “If you are unsure where your site’s temporary directory is located, you can look it up by going to the Global Configuration, click on the Server tab and take a look at the Path to Temp-folder setting. The default setting is the tmp directory under your site’s root.”

    I discovered that a couple of moves that I did, some time ago, had meant that the setting for the temp folder was incorrect. A quick change, and the extensions was loading correctly.

    /home/tractor1/public_html/tmp WRONG
    /home/tractor/public_html/tmp CORRECT

    Hope that helps someone else.
    Michael

  • Joomla|Joomla templates| Joomla tutorials|Joomla tips|Joomla blog|Joomla extensions

    Joomla|Joomla templates| Joomla tutorials|Joomla tips|Joomla blog|Joomla extensions…

    […]Solution for the JFolder::create: Could not create directory error « PHP Libraries, API's and Frameworks[…]…

  • creare site

    creare site…

    […]Solution for the JFolder::create: Could not create directory error « PHP Libraries, API's and Frameworks[…]…

  • Adeyemi

    Reset the public_html to 777

    • mcloide

      Setting the plublic_html to 777 is a dangerous move so DON’T DO IT.

      This means that all your root directory is now accessible through the web and this make’s it easier for placing external scripts and some other types of attacks where the attacker can have full control of your server / web application.

      Set the correct directories to have 755 but never place the root directory as 777.

  • last

    It’s urgent. Thank you in advance.

    I developed an application in Joomla using extensions. I used fabrik for data entry, data fetching and CSV extraction. The problem is in fabrik, the data that I am getting is in CSV format not Excel format. And now my requirement is: I want to make a page completely on my own from scratch that fetches data from a database that has already been entered through fabrik and displayed on the page.

    I have no no idea how to make my own page that connects to a database to fetch values. Do I need to create a module only with .php, .xml, and index.html files? Or do I need to create a controller also? Where should I save my files?

    Please help me in knowing:

    What files I need to make.
    Where I should place these files.

    For the content of files, I will check on internet.

    • mcloide

      I have never created a component for Joomla, but that is what you are looking for. Shouldn’t be hard, but you will need a local development environment for testing.

      Check the documentation:

      You can use builders too to easy up the process:

      and you can check some articles available to be able to develop it:

      Either way, the process of connecting and retrieving the info should be all wrapped up with the cms functionality which, as my guess, will be something very similar to the php PDO library.

Leave a reply to vijay Cancel reply