现象: php与mysql建立连接时,等待很久,最终报脚本执行时间超过最大值。问题来源: 当php需要连接mysql时,一般情况不会配错的,若mysql所在的机器关掉了,或者网络问题,或者配置错误,那么就需要等好久才会知道连接的结果,等待的时间由php.ini中的mysql.connect_timeout来决定(单位:秒),建议配为2或3