PHP 5.3.0 Á¬½Ómysqli³ö´íµÄ½â¾ö
½üÈÕÒò¹«Ë¾¿ª·¢ÐèÒª,ÔÚ±¾»úWin7ϼÜÉèÁËApache+MySql+PHP
ËùʹÓÃPHP°æ±¾:PHP5.3.0, Ö®ºó·¢ÏÖÎÞ·¨Á¬½ÓmysqlÊý¾Ý¿â,¾ù±¨³¬Ê±´íÎó:
PHP Warning: mysqli::mysqli(): [2002] A connection attempt failed because the connected party did not (trying to connect via tcp://localhost:3306) in xxx.php on line x
PHP Warning: mysqli::mysqli(): (HY000/2002): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
in xxx.php on line x
ÔÚÍøÕ¾ÉϲéÕÒÁ˺ܾÃ,¾ùûÓÐÓÐЧµÄ½â¾ö°ì·¨.
ºóÀ´ÔÚ¹úÍâµÄÍøÉϲ鵽´ËÔÒòÓëwindowsµÄhostsÎļþÓйØ
¶ÔÈçϽøÐÐÐÞ¸Ä:
# 127.0.0.1 localhost
#:: 1 localhost
ÐÞ¸ÄΪ
127.0.0.1 localhost
#:: localhost
ÎÊÌâ½â¾ö
Ïà¹ØÎĵµ£º
define("DB_SERVER","127.0.0.1");
define("DB_PORT",3306);
define("DB_CATALOG","uab");
define("DB_USERID","root");
define("DB_PASSWORD","");
$dsn="mysql:host=".DB_SERVER.";port=".DB_PORT.";dbname=".DB_CATALOG;
self::$__PDO=new PDO($dsn, DB_USERID, DB_PASSWORD);
//support long connection
self:: ......
ÍøÉÏ¿´ÁËsession.save_pathºÃÏñÕâ¸ösessionÎÒ»¹Ã»ÓÐÔõôÓùýÄØ£¬¿´À´ÓбØÒªÑо¿Ò»Ï°¡
½ñÌìÌØÒâµÄ¿´ÁËÒ»ÏÂÎĵµ£¬¿´Ò»ÏÂÎĵµÈ·ÊµÓÐÕâô¶«Î÷£¬Ò²Ã»Óп´µ½Ê²Ã´Àý×Ó¾Í×Ô¼ºËæ±ãµÄдÁËÒ»µã¿´¿´
´úÂëÈçÏ echo session.save_path
´ò¿ªä¯ÀÀÆ÷²é¿´¾¹È»ÏÔʾ sessionsave_path ²»¶Ô°¡£¬Ôõô»áÊÇÕâ¸öÄØ£¬¿´¿ ......
<?php
// ½«Êý×éת»»³ÉJson¸ñʽ£¬ÖÐÎÄÐèÒª½øÐÐURL±àÂë´¦Àí
function Array2Json($array) {
arrayRecursive($array, 'urlencode', true);
$json = json_encode($array);
$json = urldecode($json);
// extÐèÒª²»´øÒýºÅµÄboolÀàÐÍ
&n ......
<?php
$start = ip2long('192.168.1.1');
$start = sprintf("%u", $start) ;
$end = ip2long('192.168.1.50');
$end = sprintf("%u", $end) ;
for ($start; $start<$end; $start++){
echo long2ip($start)."<br>";
}
?> ......
GD¿âÊÇPHP½øÐÐͼÏó²Ù×÷Ò»¸öºÜÇ¿´óµÄ¿â¡£
ÏÈÔÚphp.iniÀïÔö¼ÓÒ»ÐÐÒýÓãºextension=php_gd2.dll
ÖØÆôapache¡£×öÒ»¸ö²âÊÔÒ³ var_dump(gd_info());Êä³öÊý¾Ý±íÃ÷GD¿âÒýÓóɹ¦¡£
±íµ¥auth.html
<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
< ......