[SOLVED] CentOS 7, PHP 7.1, undefined function sqlsrv_connect()
CentOSThis forum is for the discussion of CentOS Linux. Note: This forum does not have any official participation.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
CentOS 7, PHP 7.1, undefined function sqlsrv_connect()
Hello friends! I'm relatively new and still have a lot to learn about Linux in general. I've done a ton of research on this problem, and can't seem to find a clear-cut solution (other than advising to run on a Windows machine, which is not an option).
I have a php script that is trying to establish a connection to a database using sqlsrv_connect(). I am on CentOS 7, using PHP 7.1, with no luck. The exact issue I get when executing my php file in question is as follows:
PHP Fatal error: Uncaught Error: Call to undefined function sqlsrv_connect() in /var/www/html/gocare/DBTest.php:8
After some online research, I looked up the location of mysqli.so and mysql.so and added the following to my php.ini configuration file.
Now I get the same error as before, but with a few extras when executing the DBTest.php. I've confirmed these files exist at these locations, and have no idea why I'm getting these errors. I've done "systemctl restart httpd" to restart httpd.
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/perl5/vendor_perl/auto/DBD/mysql/mysqli.so' - /usr/lib64/perl5/vendor_perl/auto/DBD/mysql/mysqli.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/mysql.so' - /usr/lib64/php/modules/mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Fatal error: Uncaught Error: Call to undefined function sqlsrv_connect() in /var/www/html/gocare/DBTest.php:8
Stack trace:
#0 {main}
thrown in /var/www/html/gocare/DBTest.php on line 8
Any advice that can be given would be greatly appreciated, I think I might be in a little over my head here!
I have a php script that is trying to establish a connection to a database using sqlsrv_connect(). I am on CentOS 7, using PHP 7.1, with no luck. The exact issue I get when executing my php file in question is as follows:
PHP Fatal error: Uncaught Error: Call to undefined function sqlsrv_connect() in /var/www/html/gocare/DBTest.php:8
After some online research, I looked up the location of mysqli.so and mysql.so and added the following to my php.ini configuration file.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.