Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

SNaRe's avatar

PHP7 & Digitalocean Problem

I have a hosting on Digital Ocean.

I installed LAMP on my server and Laravel by following. It works perfectly.

https://laracasts.com/discuss/channels/laravel/install-laravel-on-digitalocean-by-lamp

But it is now PHP5 and I would like to have PHP7.

I searched a lot of tutorials online to upgrade PHP7 but I couldn't succeed.

https://www.digitalocean.com/community/tutorials/how-to-upgrade-to-php-7-on-ubuntu-14-04

Is there an article or a simple command for me to upgrade to PHP7? or maybe a LAMP that comes with PHP7 out of the box.

0 likes
8 replies
ChristopherSFSD's avatar

You probably need to tell apache that php files need to be processed by the php7 module.

SNaRe's avatar

@christopher I will give a try but it doesn't make sense to not to have a LAMP with PHP 7.0 as of now.

bashy's avatar

Using Apache right? Can you show the settings you have for PHP files via Apache?

SNaRe's avatar
SNaRe
OP
Best Answer
Level 7

My real problem was

apache2: Syntax error on line 140 of /etc/apache2/apache2.conf: Could not open configuration file /etc/apache2/mods-enabled/php5.load: No such file or directory
Action 'configtest' failed.
The Apache error log may have more information.

Solved it by running

$ cd /etc/apache2/mods-enabled
$ a2dismod php5
$ service apache2 restart

The only problem remains is phpmyadmin on PHP7.

I run this command as suggested in https://www.digitalocean.com/community/tutorials/how-to-upgrade-to-php-7-on-ubuntu-14-04

sudo add-apt-repository ppa:nijel/phpmyadmin
sudo apt-get install phpmyadmin

But I get this error

The following packages have unmet dependencies:
 phpmyadmin : Depends: php5-json but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

I googled again and found this solution

In my public folder ( var/www/html ) I ran this command.

apt-get install git
git clone --depth=1 --branch=STABLE https://github.com/phpmyadmin/phpmyadmin.git

It is really too much work to get it up running :)

Hopefully this will post will save time for people, who have same problem.

Please or to participate in this conversation.