php server issues

Whether you are using Linux on the desktop or as a server, it's still good that you're using Linux. Linux related questions go here.

Moderator: General Moderators

Post Reply
Dave9191
Forum Newbie
Posts: 9
Joined: Wed May 28, 2003 11:31 am

php server issues

Post 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
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post 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.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

Code: Select all

ini_set('error_reporting', E_ALL);
ini_set('display_errors', TRUE);
Dave9191
Forum Newbie
Posts: 9
Joined: Wed May 28, 2003 11:31 am

Post 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
Post Reply