eaccelerator 0.9.6.x BUG:开启php的open_basedir报错
根据张宴的《 Nginx 0.8.x + PHP 5.2.13(FastCGI)搭建胜过Apache十倍的Web服务器(第6版)》, 配置了LNMP环境,并更换其中的非最新稳定版的软件,另额外装了memcached及snmp 随后打开php.ini中的open_basedir,值为:“/网址根目录/:/var/tmp/:/tmp/” 发现php报错:PHP Warning: Unknown:...
View Articlephp fpm启动失败,日志libevent:entering main loop
启动php-fpm,提示failed 由于配置文件php-fpm.conf和启动文件php-fpm的pid文件路径不一致导致 只需将它们改为一致性即可
View Article一些实用的php函数
1、sys_getloadavg() 说明:获取Linux负载均衡值信息,返回格式: array(1分钟, 5分钟, 15分钟) 作用:可判断5或15分钟的值是否超标(大于cpu核心数即为超标),超标则die掉php,提示相关信息,避免服务器宕掉; 2、pack(string $format, [mixed $arg [, mixed $...]]) 说明:将参数转成二进制数据...
View Article解决php报错:Cannot find save handler ‘eaccelerator’
版本:eaccelerator 0.9.5.3 症状:php无法调用eaccelerator_get等api函数,但phpinfo中显示eaccelerator已成功加载 原因:0.9.5.x版本默认不支持shared-memory...
View Articlephp5.3.4编译报错:error while loading shared libraries: libmysqlclient.so.16:...
解决: ln -s /usr/local/mysql/lib/libmysqlclient.so.16 /usr/lib/
View Articlephp5.3.4编译报错:undefined reference to `libiconv_open’
在make(非make install)时,后面加入以下参数: ZEND_EXTRA_LIBS='-liconv' 完整命令如下: make ZEND_EXTRA_LIBS='-liconv'
View Articlephp5.3.4编译报错:/xxx/include/mysql/m_string.h: In function ‘lex_string_set’:...
在./configure后面加上参数 --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd
View Articlephp5.3 fpm 重启、停止、平滑重载命令
INT, TERM 立刻终止 QUIT 平滑终止 USR1 重新打开日志文件 USR2 平滑重载所有worker进程并重新载入配置和二进制模块 平滑重载例子: kill -USR2 `cat /usr/local/php/var/run/php-fpm.pid`
View Article解决nginx+php5.3 fpm:no input file specified
症状:头部返回404错误,内容返回“no input file specified” 原因:php-fpm无法访问php文件 解决方法: 第一步:检查nginx的fastcgi_param SCRIPT_FILENAME的值是否正确(可将SCRIPT_FILENAME的值输到日志中确认)...
View Articleinclude和require的另类应用
1、include是有返回值的 $res = include "1.php"; // require也返回int(1) var_dump($res); // 打印 int(1) $res = include "2.php"; // 文件不存在时, 报warning级错误,require则报解析错误 var_dump($res); // 打印 bool(false) $res =...
View Article