1

I have installed PHP 7.4 (from remi) on CentOS 8 since I need that version on CLI.

The issue is with extensions, when I check modules (php -m) as root user I for example have redis enabled there, but if I check the same thing with any other user it's missing.

I noticed that root user getting PHP stuff from /etc, but all other users are getting them from /usr/local/php.

I'm using some git hooks on that server, and all stuff I'm running there (composer, drush...) are run from cli as exact user (no root user).

How I can enable extensions for other users that don't have root privileges?

UPDATE

php -v with root user:

PHP 7.4.15 (cli) (built: Feb  2 2021 14:19:57) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.15, Copyright (c), by Zend Technologies

php -v with any other user:

PHP 7.4.15 (cli) (built: Feb 28 2021 20:54:08) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
8
  • 2
    Clean /usr/local of a previous installation from sources. – Remi Collet Mar 2 at 13:09
  • Are you sure that when executing php as a regular user you're actually executing the exact same php version the root user executes? – Bogdan Stoica Mar 2 at 13:09
  • @RemiCollet how I can do that and how it will help? – mixerowsky Mar 2 at 13:13
  • 2
    check "which php", and delete found executable in /usr/local – Remi Collet Mar 2 at 13:18
  • 1
    Cache issue, logout / logon again – Remi Collet Mar 2 at 13:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.