PHP5.3은 MySQL5.1 IIS7 Times Out과 함께 작동하지 않습니다
문제
Window 7에서 PHP5.3, MySQL5.1 및 IIS7을 설정했지만 PHP는 MySQL과 함께 작업하고 싶지 않습니다. 나는 그것이 구성 오류 또는 불완전한 설치라고 가정합니다.
- MySQL5.1이 작동합니다
- php5.3이 작동하고, phpinfo ()가 정보를 보여주고 mysql을 활성화했습니다.
- IIS는 PHP를 실행하기 위해 FastCGimodule을 설정하고 사용하고 있습니다
- IIS는 php.ini 업데이트를 등록합니다
- 포트 3306은 방화벽이 없으며 세계에 개방되어 있습니다.
- php.ini는 올바르게 구성됩니다
- Windows Systems 경로에 C : PHP를 추가했습니다.
과거에 나는 파일을 System32로 옮기는 것을 기억하지만, 드라이버가 지금 내장되어 있기 때문에 php5.3.1과 함께 보이지는 않습니다. http://us3.php.net/manual/en/mysqlnd.install.php.
(이것은 내 블로그에서 내 발견을 문서화하고있는 많은 문제를주고 있습니다. http://inteldesigner.com/2010/code/having-problems-getting-php5-3-to-work-with-mysql5-1 )
필요:
- PHP를 수동으로 설치해야합니다. Quick Installer 또는 이전 버전을 사용하고 싶지 않습니다.
- MySQL5.1과 함께 작업하려면 Php5.3을 가져와야하므로 WordPress2.9 및 Drupal7a를 설치할 수 있습니다.
모든 링크 나 제안은 훌륭 할 것입니다. 이미 IIS 웹 사이트에서 모든 것을 수행했지만 아무것도 작동하지 않습니다. 나는 그들이 새로운 소프트웨어에 대해 업데이트되지 않았다고 생각합니다.
버그/솔루션:
해결책이 여기에 있습니다: http://bugs.php.net/bug.php?id=50172 IIS.NET 포럼에서 Don.Raman에게 감사드립니다 http://forums.iis.net/p/1164911/1933894.aspx
증상:
PHP 기능 mysql_connect()
PHP5.3과 함께 중단 및 오류 500을 반환합니다. (IPv6은 문제 위에서 링크를 참조하십시오)
테스트 코드:
<?php
$con = mysql_connect("localhost","root","***");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
// some code
mysql_close($con);
?>
오류:
브라우저에서 :
HTTP Error 500.0 - Internal Server Error
C:\php\php-cgi.exe - The FastCGI process exceeded configured activity timeout
내가 달릴 때 php -f c:\public_html\index.php
내가 얻은 명령 줄에서 :
PHP Warning: mysql_connect(): [2002] A connection attempt failed because the co
nnected party did not (trying to connect via tcp://localhost:3306) in C:\public
_html\index.php on line 10
Warning: mysql_connect(): [2002] A connection attempt failed because the connect
ed party did not (trying to connect via tcp://localhost:3306) in C:\public_html
\index.php on line 10
PHP Warning: mysql_connect(): A connection attempt failed because the connected
party did not properly respond after a period of time, or established connectio
n failed because connected host has failed to respond.
in C:\public_html\index.php on line 10
Warning: mysql_connect(): A connection attempt failed because the connected part
y did not properly respond after a period of time, or established connection fai
led because connected host has failed to respond.
in C:\public_html\index.php on line 10
Could not connect: A connection attempt failed because the connected party did n
ot properly respond after a period of time, or established connection failed bec
ause connected host has failed to respond.
C:\Users\Kevin>
해결책
Don.Raman은 다음과 같이 썼습니다.
봐주세요 http://bugs.php.net/bug.php?id=50172 이것에 대한 해결을 위해.
또 다른 대안은이 동작이없는 PHP 5.2.12를 사용하는 것입니다.
찾았어요 http://forums.iis.net/p/1164911/1933894.aspx 그리고 그것에 대해 게시했습니다.
다른 팁
Windows 7/Apache/MySQL에 my_sql_connect 오류가 발생했습니다. 호스트 매개 변수를 'localhost'에서 '127.0.0.1'으로 변경하는 것도 저에게 효과적이었습니다.
또한 다른 호스트의 경우 호스트 이름 대신 IP 주소를 사용합니다 (IP 주소를 빨리 찾으려면 명령 프롬프트에서 '핑'을 입력하십시오).
이 작업을 수행:
- 이동
C://Windows/System32/drivers/etc
- 호출 된 파일을 편집합니다
host
무엇이든하기 전에 편집 할 권한이 충분한 지 확인하고 오른쪽 버튼을 클릭하여 속성-> 보안-> 편집 한 다음 사용중인 사용자 계정을 선택하고 전체 제어 확인란을 클릭하여 전체 제어를 제공하십시오. 신청-> OK
열려 있는 host
메모장 또는 기타 ANSI 표준 텍스트 편집기를 사용하여 파일 및 라인을 사용하지 않습니다. # 127.0.0.1 localhost
제거하여 #
그리고 저장.