Install SqlSrv in multi PHP

Stefano

New member
Joined
Mar 24, 2022
Messages
2
hello I installed DirectAdmin for the first time and I wanted to test it with my applications, where I have site with php7.4 and php8.0, I have installed everything now but if I install the SQLSRV module it is put on default (7.4), usually just do it from /usr/local/php80 but it does not install, and since the paths are different from the standard, how can I "switch" to php8 on the shell?
if I check the php7.4 have the sql module...
 
ok resolved... I must install direct
/usr/local/php80/bin/pecl install sqlsrv
and afert add
echo "extension=sqlsrv.so" > /usr/local/php80/lib/php.ini


for all version....
 
Hi, can you tell me how were you able to install sqlsrv on php 7.4?
When I try to install I get the following problem.

[root@lin7 custom]# /usr/local/php73/bin/pecl install pdo_sqlsrv
No releases available for package "pecl.php.net/pdo_sqlsrv"
install failed
 
That is not the line Stefano used. He didn't use pdo_sqlsrv.

Try this way:
/usr/local/php73/bin/pecl install sqlsrv
Thanks Richard,
however I get the same error on that pack as well.

[root@lin7 ~]# /usr/local/php73/bin/pecl install sqlsrv
No releases available for package "pecl.php.net/sqlsrv"
install failed
[root@lin7 ~]#
 
To everyone out here that will encouter this in the future, the following did the trick to enable SQLSRV in all the PHP versions on our DA installation.

yum install unixODBC-devel
cd /usr/local/directadmin/scripts/custom
wget https://raw.githubusercontent.com/poralix/directadmin-utils/master/php/php-extension.sh -O php-extension.sh
chmod 750 php-extension.sh
./php-extension.sh install sqlsrv
./php-extension.sh install pdo_sqlsrv
 
Back
Top