LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 08-08-2007, 07:49 PM   #1
mohtasham1983
Member
 
Registered: Apr 2005
Location: San Jose
Distribution: Fedora 3,4- Ubuntu 6.06 to 8.10, Gentoo and Arch
Posts: 408

Rep: Reputation: 30
php5 not working with apache2 in debian 4.0


I have installed Debian 4.0 at my friend's computer. It didn't have apache2 by default so I installed it from sarg repository. I noticed that httpd.conf was changed to apache2.conf so it didn't allow me to start the server. After eliminating this problem I installed PHP5 with libapache2-mod-php5.

Then I added following lines to apache2.conf:

Code:
# Use for PHP 5.x:
LoadModule php5_module        /usr/lib/apache2/modules/libphp5.so	
AddHandler php5-script php 

# Add index.php to your DirectoryIndex line:
DirectoryIndex index.html index.php

AddType text/html       php

# PHP Syntax Coloring
# (optional but useful for reading PHP source for debugging):
AddType application/x-httpd-php-source phps
I found libphp5.so in /usr/lib/apache2/modules/ so I added all address path to it. When I restart apache it doesn't give me any error, but when I try to open a php file, it tries to download it instead.

I have installed php and apache several times in fedora 3,4 and all ubuntu versions, but I never thought that installing it on Debian is so difficult. I just chose Debian, because of its famous stablity. I am even thinking about installing ubuntu server instead of Debian, since ubuntu has been very stable for me as a desktop OS and softwares that are coming with it are from latest versions. However, I have never seen any recommendation of installing ubuntu as a server.

I will really appreciate if you help me.

Thank you in adcance.
 
Old 08-08-2007, 08:02 PM   #2
mohtasham1983
Member
 
Registered: Apr 2005
Location: San Jose
Distribution: Fedora 3,4- Ubuntu 6.06 to 8.10, Gentoo and Arch
Posts: 408

Original Poster
Rep: Reputation: 30
I just noticed that all those lines that I added to apache2.conf files are already in mods-available/ directory.
 
Old 08-08-2007, 09:19 PM   #3
mohtasham1983
Member
 
Registered: Apr 2005
Location: San Jose
Distribution: Fedora 3,4- Ubuntu 6.06 to 8.10, Gentoo and Arch
Posts: 408

Original Poster
Rep: Reputation: 30
I just figured out how to make it working. I'm going to explain what I did for those who may encounter such problem.

What I did was very simple. You should disable all repositories and install everything from:

Code:
deb ftp://ftp2.fr.debian.org/debian/ stable main contrib non-free

At first I tried to install it using a repository with unstable programs.

Then you have to add everything I mentioned in my first post to apache.conf file.


I hope this thread can help some people.
 
  


Reply



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 on Debian Etch not working finferflu Linux - Server 28 02-24-2011 05:03 AM
Debian / Apache2 / PHP5 / Firefox not parsing locally Garybtx Linux - Server 2 11-13-2006 06:57 PM
Apache2 and php5 not working RestInPieces Fedora 2 06-27-2006 06:27 PM
php5 not working on apache2 akp913 Debian 1 06-26-2006 03:28 AM
debian, apache2, ipcop and vhosts not working TheSpork Linux - Networking 1 06-04-2005 05:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 04:12 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration