Koozali.org: home of the SME Server

No error by PHP

Michael Roed

No error by PHP
« on: February 03, 2003, 05:02:11 PM »
Symptom:

php doesn't report syntax error or any other errors . . . . . even missing ";" is not reported back to the client browser.  it makes it hard to debug.

Question:

What does it take to make esmith/php to report php errors back to the browser.

Luke Drumm

Re: No error by PHP
« Reply #1 on: February 05, 2003, 12:48:49 AM »
PHP is set to log its errors to syslog messages by default. You can access these logs through the admin web pages.

If you want to log errors to the client then the /etc/php.ini file is where you need to go.

For quick and nasty debug sessions, you can change the php.ini file directly, but if you want it switched on for a longer time, I'd do something like the following:


To switch client debugging on:

mkdir -p /etc/e-smith/templates-custom/etc/php.ini
cd /etc/e-smith/templates-custom/etc/php.ini
copy /etc/e-smith/templates/etc/php.ini/30* .
/sbin/e-smith/expand-template /etc/php.ini


And when you want to switch client debugging off:

rm /etc/e-smith/templates-custom/etc/php.ini/30*
/sbin/e-smith/expand-template /etc/php.ini

Regards,
Luke

Michael Roed

Re: No error by PHP
« Reply #2 on: February 05, 2003, 05:15:40 PM »
Thanx Luke!

But I get "Permission denied" and I dont know how to change permission on that file.

So how do I do that???

Thanx,
Michael

Luke Drumm

Re: No error by PHP
« Reply #3 on: February 07, 2003, 11:24:47 AM »
Just a small note: That should of been 'cp'... not 'copy' in the original instructions.

Michael Roed

Re: No error by PHP
« Reply #4 on: February 10, 2003, 04:44:55 PM »
Is the rest of the syntax 100%? I cant get it to work. Theres still no error displayed in the browser when there is an error in my PHP programming.
I just want to modify my php.ini so that it always shows errors in the browser.

/Michael