Link to home
Create AccountLog in
Avatar of Marthaj
MarthajFlag for United States of America

asked on

Php-Pear keeps installing wrong PHP config files

I am trying to install sqlsrv drivers on a Ubuntu 20.04 server. 

I am using PHP 7.4 .

I was following the instructions from this link:

https://www.youtube.com/watch?v=tnC_uOahq7U

Open in new window

Everything was fine until it came to this command:

sudo apt install php-pear

Open in new window

It keeps creating config files for php 8.2 instead of php 7.4.

Here's an example:

Creating config file /etc/php/8.2/mods-available/phar.ini with new version

Open in new window

How do I fix this ??

Thank you.


Avatar of gr8gonzo
gr8gonzo
Flag of United States of America image

Did you use apt to install php 7.4 ?

Avatar of Marthaj

ASKER

yes.
ASKER CERTIFIED SOLUTION
Avatar of gr8gonzo
gr8gonzo
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of Marthaj

ASKER

gr8gonozo - Thank you so much. Your suggestion worked but my phpinfo page does not show them enabled. It shows pdo_sqlsrv.so and sqlsrv.so as being in the usr/lib/php/20190902 folder.
By looking at my phpinfo page, I found  the location of the php.ini and added the extensions of:

extension=/usr/lib/php/20190902/pdo_sqlsrv.so 
extension=/usr/lib/php/20190902/sqlsrv.so

Open in new window

Did you restart your server?

Avatar of Marthaj

ASKER

gr8gonzo - my internet keeps flopping on me and cut me off. I also added the extension pdo.so before the other two, stop and started apache and viola! the phpinfo page shows that they are enabled! Thank you for all your help.