Upgrade PHP - Ubuntu 18.04, Apache, PHP, MySQL, PureFTPD, BIND, Postfix, Dovecot and ISPConfig 3.1

Discussion in 'Installation/Configuration' started by Tastiger, May 21, 2020.

  1. Tastiger

    Tastiger Member HowtoForge Supporter

    Just got this message today on one of my Joomla sites

    Simple question - is there a tutorial out there for upgrading my Perfect Server Ubuntu 18.0.4 installation safely, as I am still relatively a newbie and get a bit jumpy when it comes to upgrades like this and I don't want to break my server.
  2. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    Basically, you do not want to upgrade your perfect Ubuntu 18.04 server default systrm php but you may want to add additional php to it.

    Read this tutorial for a guide to do the later: https://www.howtoforge.com/tutorial...3-from-debian-packages-on-debian-8-and-9/amp/

    Though it is meant for Debian, with very minor adjustment, it should work fine with its derivative Ubuntu as well.

    You will then just need to change the php version for that site in its web setting page to php7.4 that you wished earlier.

    It is pertinent to note that installing additional php using the suggested ondrej sury repository may automatically change your default php to the latest php upon its installation or update.

    Thuswise your need to restore the default php immediately thereafter, or otherwise, ISPConfig and other services that rely on that default php may not work properly or totally fail to work.

    For that purpose, I personally use a script with a cron job to check this changes and restore the default php. You can read about it here: https://www.howtoforge.com/community/threads/monitor-os-default-php-and-restore-if-changed.83288/

    Good luck.
  3. Tastiger

    Tastiger Member HowtoForge Supporter

    Thanks for that, I think a mirror of the drive maybe in order before I start o_O
    You mentioned minor adjustments to that tutorial, could you elaborate?
  4. Steini86

    Steini86 Active Member

    Instead of Part 4 of the guide ("Add the repository at packages.sury.org"), use this repository for ubuntu:
    sudo add-apt-repository ppa:ondrej/php
    sudo add-apt-repository ppa:ondrej/apache2
    sudo apt update
    sudo apt upgrade
    Tastiger and ahrasis like this.
  5. Tastiger

    Tastiger Member HowtoForge Supporter

    Thanks all - that seemed pretty well painless, all good for now.
    Crossing fingers that it stays that way
  6. Tastiger

    Tastiger Member HowtoForge Supporter

    Oops almost forgot -
    Is this the correct format?

    PHP7.4 wget -O /dev/null "https://xxx-xxx.com/index.php?option=com_community&task=cron" > /dev/null
  7. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    if this is for an cron job created in the ispconfig interface, where you specify the php command, you need to provide the full path,
    so in your case it would start: /usr/bin/php7.4 wge………….
    Tastiger likes this.
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    Tastiger likes this.
  9. Tastiger

    Tastiger Member HowtoForge Supporter

    Actually I have the cron setup via webmin as I cannot get my head around the timing schedule in ISPconfig and I can't recall seeing anything about it in the manual.

    I have found that the following doesn't work
    /usr/bin/php7.4 wget --max-redirect=10000 "https://xxx-xxx.com.au/index.php?option=com_akeeba&view=Backup&key=gh-aCKjVcn4txsS23ScvWNy-sFvdWopf" -O - 1>/dev/null 2>/dev/null
    I think I will have to change the crons to run from ISPconfig, if someone can give me a visual representation of how to set up the schedule to run
    • Weekly on a Sunday @ 00:00 hrs
    • Every 10 minutes

    Last edited: May 25, 2020
  10. Steini86

    Steini86 Active Member

    You want to use "/usr/bin/wget ..."
    Either you use php to access the php file directly, or you use wget to access the web page.
    0 0 * * SUN
    Minutes: 0
    Hours: 0
    Day of Month: *
    Months: *
    Day of week: SUN
    */10 * * * *
    Minutes: */10
    Hours: *
    Day of Month: *
    Months: *
    Day of week: *
    Tastiger likes this.
  11. Tastiger

    Tastiger Member HowtoForge Supporter

    Just a note that using the letters for days is not allowed by ISPconfig - it seems it only accepts the options of 1 - 5 for Days of week

    I also noted after playing around a bit that Webmin doesn't seem to need the php version, the cron still runs, so looks as though it follows whatever version of php the site is, so it seems that part of the tutorial can be ignored for Ubuntu.

    Big thanks to everyone that has replied.
    Last edited: May 26, 2020
    ahrasis and Steini86 like this.

Share This Page