Page 1 of 1

php server issues

Posted: Wed Jul 13, 2005 11:30 am
by Dave9191
Hey guys,

I've got a little bit of a headache from this problem. I have some php code which sends out mail. But when I try to execute the script by going to webpage to run it /localhost/page.php I dont get any kinds of errors at all. It wont output anything when there is a syntax error. It wont complain if the mail cant be sent. I put an if statement around the mail(...) to output something on fail/success. It always fails.

If i run the same file using the php command - php page.php it works fine. Reports on errors and sends the mail.

I have checked the php.ini file to check the error_reporting and Ive added error_reporting(E_ALL) to the top of the scripts. But it wont work from the browser.

The server is running FC4, it has php 5.0.4 on it, Apache/2.0.54 (Fedora). I havent done anything crazy to the default install.

Hope this makes sense and someone can help.

Dave

Posted: Wed Jul 13, 2005 2:34 pm
by pickle
You have to restart Apache before the changes will take effect.

You can also set error reporting levels manually in the code of your page. At the top, call:

Code: Select all

error_reporting(E_ALL);
Also, I know it is possible to log all errors to a log file rather than dump them on the screen. Look into that and see if maybe PHP is dumping all your errors somewhere.

Posted: Wed Jul 13, 2005 2:39 pm
by timvw

Code: Select all

ini_set('error_reporting', E_ALL);
ini_set('display_errors', TRUE);

Posted: Wed Jul 13, 2005 3:46 pm
by Dave9191
Hey guys,

I already mentioned that I tried the error_reporting(E_ALL); at the top of the scripts and messed about with the php.ini file.

But I looked into the error reporting and it was set not to output anything, Ive not worked with php 5 before, so I was unawre of this. But after allowing the errors to show the mail function started to work from the browser. It all works now like I want it.

This was giving me such a headache and wasting so much time. I could kiss you guys :lol: Thanks

Dave