Source: http://www.study-code.com/php-delphi/php/70546.htm
Recently, someone asked me if I want to use PHP to connect to the SQL Server database during php development. I told them that mssql_connect ($ host, $ username, $ password) can be used for connection.
In fact, you can find this function once you search the Internet. Many of them use it. However, my friend reported that the system does not define mssql_connect (), which is strange. I have always used it. I suspect that his PHP version is too low to support it, he told me php5.14. This version does not have a problem.
Where is the problem? I tried a variety of methods later and couldn't solve it.
Later, I suddenly remembered that PHP's functions were all configured by PHP. ini. Will it fail to enable SQL server support? At first glance, no.
Solution:
1. Find PHP. ini in the directory of apache2 and open it.
2. Find "; Extension = php_mssql.dll", remove the previous ";", and save
3. Restart the apache service (Be sure to restart it. Many of them often forget it, but do not know why)
Use mssql_connect () to connect to SQL Server.