Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: php error log
PostPosted: Sat Oct 19, 2013 4:55 am 
Offline
Senior Newbie

Joined: Mon Mar 15, 2010 12:50 pm
Posts: 18
OK so I set up php on Debian 7 following the Linux user guide which works perfectly except that no errors get written to the php error log. I have edited php.ini exactly as set out in the guide which is here:

https://library.linode.com/hosting-webs ... linode-1gb

and sets the following parameters:

max_execution_time = 30
memory_limit = 128M
error_reporting = E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR
display_errors = Off
log_errors = On
error_log = /var/log/php.log
register_globals = Off

I have restarted apache after entering these parameters. PHP works fine but I need to debug a script from the error log. There is no php.log file in the directory /var/log

As I have set up apache and php according to the guide, I'm surprised that the error log is not working. Any suggestions gratefully received.


Top
   
 Post subject: Re: php error log
PostPosted: Sat Oct 19, 2013 4:56 am 
Offline
Senior Member

Joined: Fri Feb 17, 2012 8:20 pm
Posts: 365
Maybe you need to create the php.log file first manually and give write permissions to whoever PHP is running as.
It might not have permissions now to create a file in /var/log/


Top
   
 Post subject: Re: php error log
PostPosted: Sat Oct 19, 2013 5:38 am 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
I personally create the directory /var/www/php and chown it to www-data and point the error logs to there. You can have one per FPM pool/Apache vhost

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
 Post subject: Re: php error log
PostPosted: Sat Oct 19, 2013 5:50 am 
Offline
Senior Newbie

Joined: Mon Mar 15, 2010 12:50 pm
Posts: 18
Thanks for the replies. I followed the advice of obs as follows:

1 edit php.ini to redirect logs to /var/www/php/php.log
2 restarted apache
3 chowned /var/www/php to www-data
4 triggered an error in php

This worked immediately so many thanks. I think maybe the guide should be amended to avoid this problem.


Top
   
 Post subject: Re: php error log
PostPosted: Sat Oct 19, 2013 6:31 am 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
I've poked them to update it.

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group