homepage Welcome to WebmasterWorld Guest from 54.226.230.76
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
PHP & Apache
Premature end of script headers ?
joshie76




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

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?

 

gethan




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

> 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.

joshie76




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

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

gethan




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

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.

joshie76




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

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..

gethan




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

> 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).

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved