user1785684 user1785684 - 1 year ago 378
Apache Configuration Question

Linux Mint 18 PHP5.6 Not Working

I'm fairly new to Linux as a whole, I've recently been attempting to setup a little home server running PHP5.6, however I have been plagued with issues.

Originally I installed Linux 17.2 (and later updated to 17.3) to do the job, however there seemed to be some conflict with my box causing there to be intermittent booting problems (it would often just stop dead and the monitor would go into power save, this didn't happen all the time but enough to be a problem)...

So I decided to update to Linux 18 to see if the problem persisted, which I;m happy to say, it does not, no boot problems at all, however I've instead run into a new problem :(

Since Linux Mint 8 has PHP7 by default in its repositories it is not compatible with what I'm trying to run, so I've been attempting to get PHP 5.6 installed, which I believe I have done, at-least it tells me I have it installed when I check the version in the terminal.

php -v

PHP (cli) Copyright (c) 1997-2016 The
PHP Group Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend
Technologies with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by
Zend Technologies

I achieved this with the following:

$ sudo apt-get install python-software-properties
$ sudo add-apt-repository ppa:ondrej/php
$ sudo apt-get update
$ sudo apt-get install -y php5.6 php5.6-mcrypt php5.6-gd

However, following the same walk-through, I am unable to install as described because I get the following error:

Package libapache2-mod-php5 is not available, but is referred to by
another package. This may mean that the package is missing, has been
obsoleted, or is only available from another source

E: Package 'libapache2-mod-php5' has no installation candidate

and yet when I try installed apache2 flat

$ sudo apt-get install apache2

While apache works, PHP fails to work at all, I created a page with the phpinfo(); method and I simply get a blank page :(

enter image description here

Can somebody please help me shed some light on this ?

Thanks for any help in advance :(


Answer Source

Try this module instead:

sudo a2enmod php5.6  
sudo service apache2 restart
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download