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
php server issues
Moderator: General Moderators
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:
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.
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);Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Code: Select all
ini_set('error_reporting', E_ALL);
ini_set('display_errors', TRUE);Code: Select all
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
Thanks
Dave
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
Dave