LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Cant get php to work (http://www.linuxquestions.org/questions/linux-newbie-8/cant-get-php-to-work-647047/)

Osvald 06-04-2008 05:19 PM

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?

DragonM15 06-04-2008 05:29 PM

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

Osvald 06-04-2008 05:45 PM

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:confused:

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

Osvald 06-04-2008 06:34 PM

Solved
 
Well, my setup seems to work after all.
I cleared the cache in my browser and the php files are executed just fine!:rolleyes:

DragonM15 06-07-2008 03:01 PM

Quote:

Originally Posted by Osvald (Post 3174973)
Well, my setup seems to work after all.
I cleared the cache in my browser and the php files are executed just fine!:rolleyes:

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


All times are GMT -5. The time now is 08:22 AM.