0

so i've started by setting up apache2 up on my ubuntu server. However it seemed to work fine however it did only show index.php as plain text, so i tried to use following command sudo apt-get install libapache2-mod-php5 and now it just show nothing when i access my server. it should be said that i've changed the listener port in ports.conf to 5055. Why am i not getting anything after installing libapache2?

so in order what i've done is

 sudo apt-get install apache2
 sudo nano /etc/apache2/ports.conf
 sudo service restart apache2
 sudo apt-get install libapache2-mod-php5
Peter Pik
  • 11,023
  • 19
  • 84
  • 142

2 Answers2

0

Try running the following:

sudo apt-get install php5
sudo service restart apache2

If I am right however in assuming you are running Ubuntu 16.04, please instead run the following command:

sudo apt install php libapache2-mod-php
Cathal
  • 318
  • 4
  • 15
  • `E: Package 'php5' has no installation candidate` and getting error `HTTP ERROR 500` – Peter Pik Jul 28 '16 at 17:49
  • Are you using Ubuntu 16? – Cathal Jul 28 '16 at 17:59
  • Wouldn't that be a dependency of `libapache2-mod-php5`? – miken32 Jul 28 '16 at 18:06
  • It would.. But I assumed OP would have included the command if he had installed PHP.. I also assume from the error above that OP is running Ubuntu 16.04 - in which case he should really be installing php7. The entire process should be done with a single command: "sudo apt install php libapache2-mod-php" – Cathal Jul 28 '16 at 18:10
0

Try these. You might be missing something.

sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql
sudo apt-get install php5 php5-mysql php-pear php5-gd php5-mcrypt php5-curl

This was taken from TrueSpot Media - https://www.truespotmedia.com/install-lamp-linux-apache-mysql-php-ubuntu/

Edward
  • 2,291
  • 2
  • 19
  • 33