PHP Version 7.0.33-0+deb9u10

Greetings!

I deployed a LAMP stack using the marketplace app. This came with PHP7.0 I went ahead and updated it with 7.3 using the following

sudo apt update
sudo apt upgrade -y
sudo apt -y install lsb-release apt-transport-https ca-certificates
sudo wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/php7.3.list
sudo apt update
sudo apt -y install php7.3

Now when I go to the ip and check it still shows PHP Version 7.0.33-0+deb9u10

Do I need to make any further updates to reflect the 7.3 ini. Does this mean 7.3 is installed but not active? please help, I am just getting started with Linux

Thank you
SD

6 Replies

Did you restart php-fpm(8) and/or your web server?

-- sw

I have an Apache2 install on stretch and I have restarted stoped/started/restarted it.

SD

Do you use php-fpm(8) or the apache2(8) module?

If php-fpm(8), you need to restart that too.

If the apache2(8) module, you need to disable the 7.0 php module configuration and enable the 7.3 php module configuration. Something like this:

sudo a2dismod php7.0
sudo a2enmod php7.3

then restart apache2(8). Do ls /etc/apache2/*php* to get the exact names (I think those are correct). After you have php 7.3 enabled correctly, you can remove the packages for php 7.0:

sudo apt remove php7.0
sudo apt remove libphp7.0
sudo apt remove libapache2-mod-php7.0
sudo apt autoremove  

-- sw

This did it, Thank you very much!!!

Just as a point of information, you should really use php-fpm instead of the apache(8)-embedded mod_php* thing. It has two advantages:

  • you can use multi-threaded apache2(8) servers (finer-grained control over performance and resource-usage); and
  • no disabling/enabling of apache2(8) modules as you experienced here (you just start the new version of php-fpm(8)).

As to point #1, with the embedded libphpX solution, you are limited to the old (1980s) prefork model.

The Debian/Ubuntu apache2(8) server ships with demonstration configurations for how to do this (/etc/apache2/conf-available/php7.x-fpm.conf). It works well. You should check it out. You enable/disable it with

sudo a2{en|dis}conf php-7.x

-- sw

Thank you very much for this info, I will truths config.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct