
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 :
*/home/**yourusername**/public_html/logs*
or
*/home/**yourusername**/public_html/administrator/logs*
*/home/**yourusername**/public_html/tmp*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 !
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
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: www.domain.com/path.php, here is the code
$path = getcwd();
echo "Your Absolute Path is:" . $path;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.
[[hook_it_sid]]
1. Permission issue, 2. Wrong directory paths for the tmp/log directories, defined in the configuration file, 3. If you are not sure what is your path is create a .php file, 4. Directories and file ownership
Here is an exemple of a path to Log and tmp Folder : */home/**yourusername**/public_html/logs* or */home/**yourusername**/public_html/administrator/logs* */home/**yourusername**/public_html/tmp*

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?

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

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

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

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

With the aim of helping companies improve their notoriety through their blogs. Oshara Inc, shares his knowledge about Netlinking in thi...

Like Twitter and Facebook, Instagram offers the possibility for administrators of an Instagram page to certify certain pages. Oshara In...
By registering, you agree to receive emails from Oshara.
By registering, you agree to receive emails from Oshara.