Re: php returning completely empty documents on new apache install

From: Date: Tue, 14 Mar 2006 23:57:34 +0000
Subject: Re: php returning completely empty documents on new apache install
References: 1 2 3 4 5 6 7 8 9 10  Groups: php.install 
Request: Send a blank email to php-install+get-17187@lists.php.net to get a copy of this message
Oh, and at this point I'm working under the theory that my php.ini is not being found correctly. I gave the path to the directory containing the file on the ./configure commandline like this: ./configure --with-apxs2=$MYDIR/bin/apxs --with-mysql=$MYDIR --prefix=$MYDIR --without-pear --with-libxml-dir=$MYDIR My php.ini is in $MYDIR/lib which is where php will look for it according to ./configure --help. Is there any way I can find out if my php.ini is being read? I've tried putting syntax errors in it, but see nothing come out in the logs indicating as such. -Matt On 14/03/06, Matt G. <mattismyname@gmail.com> wrote: > > Here's my apache startup message from my error log: > > [Tue Mar 14 15:40:19 2006] [notice] Apache/2.0.55 (Unix) PHP/5.1.2 > configured -- resuming normal operations > > Here's the server signature from a 404 document: > > Apache/2.0.55 (Unix) PHP/5.1.2 Server at MYHOSTNAME Port MYPORT > > You might notice that I've switched over to apache 2.0 in an effort to get > this working. Unfortunately, the exact same problem exists even with my > 2.0 install. Regarding the httpd.conf, I'm reasonably sure I'm editing > the correct file because the other options I've changed in there (like > server port number) have taken effect properly. The other thing I thought > about was that perhaps there's a firewall or cache in-between my browser and > the server that's doing something funky, but to make sure there wasn't, I > tried a wget of my hello.php from the exact server where my httpd is. The > doc returned was still 0 bytes. > > Grrrr..... > > On 14/03/06, php@karsites.net <php@karsites.net> wrote: > > > > > > Are you sure that you are editing the right httpd.conf file > > Matt? > > > > I've edited the wrong file before, then wondered why my > > changes have no effect. > > > > You could try adding something to your httpd.conf that will > > generate an error, such as the wrong path to the php module. > > > > Then do apachectl -t to do a syntax error on your httpd.conf > > file. > > > > If you get 'syntax OK' and no error message then this may > > be the problem. > > > > Keith > > > > > > In theory, theory and practice are the same; > > In practice they are not. > > > > On Tue, 14 Mar 2006 php@karsites.net wrote: > > > > > To: php-install@lists.php.net > > > From: php@karsites.net > > > Subject: Re: [PHP-INSTALL] php returning completely empty documents on > > new > > > apache install > > > > > > > > > One more thing Matt, before I ask on the apache mailing > > > list: > > > > > > Can you check your apache error_log please, and see if it > > > says that php is starting ok. > > > > > > This is what it says in my Apache 2.2.0 error_log when it > > > starts up: > > > > > > [Sun Mar 12 05:52:45 2006] [info] mod_unique_id: using ip > > > addr 10.0.0.1 > > > [Sun Mar 12 05:52:46 2006] [notice] Digest: generating > > > secret for digest authentication ... > > > [Sun Mar 12 05:52:46 2006] [notice] Digest: done > > > [Sun Mar 12 05:52:46 2006] [info] mod_unique_id: using ip > > > addr 10.0.0.1 > > > [Sun Mar 12 05:52:47 2006] [notice] Apache/2.2.0 (Unix) > > > PHP/5.1.2 configured > > > -- resuming normal operations > > > > > > What do you have in your error_log? > > > > > > Keith > > > > > > In theory, theory and practice are the same; > > > In practice they are not. > > > > > > On Tue, 14 Mar 2006 php@karsites.net wrote: > > > > > > > To: php-install@lists.php.net > > > > From: php@karsites.net > > > > Subject: Re: [PHP-INSTALL] php returning completely empty documents > > on new > > > > apache install > > > > > > > > > > > > Sounds to me like apache may not be loading the php5 module. > > > > > > > > This is why I asked you to get Apache to show what the > > > > server signature was returning. > > > > > > > > I think you need to find a way to establish whether the php5 > > > > module is being loaded or not. I'm not sure if mod_info will > > > > return this. > > > > > > > > Let me ask on the httpd mailing list how to do this. > > > > > > > > I'll get back to you then. > > > > > > > > Keith > > > > > > > > In theory, theory and practice are the same; > > > > In practice they are not. > > > > > > > > On Tue, 14 Mar 2006, Matt G. wrote: > > > > > > > > > To: "php@karsites.net" < php@karsites.net> > > > > > From: Matt G. <mattismyname@gmail.com> > > > > > Subject: Re: [PHP-INSTALL] php returning completely empty > > documents on new > > > > > apache install > > > > > > > > > > Thanks for the great suggestions. We might be getting a bit > > closer here... > > > > > > > > > > 1) I did find that doc_root was not set in my php.ini so I filled > > it in and > > > > > pointed it to my apache htdocs directory > > > > > 2) Error logging was turned on in php.ini but I expanded it to > > include > > > > > E_STRICT > > > > > 3) Error logging to a file was not turned on in php.ini so I > > turned it on. > > > > > No errors have showed up in the logfile I specified. > > > > > 4) expose_php is turned on as well as the ServerTokens and > > ServerSignature > > > > > lines you gave. Unfortunately, when I view a 404 URL, apache > > identifies > > > > > itselv, but does NOT say anything about php. This led me to > > believe that > > > > > somehow my php.ini was not getting read. I tried pointing $PHPRC > > directly > > > > > to my php.ini and restarting the apache server but this didn't > > change > > > > > anything. Somehow I still suspect that my php.ini is not getting > > found so > > > > > I'm going to fool around with that now. > > > > > > > > > > > > > > > > > > > > > > > > > On 14/03/06, php@karsites.net <php@karsites.net> wrote: > > > > > > > > > > > > > > > > > > Something else Matt. > > > > > > > > > > > > Are you using the short php open tags - like <? <% > > > > > > instead of the full <?php open tag? > > > > > > > > > > > > If so then php will ignore any embeded php code unless you > > > > > > use the full <?php to switch to php mode. > > > > > > > > > > > > ;;php.ini extract > > > > > > ; whether PHP may add its signature to the Web server header > > > > > > expose_php = YES > > > > > > > > > > > > ; Allow ASP-style <% %> tags. > > > > > > asp_tags = OFF > > > > > > > > > > > > ; Allow the <? tag. Otherwise, only <?php and <script> > > > > > > tags > > > > > > are recognized. > > > > > > short_open_tag = OFF > > > > > > > > > > > > Another thing, when you do a directory listing, or generate > > > > > > a 404 apache error, does Apache return the php version as > > > > > > part of the server signature? > > > > > > > > > > > > You can check this by setting expose_php = YES iniphp.ini, > > > > > > and in httpd.conf, setting: > > > > > > > > > > > > ServerTokens Full > > > > > > ServerSignature On > > > > > > > > > > > > This should show you if php is loaded into apache OK. > > > > > > > > > > > > Keith > > > > > > > > > > > > In theory, theory and practice are the same; > > > > > > In practice they are not. > > > > > > > > > > > > On Mon, 13 Mar 2006, Matt G. wrote: > > > > > > > > > > > > > To: "php@karsites.net" <php@karsites.net> > > > > > > > From: Matt G. < mattismyname@gmail.com> > > > > > > > Subject: [SPAM] Re: [PHP-INSTALL] php returning completely > > empty > > > > > > documents on > > > > > > > new apache install > > > > > > > > > > > > > > Yes, compiled against apache 1.3.34. I never even downloaded > > a > > > > > > 2.xversion... > > > > > > > > > > > > > > One non-standard thing I'm doing is running apache under my > > personal > > > > > > user > > > > > > > account on this machine. (I don't have root) But I > > > > > > > wouldn't > > think that > > > > > > > should be a problem. Is it possible that php is somehow > > running into a > > > > > > > permission denied problem? I've checked file permissions > > > > > > > and > > ownerships > > > > > > > pretty thoroughly and don't see anything amiss. > > > > > > > > > > > > > > thanks > > > > > > > > > > > > > > > > > > > > > On 13/03/06, php@karsites.net <php@karsites.net> wrote: > > > > > > > > > > > > > > > > > > > > > > > > This is really strange cause normally php works just fine! > > > > > > > > > > > > > > > > Have you compiled php5 against Apache 1.3.34, and not a > > > > > > > > 2.0.xx version Matt? > > > > > > > > > > > > > > > > Keith > > > > > > > > > > > > > > > > On Sun, 12 Mar 2006, Matt G. wrote: > > > > > > > > > > > > > > > > > To: "php@karsites.net" > > > > > > > > > <php@karsites.net> > > > > > > > > > From: Matt G. < mattismyname@gmail.com> > > > > > > > > > Subject: [SPAM] Re: [PHP-INSTALL] Re: [SPAM] Re: > > [PHP-INSTALL] php > > > > > > > > returning > > > > > > > > > completely empty documents on new apache install > > > > > > > > > > > > > > > > > > Err...my mistake, I am using apache 1.3.34. Not sure > > > > > > > > > why > > I said 2.0in > > > > > > > > the > > > > > > > > > original message. > > > > > > > > > > > > > > > > > > On 12/03/06, php@karsites.net <php@karsites.net> > > > > > > > > > wrote: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Is it because you are using the AddModule > > > > > > > > > > directive. > > > > > > > > > > I think that is only used in Apache 1.3.x series. > > > > > > > > > > > > > > > > > > > > This is all I have in my httpd.conf for loading > > > > > > > > > > the php > > > > > > > > > > module. > > > > > > > > > > > > > > > > > > > > ##LoadModule > > speling_module modules/mod_speling.so > > > > > > > > > > ##LoadModule > > userdir_module modules/mod_userdir.so > > > > > > > > > > LoadModule > > alias_module modules/mod_alias.so > > > > > > > > > > ##LoadModule > > rewrite_module modules/mod_rewrite.so > > > > > > > > > > LoadModule php5_module > > > > > > > > > > modules/libphp5.so > > > > > > > > > > > > > > > > > > > > Keith > > > > > > > > > > > > > > > > > > > > In theory, theory and practice are the same; > > > > > > > > > > In practice they are not. > > > > > > > > > > > > > > > > > > > > On Sun, 12 Mar 2006, Matt G. wrote: > > > > > > > > > > > > > > > > > > > > > To: "php@karsites.net" > > > > > > > > > > > <php@karsites.net> From: Matt > > G. > > > > > > > > > > > < mattismyname@gmail.com> Subject: > > > > > > > > > > > [SPAM] Re: > > [PHP-INSTALL] > > > > > > > > > > > php returning completely empty documents on > > > > > > > > > > > new apache install > > > > > > > > > > > > > > > > > > > > > > Hi Keith, > > > > > > > > > > > > > > > > > > > > > > Thanks for the suggestions. I had already > > > > > > > > > > > tried the > > > > > > > > > > > phpinfo() call and it results in the same > > > > > > > > > > > thing as my > > > > > > > > > > > hello world, just a 0 byte document returned > > > > > > > > > > > from the > > > > > > > > > > > webserver. The apache install is essentially > > > > > > > > > > > working > > > > > > > > > > > correctly, it returns .html docs just fine. > > > > > > > > > > > Also, I > > > > > > > > > > > checked those php.ini keywords and they are > > > > > > > > > > > both set > > to > > > > > > > > > > > on. (in fact I'm using the exact sample > > > > > > > > > > > php.ini that > > came > > > > > > > > > > > with the source distribution.) > > > > > > > > > > > > > > > > > > > > > > I'm completely stumped... > > > > > > > > > > > > > > > > > > > > > > On 11/03/06, php@karsites.net > > > > > > > > > > > <php@karsites.net> > > wrote: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Try calling the following as a php file: > > > > > > > > > > > > > > > > > > > > > > > > <?php > > > > > > > > > > > > > > > > > > > > > > > > phpinfo(); > > > > > > > > > > > > > > > > > > > > > > > > ?> > > > > > > > > > > > > > > > > > > > > > > > > It's only 3 lines, but that returns > > > > > > > > > > > > alot of > > information for > > > > > > > > > > > > debugging your php installation. > > > > > > > > > > > > > > > > > > > > > > > > Do you have the following directives set > > > > > > > > > > > > in php.ini? > > > > > > > > > > > > > > > > > > > > > > > > ; Enable the PHP scripting language > > > > > > > > > > > > engine under > > Apache. > > > > > > > > > > > > engine = ON > > > > > > > > > > > > > > > > > > > > > > > > ; whether PHP may add its signature to > > > > > > > > > > > > the Web > > server header > > > > > > > > > > > > expose_php = YES > > > > > > > > > > > > > > > > > > > > > > > > Can you return a plain html document > > > > > > > > > > > > with Apache? > > > > > > > > > > > > > > > > > > > > > > > > If not, is your apache DocRoot setup > > > > > > > > > > > > correctly? > > > > > > > > > > > > > > > > > > > > > > > > Keith > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > In theory, theory and practice are the > > > > > > > > > > > > same; > > > > > > > > > > > > In practice they are not. > > > > > > > > > > > > > > > > > > > > > > > > On Sat, 11 Mar 2006, Matt G. wrote: > > > > > > > > > > > > > > > > > > > > > > > > > To: php-install@lists.php.net From: > > > > > > > > > > > > > Matt G. > > > > > > > > > > > > > <mattismyname@gmail.com> > > > > > > > > > > > > > Subject: [PHP-INSTALL] > > php > > > > > > > > > > > > > returning completely empty > > > > > > > > > > > > > documents on new apache > > > > > > > > > > > > > > > install > > > > > > > > > > > > > > > > > > > > > > > > > > I just built the latest apache 2.0 > > > > > > > > > > > > > and php5 > > (shared > > > > > > > > > > > > > apache module) on a linux 2.6.5 > > > > > > > > > > > > > box. After doing > > all > > > > > > > > > > > > > of the setup from the INSTALL file, > > > > > > > > > > > > I'm > > > > > > > > > > > > > unable to get a php hello world to > > > > > > > > > > > > > work! (Well, I > > get it to > > > > > > > > work > > > > > > > > > > with > > > > > > > > > > > > the > > > > > > > > > > > > > CLI, but not through my web > > > > > > > > > > > > > browser) The apache > > > > > > > > > > > > > server just returns a 0 byte > > > > > > > > > > > > > document. No errors > > come > > > > > > > > > > > > > out in the apache logs and it says > > > > > > > > > > > > > the document > > was > > > > > > > > > > > > > sent with a http 200 status. It is > > > > > > > > > > > > > as if the php > > > > > > > > > > > > interpreter > > > > > > > > > > > > > is not getting called. > > > > > > > > > > > > > > > > > > > > > > > > > > When the apache server starts up, > > > > > > > > > > > > > it logs that php > > is in > > > > > > fact > > > > > > > > > > > > configured: > > > > > > > > > > > > > > > > > > > > > > > > > > [Sat Mar 11 16:06:51 2006] [notice] > > > > > > > > > > > > > Apache/1.3.34 > > (Unix) > > > > > > > > PHP/5.1.2 > > > > > > > > > > > > > configured -- resuming normal > > > > > > > > > > > > > operations > > > > > > > > > > > > > > > > > > > > > > > > > > I believe I have the correct lines > > > > > > > > > > > > > in my > > httpd.conf: > > > > > > > > > > > > > LoadModule php5_module > > > > > > > > > > > > > libexec/libphp5.so > > > > > > > > > > > > > AddModule mod_php5.c > > > > > > > > > > > > > DirectoryIndex index.html > > > > > > > > > > > > > index.php > > > > > > > > > > > > > AddType application/x-httpd-php > > > > > > > > > > > > > .php .phtml > > > > > > > > > > > > > AddType > > > > > > > > > > > > > application/x-httpd-php-source .phps > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Does anybody have any suggestions > > > > > > > > > > > > > for how I can > > dig into > > > > > > this > > > > > > > > > > further? > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >

« previous php.install (#17187) next »