LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   php5 on apache2 won't parse php if pagename not specified. (https://www.linuxquestions.org/questions/linux-server-73/php5-on-apache2-wont-parse-php-if-pagename-not-specified-642969/)

DangNewbie 05-17-2008 11:25 PM

php5 on apache2 won't parse php if pagename not specified.
 
Hi All,

Thanks for reading.

I just finished reinstalling php5.1.6 for Apache/2.2.3 on FreeBSD 6.2-RELEASE. I've installed it from ports, as a module and cli.

I've actually done it several times and have two problems:

1. It works ok, but when I install the php5-extensions, it stops working and I get a core dump if I try to run anything. I'm sure this has a variety of possible causes, and I expect I will have to install the extensions one at a time to see which is the problem, but am certainly open to ideas if anyone has a better one.

2. This is the one that really has me stumped at this point. If I load a page directly, as http://www.domain.com/index.php, it runs just fine. However, if I load it as the default without the page name, like http://www.domain.com/ it doesn't parse, and starts a file download. If I download the file, it's a text file of the php source. Everything looks ok (I think) in the apache conf file.

Any ideas?

Thanks!

j-ray 05-18-2008 01:29 PM

maybe it helps to put a line like that in httpd.conf and restart the server:

DirectoryIndex index.php index.html index.txt

DangNewbie 05-18-2008 01:49 PM

It's already there.
 
Thanks. The index is set. If I load / it points to the correct index page, it's just that it isn't parsed.

amon 07-25-2008 08:29 AM

Quote:

Originally Posted by DangNewbie (Post 3156666)
Hi All,
2. This is the one that really has me stumped at this point. If I load a page directly, as http://www.domain.com/index.php, it runs just fine. However, if I load it as the default without the page name, like http://www.domain.com/ it doesn't parse, and starts a file download. If I download the file, it's a text file of the php source. Everything looks ok (I think) in the apache conf file.


I had this issue just now (wasted some time on it) after playing with Apache for 4 hours I tried it on a different computer (as I researched it from home)... Turns out it was an issue with Firefox. I got back to work cleared the cache in firefox and problem solved. Not sure if this is the same but it worked for me.

BTW I'm using: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1

Hope this helps save some other poor sole at least 2 wasted hours :)


All times are GMT -5. The time now is 01:21 PM.