Monthly Archives: June 2011

减小nginx编译后的文件大小

默认的nginx编译选项里居然是用debug模式(-g)的(debug模式会插入很多跟踪和ASSERT之类),编译以后一个nginx有好几兆。
去掉nginx的debug模式编译,编译以后只有375K(nginx-0.5.33, gcc4)。
在 auto/cc/gcc,最后几行有:

# debug
CFLAGS=”$CFLAGS -g”

注释掉或删掉这几行,重新编译即可。-g参数用法详见这篇blog:[原]Linux下的c/c++ GDB调试

Nginx uses debug mode (-g) in compiling by default, which result in several MB of it’s size.
After debug disabled, the file size of nginx reduced to 375K (nginx-0.5.33, gcc4).
open auto/cc/gcc, find this at last several lines:
# debug
CFLAGS=”$CFLAGS -g”
delete it, and recompile. More of -g: Linux c/c++ GDB debug

转:http://bianbian.org/technology/271.html

EasyPHP安装WHMCS错误

网站上自己整合的WHMCS template有些问题,准备在电脑上装一个EasyPHP环境修改一下自己做的template,但是安装whmcs后,登陆admin一直报错:

Login Failed. Please Try Again.
Your IP has been logged and admins notified of this
failed login attempt.

让我很郁闷,重新安装了N次都是这样,突然想到在安装的过程中有报错:

Errors Occured

Please open a ticket with the debug information below for support

File: upgrade330.sql
Line 15 - Field 'fromname' doesn't have a default value
Line 16 - Field 'fromname' doesn't have a default value
Errors Occured

Please open a ticket with the debug information below for support

File: upgrade340.sql
Line 16 - Field 'fromname' doesn't have a default value
Line 17 - Field 'fromname' doesn't have a default value
Line 18 - Field 'fromname' doesn't have a default value
Line 30 - Field 'value' doesn't have a default value
Errors Occured

Please open a ticket with the debug information below for support

File: upgrade341.sql
Line 6 - Field 'fromname' doesn't have a default value
Errors Occured

Please open a ticket with the debug information below for support

File: upgrade380.sql
Line 24 - Incorrect integer value: '' for column 'id' at row 1

以为问题不大就当是就没有理会,是不是这里的原因?

后来才发现原来的EasyPHP新版的mysql默认开启了Strict Mode,造成WHMCS安装报错,在php.ini中修改

#sql-mode=”STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION”
sql-mode=”NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION”

参考这里:http://www.vk8.org/archives/405.html