Home  >  Article  >  Backend Development  >  mssql php connection mysql connection is reset solution

mssql php connection mysql connection is reset solution

WBOY
WBOYOriginal
2016-07-29 08:44:241228browse

After installing a new Windows 7 64-bit system, I configured a lot of things, and I always had this and that feeling. Yesterday when I started configuring php+apache, echo phpinfo() was completely fine, but once I connected to mysql, it would not work. Presents the problem of the page being reset. It turned out that the problem was not big, but I came to misunderstandings:
 1. I suspected a problem with the 64-bit system;
 2. I felt that the code was unreliable, because it can be executed in other places, and it can be shown if I write substr() rashly
 . .....
 This problem has been bothering me for more than a day, but I still haven't solved it. In desperation, I used "php connection mysql connection reset" as the keyword to search, and a lot of sporadic information appeared, 1 After searching one by one, someone finally mentioned that it was due to the reference problem of libmysql.dll. I read it with great excitement and followed it. Maybe I was even willing to restart my computer because I was afraid that the cache there would be wasted. It was finally solved later. ----------This incident made me realize the importance of misunderstandings. I post the solutions here, hoping that people who encounter them can use them.
 Try to copy libmysql into windows/system32 and copy libmysql.dll into apache/bin.
 Of course, the easiest way is:
 In apache:
 LoadFile D:/PHP/php5.2.13/libmysql.dll
 With only the above line, mysql can be successfully called.
  My server version: win7
 apache 2.2.13
 php 5.2.13
 mysql5.1.37
 phpmyadmin3.3.2
 The following is the department configuration of my apache.
PHPIniDir D:/PHP/php5.2.13 #Not required
LoadFile D:/PHP/php5.2.13/php5ts.dll
LoadFile D:/PHP/php5.2.13/libmysql.dll
LoadModule php5_module D:/PHP/php5 .2.13/php5apache2_2.dll
 AddType application/x-httpd-php .php

The above introduces the solution to the mssql php connection mysql connection being reset, including mssql content. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn