LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 10-23-2004, 11:35 PM   #1
atheist
Member
 
Registered: Sep 2003
Location: Iceland
Distribution: Debian Lenny - Kernel 2.6.22.8
Posts: 331

Rep: Reputation: 30
apache2 + php4


I just installed and apache2 and php4. I used apt-get to install them and apache2 is working fine. php4, however, is not going too great. I installed all the necessary packages. The documentation says it should work out of the box and no extra configuration is required but when ever I try and load my page the browser tells me I have chosen to open the file index.php and asks me if I want to open it or save it to a disk.

What am I doing wrong here?

Any input or suggestions will be appreciated.

Thanks.
 
Old 10-24-2004, 09:52 AM   #2
Boby
Member
 
Registered: Feb 2004
Location: Sighisoara/Cluj-Napoca (Romania)
Distribution: CentOS 4, Fedora Core 6
Posts: 781

Rep: Reputation: 31
Please look at your httpd.conf file. Look if you have this:
Code:
DirectoryIndex index.php
and
Code:
AddType application/x-httpd-php .php
Boby
 
Old 10-24-2004, 10:27 AM   #3
Pecunia
LQ Newbie
 
Registered: May 2003
Location: The Netherlands
Distribution: LFS
Posts: 28

Rep: Reputation: 15
Also, you should edit Apache's httpd.conf to load the PHP module, like for example:
Code:
LoadModule php4_module        modules/libphp4.so
 
Old 10-24-2004, 01:21 PM   #4
atheist
Member
 
Registered: Sep 2003
Location: Iceland
Distribution: Debian Lenny - Kernel 2.6.22.8
Posts: 331

Original Poster
Rep: Reputation: 30
Thanks, both of you.

I tried that, and well... it didn't work.
A note, though: I replaced the modules/php4.so with the real path to the php4 module, of course.

Any other ideas?
 
Old 10-24-2004, 02:44 PM   #5
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu
Posts: 1,415

Rep: Reputation: 99
did the server give any messages when u had changed the
LoadModule line in httpd.conf?
u have to restart the server to make the changes in httpd.conf work.
another possible error might be, that there are different versions of apache available on your box and the httpd.conf belongs to the other server. but if httpd.conf resides in sth like apache2 directory u can count this idea out.
good luck
j.
 
Old 10-24-2004, 02:53 PM   #6
atheist
Member
 
Registered: Sep 2003
Location: Iceland
Distribution: Debian Lenny - Kernel 2.6.22.8
Posts: 331

Original Poster
Rep: Reputation: 30
Nope, no messages at all from apache. And yes, I did restart the server (apache2ctl stop && apache2ctl start). I only have apache2 installed. And another thing. It did give me an error when I first tried the LoadModule thing, then I changed the path and doesn't give the error anymore so it must be reading the config file and loading the module, right?
 
Old 10-25-2004, 03:12 PM   #7
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu
Posts: 1,415

Rep: Reputation: 99
i think so, too. you may check the error_log of the server. maybe it supplies some info.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache2 and php4 in Debian swmok Debian 1 06-09-2005 05:21 PM
phpbb, apache2, php4 Odins_Son Linux - Software 2 12-23-2004 02:24 AM
php4 with apache2? the debian way, how? Tisch Debian 4 08-19-2004 09:35 AM
Debian, apache2 and php4 Pasi Linux - Distributions 1 03-20-2003 07:28 PM
Apache2 & php4 CyberDrake Linux - Newbie 2 11-25-2002 11:32 AM


All times are GMT -5. The time now is 10:51 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration