Jump to content

Recommended Posts

Posted (edited)

One of my scripts has stopped working. I have the following code in the file /home/****/gc/functions.php:

 

$logfile = "/home/****/logs/tickets.log";

 

function logopen()

{

global $logf,$logfile;

if (isset($logfile) and ($logfile != ""))

{

$logf = fopen($logfile, 'a');

}

}

 

This fails with the following:

 

Error code: 2

Error message: fopen(/home/****/logs/tickets.log) [function.fopen]: failed to open stream: Permission denied

Script name and line number of error: /home/****/gc/functions.php:36

Variable state when error occurred: /home/****/logs/tickets.log

 

The file /home/****/logs/tickets.log exists, and has permissions 644

The directory /home/****/logs has permissions 775

I am not out of disk space.

 

Can anyone suggest why this has stopped working? I have not used it for a couple of months, but it used to work...

 

Thanks - Rowan

Edited by TCH-Bruce
removed user cPanel name - Please don't post that info in an open forum!
Posted

Thanks for your reply. How do I check the owner? As far as I can see there's no facility to do this in the cPanel File Manager, nor does there seem to be a way when I connect via FTP using Windows Explorer..

Thanks - Rowan

Posted

I can see the owner name in my FTP client (CuteFTP).

B*** Microsoft - why can't they get anything right? :-)

 

I discover that using BeyondCompare (the only FTP client that I've got installed apart from Windows Explorer), I can see an owner property that's set to a number. Most things on my site are set to 32191. The offending file is set to 99.

 

How do I know what these numbers mean?

 

What could have changed the ownership of the file tickets.log from 32191 to 99?

 

How do I change it back again? Although BeyondCompare can show me the owner, it doesn't seem to allow me to change it.

 

Thanks - Rowan

Posted (edited)

I find that I can download the file, delete it from the server and upload it again, and magically its owner changes to 32191. One problem solved (although this is presumably not the best way of doing it...).

 

Rowan

Edited by sylvest
Posted

Thanks all for your help. After that download/delete/upload trick my script is now working again, and I've learnt some things in the process, so I won't bother the help desk on this occasion. Next time though...

 

Thanks again for your help - Rowan

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...