You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Michael Avila <ma...@mich.com> on 2004/09/27 17:47:29 UTC

[users@httpd] Apache 2.0.50 PHP Execution Problem

Environment:
============
Win XP SP1
Apache 2.0.50    installed with Windows Installer version
PHP 5.0.0
phpMyAdmin
PHP_Nuke 6

hello.php
<!doctype html public "-//W3C//DTD HTML 4.0 //EN">
<html>
<head>
       <title>Title here!</title>
</head>
<body>
 <?php
       echo '<P>Hello World!<P>Here is my information<P>';
 ?>
 <?php phpinfo(); ?>
</body>
</html>


Problem:
========
No matter what php script I execute I get the following error browser
display:


"The server encountered an internal error or misconfiguration and was unable
to complete your request.

Please contact the server administrator, XXXXXXX@XXXXX and inform them of
the time the error occurred, and anything you might have done that may have
caused the error.

More information about this error may be available in the server error log."


The logs have the following:

Accesslog
127.0.0.1 - - [26/Sep/2004:23:23:02 -0400] "GET /hello.php HTTP/1.1" 500 611
Errorlog
[Sun Sep 26 23:23:06 2004] [error] [client 127.0.0.1] Premature end of
script headers: php.exe


I can execute the script using the command line and they work without a
problem so I don't think it is PHP.  I think it is something not set right
in Apache.  Being I am new to Apache and PHP I cannot find it after reading
the docs several times and spending 2 days on this.  I am hoping that
someone will be able to help me out of this mess!

If more information is needed please ask, tell me where to find it and I
will post it.

Thanks in advance.

Mike



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Apache 2.0.50 PHP Execution Problem

Posted by Michael Avila <ma...@mich.com>.
Well, well, well!!!

Just for grins I installed PHP 4.3.9 and it worked.  So there must be some
major differences between PHP 4 and PHP 5 especially when used with Apache
2.0.

Thanks for the help.  I'm staying away from PHP 5 for now.

Mike


-----Original Message-----
From: Rob Szarka [mailto:szlists@szarka.org]
Sent: Monday, September 27, 2004 2:14 PM
To: users@httpd.apache.org
Subject: RE: [users@httpd] Apache 2.0.50 PHP Execution Problem


At 01:21 PM 9/27/04, you wrote:
>Thanks.  Tried that but it did not work.  I left it set to off.  Should I
>put it back on?

I leave it set to off on my servers because XML (including XHTML) documents
will break when they hit the PHP interpreter otherwise.

>Any other thoughts?

I'd start by looking at file permissions, but I don't use PHP or Windows
enough to give you much guidance.  :(

--
Surf the Sea of Noise!  http://seaofnoise.com/blosxom/


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Apache 2.0.50 PHP Execution Problem

Posted by Rob Szarka <sz...@szarka.org>.
At 01:21 PM 9/27/04, you wrote:
>Thanks.  Tried that but it did not work.  I left it set to off.  Should I
>put it back on?

I leave it set to off on my servers because XML (including XHTML) documents 
will break when they hit the PHP interpreter otherwise.

>Any other thoughts?

I'd start by looking at file permissions, but I don't use PHP or Windows 
enough to give you much guidance.  :(

-- 
Surf the Sea of Noise!  http://seaofnoise.com/blosxom/


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Apache 2.0.50 PHP Execution Problem

Posted by Michael Avila <ma...@mich.com>.
Rob,

Thanks.  Tried that but it did not work.  I left it set to off.  Should I
put it back on?

Any other thoughts?

Mike


-----Original Message-----
From: Rob Szarka [mailto:szlists@szarka.org]
Sent: Monday, September 27, 2004 12:08 PM
To: users@httpd.apache.org
Subject: Re: [users@httpd] Apache 2.0.50 PHP Execution Problem


At 11:47 AM 9/27/04, you wrote:
>hello.php
><!doctype html public "-//W3C//DTD HTML 4.0 //EN">
><?php echo '
>
>Hello World!
>
>Here is my information
>
>'; ?> <?php phpinfo(); ?>

Have you set "short_open_tag = Off" in your php.ini? AFAIK, PHP shouldn't
choke on the doctype declaration even with it on (since it begins with "<!"
rather than "<?"), but let me throw it out there as something to try
anyway.  :)

--
Surf the Sea of Noise!  http://seaofnoise.com/blosxom/


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Apache 2.0.50 PHP Execution Problem

Posted by Rob Szarka <sz...@szarka.org>.
At 11:47 AM 9/27/04, you wrote:
>hello.php
><!doctype html public "-//W3C//DTD HTML 4.0 //EN">
><?php echo '
>
>Hello World!
>
>Here is my information
>
>'; ?> <?php phpinfo(); ?>

Have you set "short_open_tag = Off" in your php.ini? AFAIK, PHP shouldn't 
choke on the doctype declaration even with it on (since it begins with "<!" 
rather than "<?"), but let me throw it out there as something to try 
anyway.  :)

-- 
Surf the Sea of Noise!  http://seaofnoise.com/blosxom/


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org