Google Answers Logo
View Question
 
Q: PHP returns blank file on page view on linux apache install, all release current ( No Answer,   7 Comments )
Question  
Subject: PHP returns blank file on page view on linux apache install, all release current
Category: Computers > Internet
Asked by: belgarath-ga
List Price: $2.00
Posted: 31 May 2003 16:09 PDT
Expires: 30 Jun 2003 16:09 PDT
Question ID: 211306
To put it bluntly I have been up for about 26 hours now, and have been
working on this problem for about half that, help is greatly needed;
If you have the skill or just want to help somone in dire need of it,
I really need input on this.

I have instaled PHP under apache 2 in redhat linux by the book, as in
I read the docs for both php and apache 2 50 times and followed the
instructiions for from source installs.. however when I go to view a
php file it instead tries to have me download it; Now I know what your
thinking and I wish it was that simple, but httpd.conf has the needed
lines added so php should be interpeting it instead of sending it as a
file download, but instead the server tries to download it to me.

The thing is, its NOT downloading the php file at all, just a blank
page with NO data on it.. as strange as that is, what gets me is I
have done everything the manuals tells you to do and googling for info
on this just gets me info on common newbi errors that dont aplie to me
since the configs are setup and this is acting slightly different.

I have no idea wtf to do, Im tired and I think I have the flu or am
sick from all my stress latley, I just want to get into bed and sleep;
but I cant do that till this is taken care of, and I have no idea what
to do next as I have tried everything I can think of.. Please, if you
have ANY IDEA AT ALL, even something that seems stupid or simple, post
it, Im at the end of my rope and I have no clue why why this is not
working or how to fix it, and usualy I get things working just fine.

If somone finds me the answer to this I can drop them another,
additional payment via paypal and would probly see about getting them
IT work for the compony I work for if they wanted it; The price I
inputed is nogotiatable as
well as long as the info does help me, I have no problem with paying
somone for this info if it gets me out of this jam.

dking@pimpsoft.com

Request for Question Clarification by webadept-ga on 31 May 2003 16:56 PDT
and of course you copied the php.ini file to the /usr/local/lib
directory, or where ever you configured that to be right? and
restarted the apache server, making sure that it did in fact shut
down.. meaning you checked with something like

ps -ef | grep apache 

to see that it was not running, and then started it.

webadept-ga

Clarification of Question by belgarath-ga on 31 May 2003 17:13 PDT
Yes I did, I copied it to the defualt /etc/php.ini; the path you gave
me only had 2 folder in it so I copied it there as well.. after
rebooting it had Not solved the problem, the host is still returning
blank pages.. I did a http 1.0 get request by hand and here is the
output:

[root@cgi log]# telnet localhost 80
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
GET /info.php HTTP/1.0
Host: localhost

HTTP/1.1 200 OK
Date: Sun, 01 Jun 2003 00:49:22 GMT
Server: Apache
Content-Length: 0
Connection: close
Content-Type: application/x-httpd-php

Connection closed by foreign host.
[root@cgi log]#

As you can see there was no errors.. but the page was empty and it
shouldnt of been, that "info.php was in fact a simple phpinfo()
script.

Request for Question Clarification by endo-ga on 31 May 2003 17:29 PDT
Hi,

Do you have the following line in httpd.conf?
AddHandler php-script .php 

Thanks.
endo

Clarification of Question by belgarath-ga on 31 May 2003 18:32 PDT
The following lines are in the httpd.conf for php:

*snip*
LoadModule php4_module /usr/local/apache2/modules/libphp4.so

#Add php
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3

AddHandler send-as-is asis
AddHandler send-as-is .php

*/snip*

The docs on php.net and apache.org never said anything about neededing
to add the line "AddHandler php-script .php" to it, however I have
added it to the httpd.conf and it does not change the output or fix
this problem, so I am now going to comment it out.

*yawns* Its now 6:30 am where I am. been working on this since 4am and
have been up since 3am the day before yesterday right about.. If any
of you has any more ideas that will let me get home and get some sleep
I would really enjoy paying you.

The php.ini file contains a "engine = On" line so thats not the issue,
and Short Open tag was already enabled, thank yu for your input
anyway.

Request for Question Clarification by webadept-ga on 31 May 2003 18:38 PDT
Okay, well we are all just guessing now, so in order to really go
forward with this I would suggest you zip up the http.conf, php.ini
files and put them somewhere on a website so we can download and take
a look at them. Guessing is cool, but I can't see your hand movments
and I'm thinking everything is a baby cow ;-)

webadept-ga

Request for Question Clarification by endo-ga on 31 May 2003 18:42 PDT
Hi,

I found several pages from people having a very similar setup to yours
and having the same problem, have a look here please, sorry if you've
already tried any of it though:

