An error has occurred. Cannot open file for writing log

General questions relating to Joomla! 3.x.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10
Locked
jameszy
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Sun Oct 19, 2014 1:29 pm

An error has occurred. Cannot open file for writing log

Post by jameszy » Sun Oct 19, 2014 1:35 pm

Hello,

i bought a template from joomplates and followed the quickstart instructions.
After 2 trys it worked for me, well i thought it did until i want to login via administrator. Where i got the error. Reading multiple topics about this error, i just simply can not get it working.

I have try'd the Leo way as quoted but still nothing happens.

Is there someone that can help me?
That error is normally caused by Joomla not being able to access logs/tmp.

Your he path for $log_path and $tmp_path in the configuration.php file in your site's root folder are still incorrect.

To find out what your absolute path is, copy the following code into a text editor (i.e. JEdit, Notepad, etc), save the file as a .php naming it whatever you prefer (i.e anyfilename.php.).
Code:
<?php
$path = getcwd();
echo "Your Absoluthe Path is: ";
echo $path;
?>
Using your FTP software, ftp the file you have just created to your root folder.

Open your web browser and type in http://www.yourdomain.com/anyfilename.php. The result will show the absolute path! Place that in your configuration.php so it looks like (in case of a cPanel hosted account):

public $log_path = '/home/username/public_html/logs';
public $tmp_path = '/home/username/public_html/tmp';

IMPORTANT: For security reasons, delete this file as soon as you have ascertained the information you require.

Leo 8)

sovainfo
Joomla! Exemplar
Joomla! Exemplar
Posts: 8808
Joined: Sat Oct 01, 2011 7:06 pm

Re: An error has occurred. Cannot open file for writing log

Post by sovainfo » Sun Oct 19, 2014 1:46 pm

You can try error_reporting = 'maximum'; in configuration.php. Maybe it gives clues about what is wrong. You might even enable debug.
Issue with migrating? Include logs/joomla_update.php in your report!
Blank screen? Verify pagesource for HTML code (javascript error)
Installation failing on populating database? Install with set_time_limit(0)
Document your customizations!

jameszy
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Sun Oct 19, 2014 1:29 pm

Re: An error has occurred. Cannot open file for writing log

Post by jameszy » Sun Oct 19, 2014 2:31 pm

I did the maximum in configuration. and nothin has changed in the error mssg :(
i changed debug to "1" and allot of things in my screen i dont know about now?

User avatar
Zemplate
Joomla! Ace
Joomla! Ace
Posts: 1389
Joined: Tue Aug 13, 2013 5:55 pm
Location: Colorado
Contact:

Re: An error has occurred. Cannot open file for writing log

Post by Zemplate » Sun Oct 19, 2014 3:55 pm

If you have these folders in the right place, it could be a permission problem.

Check the permissions on these files. If they are "writable" then this will be indicated in the Directory Permission tab (at the very bottom of the list)

Go to System -> System Information -> Directory Permissions tab.

If the permissions are correct, there will be a green indicator that says "Writable". Now if the permissions are not correct OR the folder does not exist where you say it is in Global Configuration, it will have a red indicator with Unwritable.

The permissions for these folders should be 755. You can change the permissions through your hosts File Manager or a decent FTP uploader.

jameszy
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Sun Oct 19, 2014 1:29 pm

Re: An error has occurred. Cannot open file for writing log

Post by jameszy » Sun Oct 19, 2014 6:18 pm

I am realy sorry but when it comes to all this in making a website/joomla my knowledge is not good enough :(

I checked the configuration.php file in my root via FTP and it is set to 755.
But where would i find/go, when u say about the System -> System Information -> Directory Permissions tab.
If it is in joomla then that is a part i cant get into caus i cant login to administrator :(

User avatar
Zemplate
Joomla! Ace
Joomla! Ace
Posts: 1389
Joined: Tue Aug 13, 2013 5:55 pm
Location: Colorado
Contact:

Re: An error has occurred. Cannot open file for writing log

Post by Zemplate » Mon Oct 20, 2014 1:33 am

Getting into System ... is all in the Administrator side of the site. Sorry, I should have read your posts more closely.

The permissions for tmp and log folders is different than permissions for the configuration.php. The tmp and log folders are likely right in the same directory as the configuration.php file.


Locked

Return to “General Questions/New to Joomla! 3.x”