0

My CentOS7 server has a very old version of PHP installed (v7.2.10). I am trying to upgrade to PHP8 but am having some major issues. My server has PHP Version Switcher installed and when I try to have it install PHP8, I keep getting an error

I then tried to use yum to install PHP8. It seemed to install fine but php -v still returns 7.2.10. I ran yum list installed | grep php and it returned

cwp-suphp.x86_64                      0.7.2-3                        @cwp
cwpphp.x86_64                         7.2.30-3                       @cwp
php.x86_64                            8.0.30-6.el7.remi              @remi-php80
php-cli.x86_64                        8.0.30-6.el7.remi              @remi-php80
php-common.x86_64                     8.0.30-6.el7.remi              @remi-php80
php-pdo.x86_64                        8.0.30-6.el7.remi              @remi-php80
php-pgsql.x86_64                      8.0.30-6.el7.remi              @remi-php80
php-sodium.x86_64                     8.0.30-6.el7.remi              @remi-php80
php72-php-common.x86_64               7.2.34-10.el7.remi             @remi-safe
php72-php-json.x86_64                 7.2.34-10.el7.remi             @remi-safe
php72-php-pdo.x86_64                  7.2.34-10.el7.remi             @remi-safe
php72-php-pgsql.x86_64                7.2.34-10.el7.remi             @remi-safe
php72-runtime.x86_64                  2.0-1.el7.remi                 @remi-safe

Also, running rpm -q --filesbypkg php72-php-pdo-7.2.34-10.el7.remi.x86_64 and rpm -q --filesbypkg php-pdo-8.0.30-6.el7.remi.x86_64 returns

php72-php-pdo             /etc/opt/remi/php72/php.d/20-pdo.ini
php72-php-pdo             /etc/opt/remi/php72/php.d/20-sqlite3.ini
php72-php-pdo             /etc/opt/remi/php72/php.d/30-pdo_sqlite.ini
php72-php-pdo             /opt/remi/php72/root/usr/lib64/php/modules/pdo.so
php72-php-pdo             /opt/remi/php72/root/usr/lib64/php/modules/pdo_sqlite.so
php72-php-pdo             /opt/remi/php72/root/usr/lib64/php/modules/sqlite3.so

php-pdo                   /etc/php-zts.d/20-pdo.ini
php-pdo                   /etc/php-zts.d/20-sqlite3.ini
php-pdo                   /etc/php-zts.d/30-pdo_sqlite.ini
php-pdo                   /etc/php.d/20-pdo.ini
php-pdo                   /etc/php.d/20-sqlite3.ini
php-pdo                   /etc/php.d/30-pdo_sqlite.ini
php-pdo                   /usr/lib64/php-zts/modules/pdo.so
php-pdo                   /usr/lib64/php-zts/modules/pdo_sqlite.so
php-pdo                   /usr/lib64/php-zts/modules/sqlite3.so
php-pdo                   /usr/lib64/php/modules/pdo.so
php-pdo                   /usr/lib64/php/modules/pdo_sqlite.so
php-pdo                   /usr/lib64/php/modules/sqlite3.so

Running systemctl status cwp-phpfpm.service returns

● cwp-phpfpm.service - The PHP FastCGI Process Manager
   Loaded: loaded (/usr/lib/systemd/system/cwp-phpfpm.service; enabled; vendor preset: disabled)
   Active: active (running) since Fri 2024-12-20 03:51:16 EST; 1 months 16 days ago
 Main PID: 12524 (php-fpm)
   CGroup: /system.slice/cwp-phpfpm.service
           └─12524 php-fpm: master process (/usr/local/cwp/php71/etc/php-fpm.conf)

So it looks like PHP 7.2 and 8.0 are both installed. How do I have CentOS use PHP8 instead of PHP7.2?

1 Answer 1

2

CentOS 7 has reached its end of life in June

Please read: https://blog.centos.org/2023/04/end-dates-are-coming-for-centos-stream-8-and-centos-linux-7/

For your problem, you have multiple versions installed, so read the remi repository FAQ

But you are using cwp-phpfpm so none of the php* or php72* packages are used.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.