Cannot open file for writing log

Need help upgrading your Joomla! website or converting to Joomla! 3.x?

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
sovainfo
Joomla! Exemplar
Joomla! Exemplar
Posts: 8808
Joined: Sat Oct 01, 2011 7:06 pm

Re: Cannot open file for writing log

Post by sovainfo » Tue Mar 17, 2015 11:41 pm

In Global Configuration tab System.
Normally it points to the logs folder in your Joomla folder (./logs).
Shouldn't be locked down!
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!

User avatar
willkey
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 147
Joined: Mon Feb 25, 2008 6:02 pm
Location: Huntington, Vermont
Contact:

Re: Cannot open file for writing log

Post by willkey » Tue Mar 17, 2015 11:44 pm

"locked down" he is referring to is the permissions on the folder. it also has an htacess file in there that protects it from public reading

atodd
Joomla! Apprentice
Joomla! Apprentice
Posts: 17
Joined: Thu Feb 10, 2011 4:14 pm

Re: Cannot open file for writing log

Post by atodd » Fri Mar 20, 2015 1:43 pm

willkey wrote:try making a new folder, with a new name, like "mylogs" and use that for the /logs variable in the configuration file
I actually did that but it didn't work. I did end up getting the site updated however. After exhausting all other options, I ended up having to install and set up xampp and update the site locally. I was then going to use Akeeba kickstart to move the backup I created but that didn't work either. So I ended up having to upload the locally updated site to a subfolder, creating a redirect page to that folder (just for over night), and manually deleting the old site and uploading the new one.

So the site is now updated to Joomla 3.4 and is working perfectly. Hopefully the next major update won't be quite as painful!
Last edited by atodd on Fri Mar 20, 2015 1:50 pm, edited 1 time in total.

atodd
Joomla! Apprentice
Joomla! Apprentice
Posts: 17
Joined: Thu Feb 10, 2011 4:14 pm

Re: Cannot open file for writing log

Post by atodd » Fri Mar 20, 2015 1:49 pm

sovainfo wrote:In Global Configuration tab System.
Normally it points to the logs folder in your Joomla folder (./logs).
Shouldn't be locked down!
You are absolutely correct. The problem was that 1and1 (for whatever stupid reason) decided that they would put a logs folder on the root of our server and completely lock it down. I have no idea why, but even though I created a new folder and changed the config file, the update process still wanted to write to the logs folder.

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

Re: Cannot open file for writing log

Post by sovainfo » Fri Mar 20, 2015 2:25 pm

Haven't found anything in Joomla writing to logs unless configured by log_path. Would consider that a bug when it would do that.
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!

jamerson
Joomla! Apprentice
Joomla! Apprentice
Posts: 14
Joined: Tue May 07, 2013 10:32 am

Re: Cannot open file for writing log

Post by jamerson » Thu Jun 25, 2015 10:54 am

i am having the same problem.
tried all the solution already given but none of them helped.
tried LEO PHP file it shows the log file.
i can access the ftp using filezilla.
i am on joomla 3.4.1

i've checked the configuration.php file and i think i see the something wrong :

public $tmp_path = 'C:/xampp/htdocs/DOMAIN/tmp';
public $log_path = 'C:/xampp/htdocs/DOMAIN/log';


i tried LEO code to know the absolut path.
both tmp and log path suppoted to be on the absolut path ?


public $tmp_path = '/home/cartoons/domains/domain.com/public_html';
public $log_path = '/home/cartoons/domains/domain.com/public_html';


Thank you LEO.
it fixed now

User avatar
jaysunp
Joomla! Intern
Joomla! Intern
Posts: 57
Joined: Sat Sep 16, 2006 1:59 am
Location: Planet Earth
Contact:

Re: Cannot open file for writing log

Post by jaysunp » Mon Aug 03, 2015 11:15 pm

I just ran into this issue when deploying a remote backup for our site. I have verified the correct absolute path and permissions (755 for directories and 644 for files) and the error persists.

In a post above, someone reported changing permissions on the log directory to '777'. When I did this, this site runs properly, yet this setting is not recommended for security reasons.

My question is, "Is this a file ownership issue on the server?" Who must "own" the files in order for the permissions to work correctly? I don't want to leave the log directory permission at 777.
All the best,
jason bradley

Freeing Minds from the Matrix
GemstoneUniversity.org

scoopy
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 196
Joined: Sat Jul 19, 2008 7:08 am

Re: Cannot open file for writing log

Post by scoopy » Thu Aug 06, 2015 12:21 am

I'm having a similar issue trying to update from 3.4.1 to 3.4.3

Code: Select all

ERROR:
Could not open /var/www/html/xxx/xxx/administrator/components/com_admin/models/help.php for writing.
All folders are writable. The help.php file identified has 644 permissions.

I've tried using absolute path and "logs" in the global config.

Any thought appreciated.
http://www.visionwebdesign.co.nz - Joomla Web Developer - Vision Web Design | http://www.visionphotography.co.nz - Wellington Photographer - Vision Photography

FeliFresneda
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Fri Aug 28, 2015 7:04 am

Re: Cannot open file for writing log

Post by FeliFresneda » Fri Aug 28, 2015 7:12 am

This problem happens when your login access menu is not in the first level of the main menu.
With older versions was enough using "/log" or "../log" in Global configuration, but now the long address "/var/www/domain/xxx/log" folder must be set there.
Follow Loelam instructions to get your complete address and set log folder inside your web folder in the server.

joomexcellence
Joomla! Apprentice
Joomla! Apprentice
Posts: 18
Joined: Fri Jun 06, 2008 4:35 pm
Contact:

Re: Cannot open file for writing log

Post by joomexcellence » Tue Apr 05, 2016 7:40 pm

leolam wrote:For those who face these issues:

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: Select all

<?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!

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

Leo 8)
I did as you said and it says "Your Absoluthe Path is: /home4/joomlaxl/public_html/mywebsite"

the apprentice
Joomla! Guru
Joomla! Guru
Posts: 801
Joined: Wed Nov 18, 2009 3:53 pm

Re: Cannot open file for writing log

Post by the apprentice » Wed Apr 06, 2016 12:51 pm

I also found the correct absolute path and wanted to modify log and tmp but I can't modify the configuration.php.


Locked

Return to “Migrating and Upgrading to Joomla! 3.x”