Page 1 of 1

Confounding php problem on Linux...

Posted: Wed Sep 07, 2005 9:29 am
by carpediem74
I've spent a good 10 hours on this problem and I'm about to go crazy....

A few weeks ago, I started having trouble with php on my server (not exactly sure why), so I am currently trying to install the newest version of php-5.0.5 on a previously existing Apache 2.0.51, following word-for-word the installation instructions in the php INSTALL file:

>> ./configure --with-apxs2=/usr/sbin/apxs

>> make

>> make install

>> cp php.ini-dist /usr/local/lib/php.ini

also added the following lines to /etc/httpd/conf/httpd.conf:

LoadModule php5_module /usr/lib/httpd/modules/libphp5.so
AddType application/x-httpd-php .php

Then I proceed to turn on Apache,

>> httpd

and try to view a local php test file by entering "localhost/test.php" in the browser's address bar.

I get nothing in Mozilla: the address bar correctly changes to "localhost/test.php", but the content does not change and it says "done" on the Mozilla browser status line. The source code is still the source code for the previous page. When I try to do a command-line "telnet localhost 80" and "HEAD /test.php HTTP/1.0", I get nothing and the connection just closes. This works fine for any other html file.

I've also tried accessing this file remotely from a client computer running Windows IE (browsing to "192.168.100.1/test.php"), it gives me a "Page cannot be loaded" error. I can access other html files just fine, just not php files.

Any ideas would be greatly appreciated because this is driving me nuts!

Posted: Wed Sep 07, 2005 10:14 am
by Chris Corbyn
Not 100% of the *correct* solution but I had the same problem when setting a server up recently on Gentoo. Evetually I gave up and recompiled both Apache and PHP5... (Apache first, then PHP5). It fixed the issue but it sounds like you're looking not recompile Apache.

Posted: Thu Nov 17, 2005 7:35 am
by dude81
I guesss here you go wrong

Code: Select all

AddType application/x-httpd-php .php
it should be something like

Code: Select all

AddType application/x-httpd-php .php .php4 .php5 .phtml

Posted: Thu Nov 17, 2005 7:36 am
by dude81
Also you need to set document root in php.ini