3

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?

    2 Answers 2

    8

    Run below commands again and check...

    sudo /etc/init.d/apache2 stop sudo apt-get remove --purge apache2 php5 sudo apt-get remove --purge libapache2-mod-php5 sudo apt-get install php5 apache2 libapache2-mod-php5 sudo /etc/init.d/apache2 start sudo a2enmod php5 sudo /etc/init.d/apache2 force-reload 
    2
    • I got several errors during the process, here's my full output: pastebin.com/2hmbC1Su
      – dukevin
      CommentedMar 5, 2011 at 20:41
    • i have my php7 installed and it's not showing up .php files (running)CommentedJul 15, 2017 at 10:30
    2

    I think you probably missed restarting apache2...

    /etc/init.d/apache2 restart 

    You will have to run this command from your root account, or put sudo on the beginning of it.

    For full details on installing PHP5 - use the official php5 on debian instructions HERE

    20
    • Looking at the site you provided, I typed this: vps:~# sudo a2enmod php4 ERROR: Module php4 does not exist!
      – dukevin
      CommentedMar 4, 2011 at 22:45
    • @Kevin - php4 definitely won't exist, you installed php5.CommentedMar 4, 2011 at 22:49
    • I get the same error for php5 :/
      – dukevin
      CommentedMar 4, 2011 at 22:51
    • And regarding your edited post, it says directory not found, perhaps I don't even have apache installed?
      – dukevin
      CommentedMar 4, 2011 at 22:52
    • Ah, reinstalling just said they are at their newest version. Not sure why I don't have /etc/apache or /ect/init.d/apache2
      – dukevin
      CommentedMar 4, 2011 at 22:54

    You must log in to answer this question.

    Start asking to get answers

    Find the answer to your question by asking.

    Ask question

    Explore related questions

    See similar questions with these tags.