Fool proof method to install php5.6 on Ubuntu 16.04

Discussion in 'HOWTO-Related Questions' started by adamjedgar, Sep 6, 2018.

  1. adamjedgar

    adamjedgar Member

    Hi guys,
    I want to install box billing on ubuntu 16.04 lts virtual server on google cloud compute. because there are other apache websites on this server i do not wish to remove php7.0, 7.1 & 7.2.

    Box billing requires php5 (I assume php5.6 is ok?)

    Can someone provide me with a simple step by step foolproof method for adding the additional older version php5.6 please?

    i have tried to install it once, however, when i attempt to run phpinfo.php from url i get a 500 internal server error. As soon as i change back to php7.0 or 7.2 the error goes away and phpinfo.php displays correctly. I have run as root "apt autoremove php5.6" (which i hope puts me back at square one?)
     
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    How have you installed these several PHP versions?
    If you can install them with apt get, are you using Ondrej Sury repository to install them from? If yes, and you use the Ubuntu 16.04 repo, installing the PHP versions available there should just work. But note that the latest PHP you install becomes the default PHP. You must change it with update-alternatives to the PHP version that comes default with Ubuntu 16.04, to ensure ISPConfig still works.
    You can change PHP version in each website to what you want.
     
  3. adamjedgar

    adamjedgar Member

    i have had php7.0 7.1 and 7.2 running on server for ages. The issue is that i want to do some testing with box billing (in place of whmcs) and of course to run box billing it appears that i need php 5 (it says 5.3 or higher so i am hoping 5.6 will work).

    I am having problems using ondrej repository...it doesnt appear to work correctly for me.

    After a lot of mucking around even when i do install from the various repos suggested (which i have already been trying), i get an apache server error 500. My understanding is an error 500 is a server side error that sometimes is related to permissions and ownership. However i have checked this and that is not the problem.

    If i change back to php7.0 or php7.2, i dont get that error when i enter the phpinfo.php in browser, however, i do still get it when running php 7.1 which is weird.

    so why am i getting a server 500 error with php 5.6 or 7.1 but not when i change to php 7.0 or 7.2?
     
    Last edited: Sep 6, 2018
  4. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    I do not know how you have done the installation and setup, so I just guess the PHP settings are wrong since they do not work.
    Try searching relevant discussions and follow one good tutorial on how to set up multiple PHP versions. Like this, for example:
    https://www.howtoforge.com/community/threads/solved-ubuntu-14-04-php-7-1.79451/#post-376258
    Read also comments in tutorial, https://www.howtoforge.com/tutorial...fig-3-from-debian-packages-on-debian-8-and-9/ especially the one by Jesse Norell.
     

Share This Page