http://www.linuxquestions.org/questions/showthread.php?threadid=36399&perpage=15&pagenumber=2

Maybe here if that doesn't work:
http://apache-server.com/tutorials/LPPHP.html#t3

Here's another site with more information:
http://dan.drydog.com/apache2php.html

You might also want to try as another installation method:
http://www.apachetoolbox.com/

Clarification of Question by belgarath-ga on 04 Jun 2003 07:30 PDT
No apache is working fine, and the apache error logs I checked are
showing no errors that would deal with this, even when I set it for
"debug" based output... As I said everything else is working perfect,
perl cgis can even be run on it.

Request for Question Clarification by sgtcory-ga on 04 Jun 2003 08:05 PDT
Hello belgarath,

I was wondering if you have any accelerators installed (Zend PHPA),
and which version of Redhat you are using?

In the meantime, like everyone else, I'm taking a shot in the dark.
Replace this part :

AddType application/x-httpd-php .php 
AddType application/x-httpd-php .php3


with this, and let me know what happens :

<Files *.php>
     SetOutputFilter PHP
     SetInputFilter PHP
     LimitRequestBody 524288
</Files>


I've found a few cases where this has solved the problem, but they are
all running RedHat 8.

Thanks -
SgtCory

Request for Question Clarification by errol-ga on 05 Jun 2003 00:56 PDT
Hi there, Belgarath!

I know exactly what is going wrong but I need you to upload your
httpd.conf and php.ini files to some webspace then provide a link to
them here so I can have a look at them to double check.

Regards,
errol-ga.

Clarification of Question by belgarath-ga on 05 Jun 2003 09:22 PDT
The versions of everything are the current ones, ie the newest
available form download on the different sites, and are compiled from
source to use the configurations files I am refereing to :(

Request for Question Clarification by arimathea-ga on 25 Jun 2003 19:14 PDT
I think i've got it.  Try removing the php asis line, and keeping the
AddHandler php-script line.  Restart httpd.
Answer  
There is no answer at this time.

Comments  
Subject: Re: PHP returns blank file on page view on linux apache install, all release current
From: lann-ga on 31 May 2003 17:58 PDT
 
Hi 

I had similar problem recently. After checking all config file, i
found that in /etc/php.ini

in Language Options section
engine = On              ; Previously set as Off
short_open_tag = On
Subject: Re: PHP returns blank file on page view on linux apache install, all release current
From: belgarath-ga on 31 May 2003 19:41 PDT
 
Apache tool box is apache1.3X based, I a using Apache 2.. The apache
server tuorial is very very old and doesnt work with my version of
Apache, the rest of the links only told me to repeat everything I have
already done 50 times. Thank you anyway.

You see, I have also tried to install another install of apache in
anothe directory, thinking it would fix everything if I could just use
that install till I could hammer out long range plans... instead it
acted the same exact way. :(

Im looking at the drygod info now, but it looks like the info php.net
had..

Im sorry I cant just zip up the files as the only way into it right
now is ssh, sorry.
Subject: Re: PHP returns blank file on page view on linux apache install, all release cur
From: chrisbolt-ga on 03 Jun 2003 23:39 PDT
 
Have you checked your error_log? Sounds to me like apache's crashing.
Subject: Re: PHP returns blank file on page view on linux apache install, all release current
From: belgarath-ga on 04 Jun 2003 09:10 PDT
 
Running Redhat 8 as well.

The configuration changes made, I shut down the hhtpd, did a ps aucx
amd greps it through "httpd" and on getting no output restarted the
server, then tested again.. same thing :(

Changes are currently comment out..
Subject: Re: PHP returns blank file on page view on linux apache install, all release current
From: sgtcory-ga on 04 Jun 2003 09:19 PDT
 
Can you please tell me the exact versions of everything you are running :

Apache
PHP
Any optimizers

Thanks in advance -

SgtCory
Subject: Re: PHP returns blank file on page view on linux apache install, all release current
From: hackan-ga on 05 Jun 2003 00:32 PDT
 
Hello,

As far as my knowledge leads me ,sadly, I'd suggest you to confirm if
the apache 2 is running with the .conf and php.ini files you are
refering to.

cheers
Subject: Re: PHP returns blank file on page view on linux apache install, all release cur
From: sycophant-ga on 25 Jun 2003 18:03 PDT
 
I had a similar problem recently, where it turned out that a specific
configuration change I had made to PHP was causing Apache to seg
fault.

Of course this should show up in the Apache error logs, which you said
show nothing. So I don't know if that's what's effecting you.

The only thing I can suggest is using strace to watch the executing of
an Apache thread and seeing if anything seems amiss.

Good luck!

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy