LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 06-04-2008, 04:19 PM   #1
Osvald
LQ Newbie
 
Registered: Jun 2008
Posts: 3

Rep: Reputation: 0
Cant get php to work


I have apache 2.2 on a debian server. I have installed php5 as module and have:

libphp5.so in usr/lib/apache2/modules

php5.conf (in mods-enabled):
<IfModule mod_php5.c>
AddType application/x-httpd-php .php .phtml .php3
AddType application/x-httpd-php-source .phps
</IfModule>

php5.load (-//-):
LoadModule php5_module /usr/lib/apache2/modules/libphp5.so

In httpd.conf I have:
AddHandler php5-script php
AddType text/html php


The module is loaded and I have restarted the server, but php files dont work in the browser, they are just downloaded.

Any ideas?
 
Old 06-04-2008, 04:29 PM   #2
DragonM15
Member
 
Registered: Sep 2003
Location: USA
Distribution: Slackware (Multiple Versions)
Posts: 455

Rep: Reputation: 31
Did you upgrade to apache 2.2 from apache 1? And did you upgrade php 4 to php 5, or were they already installed. I found with slackware if you upgrade apache 1 to apache 2 and with it php 4 to php 5 instead of uninstalling the previous versions and then installing the new ones you get problems. Or at least I did.

DragonM15

P.S. I had problems with apache 2.2 anyways. I kicked it down to 2.0 and it works great. Just a thought
 
Old 06-04-2008, 04:45 PM   #3
Osvald
LQ Newbie
 
Registered: Jun 2008
Posts: 3

Original Poster
Rep: Reputation: 0
The apache is a new install but I started out with php4. At one point I accidentally deleted the httpd.conf and I tried to reconstruct it, so I have a notion it has something to do with that

O.

Current httpd.conf:

# Use for PHP 5.x:
#LoadModule php5_module 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
 
Old 06-04-2008, 05:34 PM   #4
Osvald
LQ Newbie
 
Registered: Jun 2008
Posts: 3

Original Poster
Rep: Reputation: 0
Solved

Well, my setup seems to work after all.
I cleared the cache in my browser and the php files are executed just fine!
 
Old 06-07-2008, 02:01 PM   #5
DragonM15
Member
 
Registered: Sep 2003
Location: USA
Distribution: Slackware (Multiple Versions)
Posts: 455

Rep: Reputation: 31
Quote:
Originally Posted by Osvald View Post
Well, my setup seems to work after all.
I cleared the cache in my browser and the php files are executed just fine!
Hate it when that happens. So it was working fine then. I noticed a difference in my config vs. yours. My Addtype lines are in php.conf But that might be a difference in Slackware packages vs. Debian.

DragonM15
 
  


Reply

Tags
apache2, debian, php5


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
Suse 9.3/apache2/php4 - Firefox tries to download index.php, other *php pages work stefanlasiewski Suse/Novell 1 01-18-2006 06:12 PM
PHP / VideoLAN / Fedora Core Question - how can I get the PHP "exec" function to work gtrawoger Linux - Software 3 12-21-2005 06:51 AM
Can't Get php to work? ahsiii Linux - Software 3 11-29-2005 06:02 AM
php5 apache2 mysql4 don't work, php does not seem to read php.ini atom Linux - Software 5 03-24-2005 11:05 AM
getting PHP to work...please help! rudini Linux - Software 12 03-24-2005 05:44 AM


All times are GMT -5. The time now is 06:14 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