Install php7.2 Debian 10

Discussion in 'General' started by HenrysCat, Sep 24, 2019.

  1. HenrysCat

    HenrysCat New Member

    I need php7.2 for a phpbb board, as I get this error
    Code:
    You are running an unsupported PHP version. Please upgrade to PHP equal to or greater than 5.4.7 but less than 7.3-dev in order to install or update to phpBB 3.2
    I found this, https://www.howtoforge.com/tutorial/how-to-install-php-7-on-debian/
    But I am on Debian 10, will it still work?
     
    Last edited: Sep 24, 2019
  2. Jesse Norell

    Jesse Norell Well-Known Member

  3. HenrysCat

    HenrysCat New Member

  4. ahrasis

    ahrasis Well-Known Member

    Nowadays it could be very hard to keep up on each and every php security update which occurs every now and then via compiling it, so using sury repository is the best for most of debian or ubuntu or its derivative users.

    However, as always, that is a matter of each user's preference, so your choice could be the best for you. ;)
     
  5. elmacus

    elmacus Member HowtoForge Supporter

    Well, compiling yourself on many servers takes ages.
    The compiler is bugged if you also want 5.6 and 7.0.
    I tried that, and jumped to sury.org. it's not a mess.
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    I would do what @Jesse Norell recommended, the installation on Debian 10 is basically the same than on Debian 8 and 9. I would not compile PHP anymore myself, I use the sury repo on my Debian servers.
     
  7. HenrysCat

    HenrysCat New Member

    I agree about compiling, but on the sury guide there are so many comments with people having problems and suggestions of changes to the guide it put me off, when I ran the SergiX44 script from github it just worked first time.
    I have yet to do this on my production VPS (only on a Hyper-V test server) If there is a sure way to do it properly I will.
     
  8. elmacus

    elmacus Member HowtoForge Supporter

    You cant do uninstall easy with apt if selfcompiled, only manual.
    Oh, and it WILL break when updating Debian to new version, "been there, done that". So you must selfcomplie again, if possible, which it was not with 5.6 and 7.0.
    Sury.org updated 5.6, 7.0, 7.1, 7.2 and 7.3 perfectly when i did Debian 9 to Debian 10.
    You have been warned. Good Luck anyway.
     
    HenrysCat likes this.
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    Btw. The tutorial to install PHP from sury is fine, used it on different servers, don't trust comments under tutorials, especially when ISPConfig core devs and well-known community members tell you to use it ;)

    As @elmacus pointed out, you will have to compile PHP again now for each update.
     
    HenrysCat and elmacus like this.
  10. HenrysCat

    HenrysCat New Member

    OK that got my attention :) so I restored my original hyper-V install before updating php and followed the sury guide, all seemed to go well untill I tried to install phpbb, it would not see the database (checked db passwords etc) looking around the phpbb forum someone suggested running this command with no explanation as to why.
    apt-get install php7.2-mysql
    I wanted 7.2 as thats the latest supportd by phpbb, so I ran it and it worked, can anyone shed any light as to what happened?
    Oh and thanks all btw ;)
     
  11. till

    till Super Moderator Staff Member ISPConfig Developer

    You have to install the PHP modules that you want to use of course for the PHP versions that you install. Check the software requirements of the software that you want to use and install all required PHP modules for that software.
     
    HenrysCat likes this.
  12. HenrysCat

    HenrysCat New Member

    I see, thank you.
     
  13. elmacus

    elmacus Member HowtoForge Supporter

    I just install all PHP-modules from guide, works for me and our custumers:
    https://www.howtoforge.com/perfect-server-debian-10-buster-apache-bind-dovecot-ispconfig-3-1/
    Just replace with correct php- version like:

    # install php 7.2
    apt install php7.2 php7.2-common php7.2-gd php7.2-mysql php7.2-imap php7.2-cli php7.2-cgi php7.2-curl php7.2-intl php7.2-pspell php7.2-recode php7.2-sqlite3 php7.2-tidy php7.2-xmlrpc php7.2-xsl php7.2-zip php7.2-mbstring php7.2-soap php7.2-fpm php7.2-opcache

    a2enconf php7.2-fpm
    systemctl reload apache2

    Optional, do this first:
    #delete old selfcompile php 7.2
    systemctl stop php72-fpm.service
    systemctl disable php72-fpm.service
    insserv -r php72-fpm
    rm /etc/init.d/php72-fpm
    rm /lib/systemd/system/php72-fpm.service
    rm /usr/bin/php72
    rm -rf /opt/php72
     
    HenrysCat and ahrasis like this.
  14. HenrysCat

    HenrysCat New Member

    Excellent stuff, think I'm ready to try on the VPS now, don't worry I'll take a snapshot first :)
     
    till likes this.

Share This Page