Jump to content


Photo

Permission Denied Error


  • Please log in to reply
9 replies to this topic

#1 sylvest

sylvest

    Family Friend

  • Members
  • PipPip
  • 66 posts

Posted 16 September 2010 - 08:13 AM

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, 16 September 2010 - 12:55 PM.
removed user cPanel name - Please don't post that info in an open forum!


#2 TCH-Bruce

TCH-Bruce

    Volunteer Moderator

  • Members
  • PipPipPipPip
  • 19,960 posts

Posted 16 September 2010 - 09:07 AM

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.

Bruce Richards
Forum Moderator
TotalChoice Hosting, Inc.
Webhosting by Total Choice Web Hosting - General Support Forum

I am a Forum Moderator. While I can assist in answering most of your hosting related questions, I am unable to answer questions about specifics relating to your account such as billing and server related issues. Should you need assistance in these areas, please contact our Help Desk or our many other options. Another good place to find answers is with our help pages, tutorials and movie tutorials.


#3 sylvest

sylvest

    Family Friend

  • Members
  • PipPip
  • 66 posts

Posted 16 September 2010 - 10:09 AM

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

#4 TCH-Bruce

TCH-Bruce

    Volunteer Moderator

  • Members
  • PipPipPipPip
  • 19,960 posts

Posted 16 September 2010 - 10:27 AM

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

Bruce Richards
Forum Moderator
TotalChoice Hosting, Inc.
Webhosting by Total Choice Web Hosting - General Support Forum

I am a Forum Moderator. While I can assist in answering most of your hosting related questions, I am unable to answer questions about specifics relating to your account such as billing and server related issues. Should you need assistance in these areas, please contact our Help Desk or our many other options. Another good place to find answers is with our help pages, tutorials and movie tutorials.


#5 sylvest

sylvest

    Family Friend

  • Members
  • PipPip
  • 66 posts

Posted 16 September 2010 - 11:15 AM

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

#6 sylvest

sylvest

    Family Friend

  • Members
  • PipPip
  • 66 posts

Posted 16 September 2010 - 11:18 AM

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, 16 September 2010 - 11:32 AM.


#7 TCH-Thomas

TCH-Thomas

    Volunteer Moderator

  • Members
  • PipPipPipPip
  • 14,908 posts

Posted 16 September 2010 - 11:38 AM

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.

Thomas Jikrantz
Forum Moderator
TotalChoice Hosting, Inc.

Any links or suggestions for third party software/sites should be used at your own risk. My opinions and recommendations are not necessary those of TCH and TCH is not responsible.

As a Forum Moderator I can assist in answering many of your hosting related questions. However, I am unable to answer questions about specifics relating to your account such as billing and server related issues. Should you need assistance in these areas, please contact our Help Desk or our many other options. Another good place to find answers is with our help pages, tutorials and movie tutorials.
Web Hosting by Total Choice Web Hosting - 24/7 Help Desk


#8 TCH-Bruce

TCH-Bruce

    Volunteer Moderator

  • Members
  • PipPipPipPip
  • 19,960 posts

Posted 16 September 2010 - 12:40 PM

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.

Bruce Richards
Forum Moderator
TotalChoice Hosting, Inc.
Webhosting by Total Choice Web Hosting - General Support Forum

I am a Forum Moderator. While I can assist in answering most of your hosting related questions, I am unable to answer questions about specifics relating to your account such as billing and server related issues. Should you need assistance in these areas, please contact our Help Desk or our many other options. Another good place to find answers is with our help pages, tutorials and movie tutorials.


#9 TCH-Bruce

TCH-Bruce

    Volunteer Moderator

  • Members
  • PipPipPipPip
  • 19,960 posts

Posted 16 September 2010 - 12:43 PM

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.

Bruce Richards
Forum Moderator
TotalChoice Hosting, Inc.
Webhosting by Total Choice Web Hosting - General Support Forum

I am a Forum Moderator. While I can assist in answering most of your hosting related questions, I am unable to answer questions about specifics relating to your account such as billing and server related issues. Should you need assistance in these areas, please contact our Help Desk or our many other options. Another good place to find answers is with our help pages, tutorials and movie tutorials.


#10 sylvest

sylvest

    Family Friend

  • Members
  • PipPip
  • 66 posts

Posted 16 September 2010 - 01:02 PM

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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users