I have php7.2 installed(from remi repository) in CentOS 7.5. I want to access mysqli from command line php. When trying, it shows the error:
Call to undefined function mysqli_connect()
The php running with apache works fine with mysqli. All extensions installed through yum reflects perfectly here. But for the php command line(which is parsing a different php.ini file), the extensions are not loaded.
Do I need to separately add the extensions for commandline php? If so how? Or any other alternative? Please let e know if you need any further information.
Thank you for your time.
Best Answer
As pointed out by Michael Hampton (thanks) in the comment, there were two php installations in the server. I have arrived at two different solutions based on specific need:
Thats all
php -modules
in the terminal gives the desired output with mysqli.