update php to 7.1 on centos 7 for ispconfig 3

Discussion in 'General' started by ariban99, Feb 2, 2019.

  1. ariban99

    ariban99 Member

    Hi
    i have the latest ispconfig installed on centos 7.4
    i need to update from php 5.4 to 5.5 as i get this warning
    reCAPTCHA requires at least PHP 5.5. (Currently using PHP 5.4.16)
    how can i update the php version ?
    thank you
     
  2. nhybgtvfr

    nhybgtvfr Active Member

    this link gives instructions for adding the webtatic repo, and installing php 7.1.0, possibly higher now, the page hasn't been updated for over a year:
    https://webtatic.com/packages/php70/

    i don't use centos, or that repo though, so i don't know if it also includes previous php releases.

    are you absolutely sure you want to install php 5.5 though? even 5.6 is now officially out of support.
    also, i believe you'd have to install it as an additional php, not upgrade/replace the version already installed.
    if the default php version is changed that causes problems with ispconfig.

    it might be worth considering a clean full install of a new server with centos 7.6, and php 7.3 and migrating everything over.
    you can then install php5.6 on that as an additional php for any sites that break with php7.* to give customers time to update their sites to be compliant with the latest php versions.

    you may be able to get away with a dist-upgrade, but i'm not 100% sure on that.
    it's not something i'd try on a production server, the risk of problems with it is too high for me.
     
  3. ariban99

    ariban99 Member

    thank you for the reply
    i just did a clean install about 3 month ago, and it installed with 5.4, why not higher? i dont know.
    i need a minimum of 5.5 it can be higher, i hope 7 wont break anything.
     
  4. nhybgtvfr

    nhybgtvfr Active Member

    centos 7.4 doesn't look that old, would have expected it to have a newer php than that.
    centos 7.6 was only released in oct. that should have something newer that php 5.4

    there's been lots of stuff deprecated in php 7.*, and syntax changes. I would expect anything written for php 5.4 to have problems. can't remember all the changes off my head, but MySQL connections is a definite one, although thankfully an easy one to fix.

    from a security viewpoint, I would go with the latest version of the OS with long term support, and php 7.3, installing php 5.* as an additional php only if a site doesn't work on php7 and you need some time leeway to update the site.
    as a bonus doing this, php7.3 is massively faster than php5.6, let alone 5.5 or 5.4
     
  5. ariban99

    ariban99 Member

    if anyone else needs to know what to do, here is what worked for me for centos 7, as i have not found anything else explaining about centos (there are others for ubuntu etc..)
    https://gist.github.com/Nilpo/6d99914cf05ef68df47fb80b86a2c5dd#71a
    i followed the instructions for php7.1 as 7.2 did NOT work, but 7.1 does work in these instructions.
    when you get to the part of

    wget http://mirror.symnds.com/distributions/gf/el/6/plus/x86_64/libmemcached-1.0.18-2.gf.el6.x86_64.rpm
    wget http://mirror.symnds.com/distributi...libmemcached-devel-1.0.18-2.gf.el6.x86_64.rpm
    wget http://mirror.symnds.com/distributi.../libmemcached-libs-1.0.18-2.gf.el6.x86_64.rpm
    yum install libmemcached-devel-1.0.18-2.gf.el6.x86_64.rpm libmemcached-1.0.18-2.gf.el6.x86_64.rpm libmemcached-libs-1.0.18-2.gf.el6.x86_64.rpm

    you can ignore this part, you will get an error saying cannot find the page, as its old. with centos7 today, you also have those downloaded from the first step, the later versions.

    once you are done following the instructions, you need to do a few more small steps.
    for me using drupal (not sure other CMS site), i had to change the settings.php to point to sql on 127.0.0.1 instead of localhost as the hostname for mysql. otherwise it wont connect to mysql.
    i also changed the following in php.ini for 7.1 as follows:
    nano /opt/php-7.1/lib/php.ini
    change the error reporting (so that notices aren't shown any longer): (search in nano by pushing ctl + w)

    from this error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
    to this error_reporting = E_ALL & ~E_NOTICE & ~E_DEPRECATED

    also change

    upload_max_filesize to 100m,

    max_file_upload to 100

    memory_limit to 512m

    post_max_size 100m

    uncomment cgi.fix_pathinfo=1

    Set the time zone to

    date.timezone = 'America/Los_Angeles' (or whatever your timezone is)


    save and close


    service php71-fpm restart

    systemctl restart httpd.service

    hope this helps someone else that is running centos7
     
  6. ariban99

    ariban99 Member

    lastly, you might need to restart your mysql or your server to get the new changes to work!
     

Share This Page