Welcome to WebmasterWorld Guest from 54.166.222.116

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

PHP & Apache

Premature end of script headers ?

     
11:25 pm on Feb 14, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I've done it. Windows boy has finally installed something on his machine from the OSS/*nix farm as opposed to MS. I have to admit that I'm impressed. The install of apache, php and MySQL was smooth and I setup without any problems (On a windows XP unit too)...

... however. There is one problem. My php is working fine unless I call a .php that doesn't exist. Normally you'd expect a 404 but it's returning a 500 (Internal Server Error). I checked the apache error log and it shows:

Premature end of script headers: c:/program files/php4/php.exe

Any ideas?

10:24 am on Feb 15, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



> Windows boy has finally installed something on his machine from the OSS/*nix

Congratulations ;)

I'm surprised that your seeing a 500 and not a 404. So surprised that I had a look around to see if I could find a solution. No luck so far but you're not the only one:

[phpbuilder.com...]

It seems that it is a bug in your version of php.exe. So check the version and see if there is a newer one you can use. If that dosen't fix it look for other reports on this problem - and see if you have anything in common - send back the info to the developers at php.net.

If your only using your installation for development then things will be fine even with the bug. No reports of similar problems on Unix installs.

10:28 am on Feb 15, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks gethan.

I saw that post (and many like it) too but couldn't find a solution anywhere. As you say, it is just a development unit so any production server should *hopefully* be OK. Thanks for having a look around though.

If anybody has a solution, let us know (lots of people will be very grateful!)

Josh

10:33 am on Feb 15, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Found a work around ...

> Subject: Re: [PHP] apache not handling 404 errors for .php pages
> ErrorDocument 500 /path/to/my_error_page.html
> That should get you the result you want.

From: [phpbuilder.com...]

It will make debugging a little confusing.

10:37 am on Feb 15, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm guessing that means that all 500 Internal Server Errors will result in the custom 404* page?

*or custom 500 depending on how you set it up etc..

10:48 am on Feb 15, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



> all 500 Internal Server Errors will result in the custom 404* page?

Yep. On a development box I would keep the 500 message, if you had to go live on the same setup I would use the work around...

I should also have mentioned that this is in your .htaccess (for other peeps when finding this post in google - about a month from now).

 

Featured Threads

Hot Threads This Week

Hot Threads This Month