-
Notifications
You must be signed in to change notification settings - Fork 375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PHP Warning: PHP Startup: Unable to load dynamic library 'sqlsrv.so' & 'pdo_sqlsrv.so' #1145
Comments
@conandrum you're using multiple php versions, and which php version do you want? If you want php 7.4 only, please uninstall the others and follow the online instructions If you want to keep more than one php version, please check how to switch between multiple php versions in Ubuntu This related issue #1142 might give you some ideas, or please check this WIKI entry |
This is a development server, multiple PHP versions are required to test various software. I want all versions. My issue has to do with the linkage of the plugins sqlsrv.so & pdo_sqlsrv.so. |
Thanks for your link... I am reading it. |
Hi Yitam,
|
Yes @conandrum the key is to use
Also, with For details please follow the online instructions |
@yitam what would you suggest I do to remedy the situation now? |
@conandrum I suppose you don't have to uninstall the php versions, and you probably have php 7.2 set up already. Make sure you use If it works for php 7.4 then you can try 7.3 etc. Whenever you switch php version from one to another, just use |
@yitam I just started with the mods you suggested. I started with this:
This is the weird part.
Shouldn't it pick up the right folder for php7.4 automatically? |
@yitam I did one more test. I run Success with paths showing 20190902:
I will continue and report back |
@yitam After completing all the steps below specific to 7.4, I can confirm that no errors are being reported when running php -v
|
@yitam Then I went on to install the plugins onto 7.3 & 7.2
If I then just try to install with:
If I uninstall first using:
then all goes well, but the previous 7.4 installation is now broken. How do I install this on multiple php versions? Do I just manually copy the files from their location to /usr/lib/php/xxxxxxxx ??? |
@conandrum did you do Have you read the FAQ entry I sent you earlier on using pecl or php-config? Before you install make sure you're using the right php version. You also need php7.3-dev and php7.2-dev too |
@yitam Have you read the FAQ entry I sent you earlier on using pecl or php-config? Before you install make sure you're using the right php version. You also need php7.3-dev and php7.2-dev too This is the problem:
The driver does not understand that I need the 7.3 version ON TOP of the 7.4 already installed !!!!! |
Hi @conandrum In addition to using update-alternatives, I realized that you need to do the following too:
Note that I did a quick test myself and was able to install sqlsrv with all php versions: Using update-alternatives is the key to switch between php versions. |
HI @yitam, that's excellent news. |
and yes it works my friend. Thank you. Here is the full sqlsrv & pdo_sqlsrv install script for multiple php versions.
|
That's great, @conandrum . I will link your above script to the FAQ entry and close this issue. Please feel free to reopen if necessary. |
One more question. How do I go about updating my multiple versions properly? |
hi @conandrum , to upgrade ODBC driver and tools in Ubuntu please follow the instructions |
This is Ubuntu 18.04 |
My bad. I've modified the comment above. |
So basically I run everything in the above script until line #18 (up to and including 'sudo apt-get install unixodbc-dev')
The rest of the script from line #19 down is not required to be run again for each version of PHP? |
It depends, @conandrum . If you want the latest updates for each PHP version then please update only the PHP packages. If you do not purge the packages, technically you should not need to pecl install sqlsrv or pdo_sqlsrv drivers again. The last stable release 5.8.1 for sqlsrv drivers should work with the latest PHP versions. If you prefer a clean start, then you might do the following steps (I picked 7.3 as an example):
|
As an example, my PHP 7.3 contains the following relevant packages pdo_sqlsrv & sqlsrv (among others) The pdo_sqlsrv & sqlsrv modules are developed by Microsoft here https://github.com/Microsoft/msphpsql/releases/tag/v5.8.0 under your supervision. So to ensure pdo_sqlsrv & sqlsrv remain up to date what commands should I run? |
@conandrum you can check the system requirements page and watch this msphpsql repo for releases only. Alternatively, you may want to check the PHP updates on the Microsoft Tech community blog. Hope this helps! |
hello, yitam, I wanna close this message, PHP Warning: PHP Startup: Unable to load dynamic library 'sqlsrv.so' (tried: /usr/lib/php/20180731/sqlsrv.so (/usr/lib/php/20180731/sqlsrv.so: cannot open shared object file: No such file or directory), /usr/lib/php/20180731/sqlsrv.so.so (/usr/lib/php/20180731/sqlsrv.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 As you can see, I input command "php-cli" At first I wanna install ms-sql. So I had done several step on several article. |
Hi @GlistenSTAR You should be able to use phpdismod For example,
|
Wonderful, you are perfect on this area. |
Hi Yitam,
Just upgraded to Ubuntu 20.04.
In /etc/apt/sources.list.d I have 2 files related to mssql.
mssql-release.list
# deb [arch=amd64] https://packages.microsoft.com/ubuntu/18.04/prod bionic main
and
mssql-release.list.distUpgrade
deb [arch=amd64] https://packages.microsoft.com/ubuntu/18.04/prod bionic main
From what I can understand, the mssql-release.list.distUpgrade file is just
a backup of what was active when 18.04 was installed.
Therefore, the file in effect atm is mssql-release.list. As you can see the
contents are commented out.
What should I do in this case?
Should I replace the commented line with the following?
deb [arch=amd64] https://packages.microsoft.com/ubuntu/20.04/prod focal main
Should I check anything else on my system that may have broken during the
upgrade?
…On Fri, Oct 23, 2020 at 4:55 AM Jenny Tam ***@***.***> wrote:
@conandrum <https://github.com/conandrum> you can check the system
requirements page
<https://docs.microsoft.com/sql/connect/php/system-requirements-for-the-php-sql-driver?view=sql-server-ver15#odbc-driver>
and watch this msphpsql repo for releases only.
Alternatively, you may want to check the PHP updates on the Microsoft
Tech community blog
<https://techcommunity.microsoft.com/t5/tag/Php/tg-p/board-id/SQLServer>.
Hope this helps!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1145 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AMAOIHMVPSSTKIOMNORFRTLSMDPATANCNFSM4OFHENRA>
.
|
Hi @conandrum, ODBC driver might still work. A quick way to check using
You may also run some quick tests with your php apps. If in doubt, you can uninstall ( |
Hey Yitam. I was asking specifically what I should do with the contents of the file mssql-release.list. |
You don't have to do anything if your ODBC driver is already working. If you like, you can simply replace it with the one for Ubuntu 20.04 as shown in the aforementioned ODBC online instructions |
I have same issue and asked question on stackoverflow with all the details but this solution work for me. Thanks |
Hi,
I wanted to be able to access SQL Server from Ubuntu 18.04, so I followed this procedure:
I got only warnings with sudo pecl install pdo_sqlsrv & pdo_sqlsrv :
I did not try to rectify the above notices....
No errors were reported, so I thought all was ok, until I ran 'php -v' which gives me:
I have checked '/usr/lib/php/20190902/' which indeed does not contain these files.
They are actually in '/usr/lib/php/20170718/'
What did I do wrong in the installation? How do I fix this?
Thanks for your help people.
The text was updated successfully, but these errors were encountered: