Confounding php problem on Linux...

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
carpediem74
Forum Newbie
Posts: 1
Joined: Wed Sep 07, 2005 9:27 am

Confounding php problem on Linux...

Post 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!
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post 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.
User avatar
dude81
Forum Regular
Posts: 509
Joined: Mon Aug 29, 2005 6:26 am
Location: Pearls City

Post 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
User avatar
dude81
Forum Regular
Posts: 509
Joined: Mon Aug 29, 2005 6:26 am
Location: Pearls City

Post by dude81 »

Also you need to set document root in php.ini
Post Reply