1

I've a server with ubuntu 14. Previously I had apache2, PHP 5 and MySQL installed and it was working pretty well, but I had to install PHP7+PThreads extension, so I unninstalled the previous version (PHP 5). For what I see, PHP is installed and running in the system, I typed php -v and I get this:

PHP 7.0.3 (cli) (built: Mar  1 2016 22:13:21) ( ZTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies

Now, when I go to MyIPAddress/MyPage Apache shows me the PHP code of the page, is like PHP is not related with apache2. I even made service apache2 restart

For other side, I went to /etc/apache2/mods-enabled and there's nothing related with PHP, neither in mods-available so what should I check? Or where am I wrong? I'm not very good at linux shell. Thanks!

1
  • I just installed ubuntu 16.04 and installed php7 in terminal i can see the apache and php installed but still Having same problem :(
    – Ramesh
    Apr 24, 2016 at 4:51

2 Answers 2

3

Make sure you have the Apache module installed:

sudo apt install libapache2-mod-php7.0

I had the same problem for a while, but just fixed installing that one.

0
0

Use command dpkg --get-selections | grep apache to see the list of installed apache service.

If you see the libapache2-mod-php7.0 is missing then use following command to list all available the php7.0 service

 sudo apt-cache search php7-*

Now install required services

sudo apt-get install libapache2-mod-php7.0 php7.0-mysql php7.0-curl php7.0-json

Now restart the apache sudo service apache2 restart

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .