Question

Web server using different PHP then terminal?

When using SSH into my server php -v returns

PHP 8.0.12 (cli) (built: Oct 22 2021 12:34:00) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.12, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.12, Copyright (c), by Zend Technologies

which makes sense, I just updated it. However a PHP file with

<?
phpinfo();
?>

return PHP Version 7.0.33-55+ubuntu18.04.1+deb.sury.org+1

What is going wrong here? I’ve been spending about 40 minutes trying to install Curl and seeing php -m has curl and it not being enabled and then found this out, so this might be the underlying issue.


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

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.

I followed this steps but for my PHP version https://serverfault.com/a/939030

sudo a2dismod php7.2 
sudo a2enmod php8.0

Apache would not start at this point, and there was no syntax errors or anything like that so I decided to follow this link and reinstall apache2

https://askubuntu.com/a/1294488

This comment has been deleted