酒醒無夢

          我在幻象的迷留界徘徊,誰來指引幻象的輪回?

            BlogJava :: 首頁 :: 聯系 :: 聚合  :: 管理
            8 Posts :: 0 Stories :: 0 Comments :: 0 Trackbacks

          常用鏈接

          留言簿

          我參與的團隊

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          1.在Apache中加載PHP

          LoadModule php5_module X:/php/php5apache2_2.dll
          PHPIniDir "X:/php"

          需要注意的是dll對應的apache版本,也就是php5apache后面的數字。


          2.在PHP5中連接MySQL5
          PHP5中已經不直接支持MySQL了,需要自己手動配置,官方網站中是這樣說明的:

          MySQL is supported with the only change being that MySQL support is no longer enabled by default in PHP 5. This essentially means that PHP doesn't include the --with-mysql option in the configure line so that you must now manually do this when compiling PHP. Windows users will edit php.ini and enable the php_mysql.dll DLL as in PHP 4 no such DLL existed, it was simply built into your Windows PHP binaries.

          Also, the MySQL client libraries are no longer bundled with PHP. More details on this topic are covered in the following FAQ and be sure to read the MySQL section for details on installing MySQL. An example configure line would be --with-mysql=/usr while Windows users will need the libmySQL.dll available to the system.

          先修改php.ini的內容

          extension_dir = "X:\php\ext"

          并去掉下面兩項的分號

          extension=php_mysql.dll
          extension=php_mysqli.dll

          然后,將php目錄下的libmysql.dll拷貝到C:\Windows目錄,之后MySQL就可以正常連接了。

          寫個程序來測試一下吧。

          1 <?php
          2     $link = mysql_connect("localhost", "username", "password")
          3         or die("Could not connect: " . mysql_error());
          4     print ("Connected successfully");
          5     mysql_close($link);
          6 ?>

           


          posted on 2009-06-24 23:57 Rock N' Java 閱讀(260) 評論(0)  編輯  收藏 所屬分類: Programming
          主站蜘蛛池模板: 屏东县| 吉木萨尔县| 德惠市| 揭东县| 阳东县| 宽城| 茌平县| 房产| 吴江市| 醴陵市| 武胜县| 武安市| 阿鲁科尔沁旗| 酉阳| 唐海县| 赤城县| 会宁县| 西藏| 澄迈县| 湘潭市| 汝南县| 兴城市| 满洲里市| 天全县| 安图县| 南木林县| 樟树市| 大洼县| 西平县| 林甸县| 射洪县| 黑河市| 仙游县| 开江县| 贡嘎县| 鄂伦春自治旗| 英超| 郧西县| 宜州市| 昭觉县| 天门市|