9

I have tried to update a Joomla website,to the newest update they have released from the admin area.

But after attempting to update,

I have received this error message:

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

What is the problem?

  • @Valentin Despa,thank you for editing the question. – Hbirjand Oct 6 '14 at 15:31
11

Sounds like a permissions issue.

In the Joomla backend, go to:

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

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.

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

If you have already done this, then make sure you have defined your log directory correctly, as sometimes the path to the logs folder may be incorrect. 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.

Also, note that you can download the Joomla update package and upload it to the root of your website and extract it rather than use the Joomla update feature.

Hope this helps

2

You must configure your "/log" folder to a absolute links of your server, in the backend of joomla. For example : /www/public_html/log.


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.yourdomaine.com/path.php

this is the code

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

The error is because your logs and tmp folder path is not correct. You have two way to edit this path:

  1. Go to ftp of your account and find this file and edit via cuteftp or filezila or file manager .... configuration.php and find path of tmp or log folders and replace with correct path

  2. Go to admin part of joomla Global Configuration --> System --->

Path to Log Folder

*/home/**yourusername**/public_html/logs*

Global Configuration --> server ---> you can see Path to Temp Folder and change it to

*/home/**yourusername**/public_html/tmp*

after home you should replace your hosting account user name

if you using plesk or directadmin or other control panel you should contact your hosting support regard these path address and replace it in where i mentioned

hope your issue has been solved and this help u

2

Just a bit of all around info wrapped here...

Permissions issues usually are caused by 2 main reasons:

  1. Real file/folder permissions issues on the OS
  2. Wrong directory paths for the tmp/log directories, defined in the configuration file.

The best way to see if there is actual a permissions issue is to check in the backend:

System Information -> Directory Permissions.

This will tell you which files/folders in the root of your Joomla installation are writable (green color), or not writable (red color).

For case 1 - One of the easiest ways, to deal with wrong permissions assigned on file/folders by the operating system, is to use Akeeba's Admin Tools. It provide a utility to setup your desired permissions and apply to all folders/files of the Joomla installation.

For case 2 - In the case you have wrong paths defined for tmp/log directories, you should change this in the global configuration of Joomla. If you don't know what your hosting's home directory is, it's better to ask your hosting provider.

You can edit these path either from the backend of Joomla in Glogal Configuration, or via the file manager of your hosting or connecting with FTP, and editing the configuration.php file.

Usually in cPanel hosting, this is like:

"/home/myHostingUsername/logs"
"/home/myHostingUsername/tmp"

So the final look for these settings in your configuration.php file should be like:

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

*Be aware, that this is one of the most common "mistakes" Joomla beginners do. They forget to change these paths in their configuration file, after moving their sites from another host, a subfolder or from their localhost, resulting these directories to be unwritable.

0

If you can't get in to the backend of Joomla, then you can change the absolute paths in the configuration.php file in the root of your Joomla installation.

0

I tried everything, from setting the ownership of the directories (logs/, temp/) to the apache user, also I set the permission even upto 777, but still was getting this error.

So It looks like, the file named error.php was still set to user:group as root.

So when I changed the ownership of this file things started working fine.

Not the answer you're looking for? Browse other questions tagged or ask your own question.