How to properly install SQLSRV on multiple versions of PHP 7+ ?

iemand

New member
Joined
Feb 11, 2020
Messages
5
Hello,

I've read tons of articles, stackoverflow questions and posts on this forum already but haven't found a single solution that works.
I need to connect to a Microsoft SQL server using the sqlsrv extension: https://www.php.net/manual/en/book.sqlsrv.php to establisch a connection and run queries.

Downgrading PHP is not an option. Alternative methods can be used. At this point I just want it to work.

How do I install SQLSRV (or any other extension) to safely connect to a Microsoft SQL server?
 
Hi @zEitEr, thanks for the reply.
As far as I understand it PHP is integrated within directadmin and we use custombuilds to compile it all. Right?

pecl doesn't come with directadmin out-of-the-box as far as I know (pecl: command not found errors pop up all the time).

I use CentOS 7 and the latest version of directadmin.

I also tried to build --with-mssql and --with-sqlsrv but those sadly didn't result in anything.
 
Code:
# ls -1 /usr/local/php*/bin/pecl
/usr/local/php52/bin/pecl
/usr/local/php53/bin/pecl
/usr/local/php54/bin/pecl
/usr/local/php55/bin/pecl
/usr/local/php56/bin/pecl
/usr/local/php70/bin/pecl
/usr/local/php71/bin/pecl
/usr/local/php72/bin/pecl
/usr/local/php73/bin/pecl
/usr/local/php74/bin/pecl
 
1581502798787.png

This is the same error I ran in to before. I know its because the folder has the noexec flag but as a newby to Linux/CentOS I don't want to mess around without knowing If i'm doing the right thing.

Can I remove the noexec flag from the tmp/pear/temp folder? If so, how?
Or is there another way to install this successfully?

Thanks for the replies!
 
Alright so I got sqlsrv and pdo_sqlsrv installed but now run in to the following error:
1581581072194.png

I changed php_lda.dll to the .so extension in php.ini. Same error happens when it has the .dll extension.Do I need to manually install this?
Doesn't this come with directadmin itself?
 
I understand that. When i first opened the php.ini it had the .dll extension. I changed it to .so but it isn't available (see console log).
I now tried installing it through pecl and yum but php-idap doesn't exists. Would it be safe to remove that extension?
 
Back
Top