sylvest Posted September 16, 2010 Share Posted September 16, 2010 (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 September 16, 2010 by TCH-Bruce removed user cPanel name - Please don't post that info in an open forum! Quote Link to comment Share on other sites More sharing options...
TCH-Bruce Posted September 16, 2010 Share Posted September 16, 2010 Check the owner of the file. If you own the file please open a ticket with the help desk and they can help you sort it out. Quote Link to comment Share on other sites More sharing options...
sylvest Posted September 16, 2010 Author Share Posted September 16, 2010 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 Quote Link to comment Share on other sites More sharing options...
TCH-Bruce Posted September 16, 2010 Share Posted September 16, 2010 I can see the owner name in my FTP client (CuteFTP). Quote Link to comment Share on other sites More sharing options...
sylvest Posted September 16, 2010 Author Share Posted September 16, 2010 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 Quote Link to comment Share on other sites More sharing options...
sylvest Posted September 16, 2010 Author Share Posted September 16, 2010 (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 September 16, 2010 by sylvest Quote Link to comment Share on other sites More sharing options...
TCH-Thomas Posted September 16, 2010 Share Posted September 16, 2010 Server = 99 and 32191 should be you, although it´s the first time I see numbers instead of your cpanel login name as you as the owner. Quote Link to comment Share on other sites More sharing options...
TCH-Bruce Posted September 16, 2010 Share Posted September 16, 2010 User 99 is user "nobody" and the best way to correct an ownership issue is to open a ticket with help desk. The techs can easily rectify the situation. Quote Link to comment Share on other sites More sharing options...
TCH-Bruce Posted September 16, 2010 Share Posted September 16, 2010 Can anyone suggest why this has stopped working? I have not used it for a couple of months, but it used to work... There was a PHP upgrade a short while back. Quote Link to comment Share on other sites More sharing options...
sylvest Posted September 16, 2010 Author Share Posted September 16, 2010 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.