I just upgraded my phpversion from php 7.1 to 7.3. Unfortunately I can’t seem to get mysql working.
I’m on a centos 7 box using yum package manager.
These are my installed php packages. I’ve rebooted and tried uninstalling, reinstalling the mysql extension and it still won’t show up in the phpinfo. The only mention of mysql is in the credits section.
php73.x86_64 2.0-1.el7.remi @remi-safe
php73-common.x86_64 7.3.28-1.el7.ius @ius
php73-json.x86_64 7.3.28-1.el7.ius @ius
php73-mbstring.x86_64 7.3.28-1.el7.ius @ius
php73-pdo.x86_64 7.3.28-1.el7.ius @ius
php73-pdo-dblib.x86_64 7.3.28-1.el7.ius @ius
php73-php-cli.x86_64 7.3.28-1.el7.remi @remi-safe
php73-php-common.x86_64 7.3.28-1.el7.remi @remi-safe
php73-php-json.x86_64 7.3.28-1.el7.remi @remi-safe
php73-php-mysqlnd.x86_64 7.3.28-1.el7.remi @remi-safe
php73-php-pdo.x86_64 7.3.28-1.el7.remi @remi-safe
php73-php-pear.noarch 1:1.10.12-7.el7.remi @remi-safe
php73-php-pecl-mcrypt.x86_64 1.0.4-1.el7.remi @remi-safe
php73-php-pecl-mysql.x86_64 1.0.0-0.20.20180226.647c933.el7.remi @remi-safe
php73-php-pecl-xdebug3.x86_64 3.0.4-1.el7.remi @remi-safe
php73-php-process.x86_64 7.3.28-1.el7.remi @remi-safe
php73-php-soap.x86_64 7.3.28-1.el7.remi @remi-safe
php73-php-xml.x86_64 7.3.28-1.el7.remi @remi-safe
php73-runtime.x86_64 2.0-1.el7.remi @remi-safe
2
Answers
If you are using php-fpm, you can use
php-fpm -i | grep php.ini
to find the loaded configuration file.If using php-cli,
php -i | grep php.ini
, and so on.Then add
extension=yourExtension.so
to php.ini, and restart your php-fpm, usingphp-fpm -m | grep yourExtension
to check if the extension is loaded, it means work if printed you extension name.If there’s not, then, you need to find the extension_dir of php :
php-fpm -i | grep extension_dir
, and check if there is yourExtension.so file, if there’s not, it means your extension installed to a wrong place, you need make a soft link or simply cp yourExtension.so to that place.If you’re using multi-version php, you need check which php you are using.
You are mixing 2 PHP stacks from 2 different providers, IUS and Remi.
You should only use one.
For remi repository, I recommend you follow the Wizard instructions
Notice: I don’t see any mod_php or fpm package in your list…
Never do this, with RPM, each package provides the proper configuration file for its extension(s). After installation you need to restart the httpd or php-fpm service.