How to fix Joomla Error 0 'Cannot open file for writing log while updating'?

by Sidick Allaladé on 17/01/2020

Updated at 25/06/2022

Did you already try udpating your joomla website and you got this error :

"An error has occurred. 0 Cannot open file for writing log"

Don't worry, you're not alone, this may be due to different reasons, here are couple of them and solutions to fix each of them.

If you have issue with updating backend you won't probably be able to to it, so open the file "configuration.php" and find path of tmp or log folders and replace with correct path.

Here is an exemple of a path to Log and tmp Folder :

  1. Permission issue 

    Make sure all files and folders apart from the global configuration.php are writable. If they aren't, then you will need to change the permissions, so that all folders are set to 755 and files are set to 644.
    To check permissionn in the Joomla backend, go to:

    System (top menu) >> System Information >> Directory Permissions

    You can either do this using an FTP client such as FileZilla, SSH or a Joomla extension such as  Admin Tools .

    I usually use SSH and here are the normal permissions of any joomla website, Remember to go in the project folder before running these 2 commands.

    		find -type d -exec chmod 755 {} \;
    		find -type f -exec chmod 644 {} \;

    Admin Tools extensions is really helpfull for this is you are not familiar with SSH, but even if you are, Admin Toools for joomla is a good option to add protection on your joomla or wordpress website.

    Do not set the permission to 777 !

  2. Wrong directory paths for the tmp/log directories, defined in the configuration file 

    You must configure your "/log" and or "/tmp" folder to a absolute links of your server, in the backend of joomla.
    To check/change the path, in Joomla backend, go to Global Configuration and then choose the Server tab and check if the Path to Log folder is correct

    • log : $log_path
    • tmp : $tmp_path
  3. If you are not sure what is your path is create a .php file and paste this code to know what is the absolute path to your server. Upload and call it on your browser: ex:, here is the code

    		   $path = getcwd();
    		   echo "Your Absolute Path is:" . $path;
  4. Directories and file ownership 

    Check the ownership of the folder it can be set to root:root and this can be set from your /var/www/html folder.

    Problem arises if you want to write something to files within your website (change existing files or upload new files) . Root privileges would not allow you to do so.

    To fix it you need to set ownership to www-data:www-data or apache:apache.

    You need to pay attention to make sure that you set www-data or apache permissions only to directories (files) that you need to change from website.

    Setting it to /var/www/html or even /var/www is not recommended as it is big security hole.


Learn in those articles about CMS, internet safety and API.

If you need any help with web development don't hesitate to contact our web development agency. We run the best custom web development agency in Montreal.

Oshara CEO Sidick

Find Out How My Team will "transform" your businesses through Reliable Application or Technology

Web development - We are a team of passionate web coders that will materialize your ideas in ways you could not even imagine.

API Integration - There is no secret using any API, connect all the tools you need, the way you need it.

IT And Cybersecurity Audit - Protect your customers, protect your business and protect yourself.

Maintenance & Support - We help organization to increase efficiency, improve performance, minimize downtime, and extend their lifespan.

Book a Call

Sidick Allaladé

Sidick Allalade, is Chief Technology Officer at Oshara INC and co-founder of the Osortoo web application. He loves solving complex IT problems, coding and everything IT. He has a good knowledge of online marketing and IT Governance, Audit and Security.
His experience spans hundreds of projects with companies of all sizes which makes him a valuable asset on any team.

Was this article useful?

People Who Read This Article Also Read...

How to install a Laravel web application that you cloned from Git

Laravel is a powerful php framework that allows you to create custom web applications

How to install a Laravel web a...

Everything You Need To Know About Communication Agencies

By definition, a communication agency (marketing) is a company that plans and harmonizes internal and / or external communication on be...

Everything You Need To Know Ab...

12 questions to ask when collecting customer data

Collecting data from customers is an important marketing strategy since it gives you information on what customers exactly want instead...

12 questions to ask when colle...

How to fix Joomla Error 0 'Cannot open file for writing log while updating'?

Did you already try udpating your joomla website and you got this error : "An error has occurred. 0 Cannot open file for writing log" ...

How to fix Joomla Error 0 'Can...

This is How you can Simplify Complex Enterprise Workflows in Your Business

A workflow is a repeatable scheme or pattern of a sequence of steps or activities that are undertaken to realize the completion of a pa...

This is How you can Simplify C...

Is ETL Still Relevant in 2019?

ETL is an abbreviation for extract, transform, and load. It is one of data integration tools used in the extraction of data from a sour...

Is ETL Still Relevant in 2019?