In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
Editor to share with you how php connects to the sql_server database. I hope you will get something after reading this article. Let's discuss it together.
1. Compile and install FreeTDS
Download the latest version of ftp://ftp.freetds.org/pub/freetds/stable/freetds-patched.tar.gz from the official website
# wget ftp://ftp.freetds.org/pub/freetds/stable/freetds-patched.tar.gz
# tar-zxvf freetds-patched.tar.gz
# cd freetds-0.95.95
#. / configure-prefix=/usr/local/freetds-with-tdsver=7.3-enable-msdblib
# make & & make install
# echo "/ usr/local/freetds/lib/" > / etc/ld.so.conf.d/freetds.conf
Verify:
Link database verification:
# / usr/local/freetds/bin/tsql-H "ip"-p 1433-U "sa"-P "123456"
two。 Add pdo_dblib for PHP extensions mssql and pdo
# cd php-5.4.26/ext/mssql/
# / usr/local/php/bin/phpize
#. / configure-with-php-config=/usr/local/php/bin/php-config-with-mssql=/usr/local/freetds/
# make & & make install
# cd php-5.4.26/ext/mssql/pdo_dblib/
# / usr/local/php/bin/phpize
#. / configure-with-php-config=/usr/local/php/bin/php-config-with-pdo-dblib=/usr/local/freetds/
# make & & make install
3. Add the configuration to the php.ini configuration file
Extension = "mssql.so"
Extension = "pdo_dblib.so"
4. Verify (file saved as sql.php):
Execute the program # php sql.php
Php can be connected to sqlserver by personal test.
After reading this article, I believe you have a certain understanding of "how php connects to sql_server database". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.