سؤال

لقد قمت بإعداد PHP5.3 و MySQL5.1 و IIS7 على النافذة 7 لكن PHP لا يريد العمل مع MySQL. أفترض أنه خطأ في التكوين أو تثبيت غير مكتمل من جانبي.

  1. MySQL5.1 يعمل
  2. PHP5.3 يعمل، Phpinfo () يدل على المعلومات وأنها مكنت MySQL
  3. IIS هو الإعداد واستخدام fastcgimodule لتشغيل php
  4. يسجل IIS تحديثات PHP.INI
  5. المنفذ 3306 هو جدار الحماية مجانا ومفتوحة للعالم
  6. تم تكوين PHP.INI بشكل صحيح
  7. لقد أضفت C: PHP إلى مسار أنظمة Windows

في الماضي أتذكر نقل ملف، libmysql.dll، إلى System32، لكنني لا تبدو مع PHP5.3.1، كما يأتي برنامج التشغيل في الوقت الحالي http://us3.php.net/manual/en/mysqlnd.install.php..

(هذا يعطيني الكثير من المتاعب التي كنت توثق نتائجي على مدونتي http://inteldesigner.com/2010/code/having-problems-getting-php5-3-3-with-mysql5-1. )

يحتاج:

  1. أحتاج إلى تثبيت PHP يدويا، لا ترغب في استخدام المثبت السريع أو إصدار أقدم
  2. أحتاج إلى الحصول على PHP5.3 للعمل مع MySQL5.1 حتى أتمكن من تثبيت WordPress2.9 و Drupal7A

سيكون أي روابط أو اقتراح رائعا، لقد فعلت كل شيء بالفعل على موقع IIS على الويب، لا شيء يعمل. أنا أظن أنهم لم يتحدثوا للحصول على برامج جديدة.

البق / الحل:

الحل هنا: http://bugs.php.net/bug.php؟id=50172. شكرا اذهب إلى Don.raman على منتديات IIS.NET http://forums.iis.net/p/1164911/1933894.aspx.

أعراض:

وظيفة PHP. mysql_connect() بالتزامن مع PHP5.3 Locks Up Seap ويعود الخطأ 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. ونشر عن ذلك.

نصائح أخرى

كان لدي خطأ my_sql_connect مع Windows 7 / Apache / MySQL. كما عملت لي المعلمة المضيف من "LocalHost" إلى "127.0.0.1" بالنسبة لي.

أيضا للمضيفين الآخرين فقط استخدم عنوان IP بدلا من اسم المضيف (اكتب "Ping" من موجه الأوامر إذا كنت ترغب في العثور على عنوان IP الخاص به بسرعة).

افعل هذا:

  • اذهب إلى C://Windows/System32/drivers/etc
  • تحرير الملف يسمى host

قبل أن تفعل أي شيء تأكد من أن لديك أذونات كافية لتحريره، انقر بزر الماوس الأيمن فوقها تذهب إلى الخصائص -> Security-> تحرير، ثم اختر حساب المستخدم الذي تستخدمه وإعطاء التحكم الكامل إليه بالنقر فوق عنصر تحكم كامل، ثم تطبيق-> موافق

افتح host ملف باستخدام المفكرة أو أي محرر النصوص القياسية ANSI وغيرها من الخط # 127.0.0.1 localhost عن طريق إزالة # وحفظ.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top