how to find php error log

Discussions of secure PHP coding. Security in software is important, so don't be afraid to ask. And when answering: be anal. Nitpick. No security vulnerability is too small.

Moderator: General Moderators

Post Reply
werhujsk
Forum Newbie
Posts: 1
Joined: Thu May 02, 2013 6:26 am

how to find php error log

Post by werhujsk »

Hi,

I am unable to find php error log's cvan anyone help out to find error log...

Thanks,
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: how to find php error log

Post by requinix »

Check the error_log php.ini setting. If that's empty then check your web server logs.
annaharris
Forum Commoner
Posts: 30
Joined: Mon Mar 25, 2013 6:52 am

Re: how to find php error log

Post by annaharris »

Check: /home/username/logs/example.com/http/error.log
rejser
Forum Newbie
Posts: 1
Joined: Sat Jun 08, 2013 1:30 am

how to find php error log

Post by rejser »

Start session without errors please check errors given in your PHP and/or webserver log file and configure your PHP installation . The best way to dynamically store the PHP log files .
Last edited by requinix on Tue Jun 18, 2013 12:40 pm, edited 1 time in total.
Reason: removing spammy link
User avatar
ragax
Forum Commoner
Posts: 85
Joined: Thu Dec 15, 2011 1:40 pm
Location: Nelson, NZ

Re: how to find php error log

Post by ragax »

Note that you can point error_log to a file with any name, e.g. myprettyPHPlog.txt
Preferably store it above the html root so it is not world-accessible.

After you've done all this, it may still not work. One common problem (which happened to me on a server not long ago) is permissions on the log file: PHP may not be able to write to it. Worst case, create an empty log file, and change the perms to 644, then trigger an error (divide something by zero) to see if the log gets appended. If it works, you may be able to scale back from 644.
priyankagound
Forum Commoner
Posts: 27
Joined: Thu Sep 19, 2013 2:53 am

Re: how to find php error log

Post by priyankagound »

Php stores error logs in /var/log/apache2 if php is an apache2 module. Shared hosts are often storing log files in your root directory /log subfolder. But...if you have access to a php.ini file you can do this:

error_log = /var/log/php-scripts.log
jangmi
Forum Newbie
Posts: 11
Joined: Sat Mar 08, 2014 7:39 am

Re: how to find php error log

Post by jangmi »

You can see in /var/log/httpd/error_log
Post Reply