Question

How to Upgrade php from 7.3 to 7.4?

Posted September 3, 2020 3.4k views
PHPWordPressOpenLiteSpeed WordPress 1-ClickUbuntu 20.04

I am using OpenLiteSpeed 1 click WordPress on Ubuntu 20.04
My droplets, 2gb CPU 2gb RAM

How to do this upgrade?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
Submit an Answer
2 answers

you can try :

apt update

apt-get -y install lsphp74 lsphp74-common lsphp74-curl lsphp74-dev lsphp74-imap lsphp74-intl lsphp74-json lsphp74-ldap lsphp74-mysql lsphp74-opcache lsphp74-pspell lsphp74-sqlite3 lsphp74-tidy

after that , edit file /usr/local/lsws/conf/httpd_config.conf , find line lsphp73/bin/lsphp and change it to lsphp74/bin/lsphp

restart OLS and PHP by systemctl restart lsws and pkill lsphp

  • Thank you for sharing it. Could you please let me know how to update it to PHP 8 on Open Lite Speed - Ubuntu 20.04 LTS

    • it should be same procure , just change the lsphp74 in above to lsphp80

      • I am getting this error message when I tried to do that for PHP 8

        Reading package lists… Done
        Building dependency tree

        Reading state information… Done
        E: Unable to locate package lsphp80-json
        E: Unable to locate package lsphp80-imagick
        E: Unable to locate package php8.0-imagick
        E: Couldn’t find any package by glob ‘php8.0-imagick’

        • that’s probably because these extension was no yet complied , or being compiled directly into PHP binary

          you can check with phpinfo page, see if these extension are there or not

  • In httpd_config.conf I cannot find the line you have referenced. Searching that file for lsphp all I can find are these:

    extprocessor lsphp {
      type                    lsapi
      address                 uds://tmp/lshttpd/lsphp.sock
      maxConns                100
      env                     PHP_LSAPI_CHILDREN=100
      initTimeout             60
      retryTimeout            0
      persistConn             1
      respBuffer              0
      autoStart               1
      path                    $SERVER_ROOT/fcgi-bin/lsphpnew
      backlog                 100
      instances               1
      priority                0
      memSoftLimit            2047M
      memHardLimit            2047M
      procSoftLimit           400
      procHardLimit           500
    }
    
    scripthandler  {
      add                     lsapi:lsphp php
    }
    

    I am on PHP 7.2 and want to upgrade to 7.4 – the install step worked fine but it appears the version must be configured elsewhere?

It Works!

Thank you very much