php sqlsrv extension

Hi everyone.

Does anybody know why I am getting this error and how to solve it when running "pecl install sqlsrv":

/bin/sh /var/tmp/pear-build-rootQ3We6Z/sqlsrv-5.1.2preview/libtool --mode=compile g++ -std=c++11 -I. -I/var/tmp/sqlsrv -DPHP_ATOM_INC -I/var/tmp/pear-build-rootQ3We6Z/sqlsrv-5.1.2preview/include -I/var/tmp/pear-build-rootQ3We6Z/sqlsrv-5.1.2preview/main -I/var/tmp/sqlsrv -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/var/tmp/sqlsrv/shared/  -DHAVE_CONFIG_H  -std=c++11 -D_FORTIFY_SOURCE=2 -O2 -fstack-protector   -c /var/tmp/sqlsrv/conn.cpp -o conn.lo
libtool: compile:  g++ -std=c++11 -I. -I/var/tmp/sqlsrv -DPHP_ATOM_INC -I/var/tmp/pear-build-rootQ3We6Z/sqlsrv-5.1.2preview/include -I/var/tmp/pear-build-rootQ3We6Z/sqlsrv-5.1.2preview/main -I/var/tmp/sqlsrv -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/var/tmp/sqlsrv/shared/ -DHAVE_CONFIG_H -std=c++11 -D_FORTIFY_SOURCE=2 -O2 -fstack-protector -c /var/tmp/sqlsrv/conn.cpp  -fPIC -DPIC -o .libs/conn.o
In file included from /usr/include/php/Zend/zend_types.h:27:0,
                 from /usr/include/php/Zend/zend.h:29,
                 from /usr/include/php/main/php.h:35,
                 from /var/tmp/sqlsrv/shared/core_sqlsrv.h:34,
                 from /var/tmp/sqlsrv/php_sqlsrv.h:25,
                 from /var/tmp/sqlsrv/conn.cpp:20:
/usr/include/php/Zend/zend_operators.h: In function 'void fast_long_increment_function(zval*)':
/usr/include/php/Zend/zend_operators.h:446:68: error: '__builtin_saddl_overflow' was not declared in this scope
  if (UNEXPECTED(__builtin_saddl_overflow(Z_LVAL_P(op1), 1, &lresult))) {
                                                                    ^
/usr/include/php/Zend/zend_portability.h:312:52: note: in definition of macro 'UNEXPECTED'
 # define UNEXPECTED(condition) __builtin_expect(!!(condition), 0)
                                                    ^
/usr/include/php/Zend/zend_operators.h: In function 'void fast_long_decrement_function(zval*)':
/usr/include/php/Zend/zend_operators.h:500:68: error: '__builtin_ssubl_overflow' was not declared in this scope
  if (UNEXPECTED(__builtin_ssubl_overflow(Z_LVAL_P(op1), 1, &lresult))) {
                                                                    ^
/usr/include/php/Zend/zend_portability.h:312:52: note: in definition of macro 'UNEXPECTED'
 # define UNEXPECTED(condition) __builtin_expect(!!(condition), 0)
                                                    ^
/usr/include/php/Zend/zend_operators.h: In function 'void fast_long_add_function(zval*, zval*, zval*)':
/usr/include/php/Zend/zend_operators.h:554:80: error: '__builtin_saddl_overflow' was not declared in this scope
  if (UNEXPECTED(__builtin_saddl_overflow(Z_LVAL_P(op1), Z_LVAL_P(op2), &lresult))) {
                                                                                ^
/usr/include/php/Zend/zend_portability.h:312:52: note: in definition of macro 'UNEXPECTED'
 # define UNEXPECTED(condition) __builtin_expect(!!(condition), 0)
                                                    ^
/usr/include/php/Zend/zend_operators.h: In function 'void fast_long_sub_function(zval*, zval*, zval*)':
/usr/include/php/Zend/zend_operators.h:657:80: error: '__builtin_ssubl_overflow' was not declared in this scope
  if (UNEXPECTED(__builtin_ssubl_overflow(Z_LVAL_P(op1), Z_LVAL_P(op2), &lresult))) {
                                                                                ^
/usr/include/php/Zend/zend_portability.h:312:52: note: in definition of macro 'UNEXPECTED'
 # define UNEXPECTED(condition) __builtin_expect(!!(condition), 0)
                                                    ^
make: *** [conn.lo] Error 1
ERROR: `make' failed

Open in new window

LVL 6
Ludwig DiehlSystems ArchitectAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dave BaldwinFixer of ProblemsCommented:
This page https://github.com/Microsoft/msphpsql links to the downloads and installation instructions for the 'sqlsrv' extension.
0
David FavorLinux/LXD/WordPress/Hosting SavantCommented:
My guess, reading the link Dave posted, is you're trying to install sqlsrv on a pre-PHP-7.0 server, so PHP-5.6 or below.

Based on the project's docs, you must be using PHP-7.0 or above.

Check your PHP version first. You can do this via phpinfo() call or php --version on the command line.
0
Ludwig DiehlSystems ArchitectAuthor Commented:
I am using php 7.2. remi repos
0
IT Pros Agree: AI and Machine Learning Key

We’d all like to think our company’s data is well protected, but when you ask IT professionals they admit the data probably is not as safe as it could be.

Ludwig DiehlSystems ArchitectAuthor Commented:
Btw I did follow the instructions from ms
0
Ludwig DiehlSystems ArchitectAuthor Commented:
I am using Centos 7 so I followed exactly this: https://www.microsoft.com/en-us/sql-server/developer-get-started/php/rhel/
0
Yoshiaki IinumaCommented:
I had the same problem. "pecl install sqlsrv" did not work. But "yum install php-sqlsrv" did.  It installed sqlsrv and pdo_sqlsrv.
2

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Ludwig DiehlSystems ArchitectAuthor Commented:
Yes. I also did that. It is weird...
0
NerdsOfTechTechnology ScientistCommented:
If that worked for you, I urge the author to give Yoshiaki Linuma the 'best solution' and full points, so that others can benefit from the answer.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.