I have VPS running Debian 5.0 (I think) and I would like to get it to run PHP files. I was told it needed to be configured with Apache. I tried entering the command apt-get install apache2 php5 libapache2-mod-php5
. But there was no change. Console output: http://pastebin.com/sVMWq6mA
This is everything in my /etc/apache2/mods-enabled
:
http://img35.imageshack.us/img35/6474/modsb.jpg
My webserver can be accessed here: http://206.217.223.136/test/ In my test.php file I have the code :
<?php
phpinfo();
?>
but instead of displaying the page, it tries to download it. How can I fix this?
Try this:
EDIT: some explaining
Installing just the php5 package does not give Apache any modules. Installing the libapache2-mod-php5 package installs the php5 module to Apache and should enable it by default.
Have you tried "a2enmod php" or "a2enmod php5" on your console to enable the php module?
Your command line is correct and it seems that everything is installed correct.
Edit: I have looked its
Edit2: Ok i have looked on the server for the problem. There were different problems with the apt-get installer. Then were httpd running on port 80 so apache2 could'nt start on the port and the test.php file was not in a correct file encoding this was the main problem. After checking all of them and create a new file with vi it was running.
Check your httpd.conf file and ensure you have a line like this:
AddType application/x-httpd-php .php
Also ensure that you have loaded your php module:
LoadModule php5_module *path to your php module*/libphp5.so
This is the way I have configured it on my web servers.