1. 不要把鸡蛋放在一个篮子里
2. 三思而后行
3. 反复检查
4. 做最坏的打算
pecl update mongodb 1.1.* to 1.2.* 导致 php-fpm 全部立即段错误并失去控制,systemctl restart php-fpm失败
第二次遇到了~
ps -ef | grep php-fpm | cut -c 9-15 | xargs kill && systemctl restart php-fpm
Dec 15 20:40:02 web4 systemd: Removed slice User Slice of root.
Dec 15 20:40:02 web4 systemd: Stopping User Slice of root.
Dec 15 20:40:25 web4 kernel: traps: php-fpm[10171] general protection ip:7f4046d83120 sp:7ffc76043de0 error:0 in mongodb.so[7f4046d57000+be000]
Dec 15 20:40:25 web4 kernel: traps: php-fpm[1770] general protection ip:7f4054402542 sp:7ffc76045578 error:0 in ld-2.17.so[7f40543e9000+21000]
Dec 15 20:40:25 web4 kernel: traps: php-fpm[1771] general protection ip:7f4054402542 sp:7ffc76045578 error:0 in ld-2.17.so[7f40543e9000+21000]
Dec 15 20:40:25 web4 kernel: traps: php-fpm[1772] general protection ip:7f4054402542 sp:7ffc76045578 error:0 in ld-2.17.so[7f40543e9000+21000]
Dec 15 20:40:25 web4 kernel: traps: php-fpm[1773] general protection ip:7f4054402542 sp:7ffc76045578 error:0 in ld-2.17.so[7f40543e9000+21000]
Dec 15 20:40:25 web4 kernel: traps: php-fpm[1774] general protection ip:7f4054402542 sp:7ffc76045578 error:0 in ld-2.17.so[7f40543e9000+21000]
Dec 15 20:40:25 web4 kernel: traps: php-fpm[1775] general protection ip:7f4054402542 sp:7ffc76045578 error:0 in ld-2.17.so[7f40543e9000+21000]
Dec 15 20:40:25 web4 kernel: traps: php-fpm[1776] general protection ip:7f4054402542 sp:7ffc76045578 error:0 in ld-2.17.so[7f40543e9000+21000]
Dec 15 20:40:25 web4 kernel: traps: php-fpm[1777] general protection ip:7f4054402542 sp:7ffc76045578 error:0 in ld-2.17.so[7f40543e9000+21000]
Dec 15 20:40:25 web4 kernel: traps: php-fpm[1778] general protection ip:7f4054402542 sp:7ffc76045578 error:0 in ld-2.17.so[7f40543e9000+21000]
Dec 15 20:40:26 web4 systemd: Stopping LSB: starts php-fpm...
FIXED: 不建议给has_cap传入一个参数!用户级别已被废弃,请改用能力
add_options_page(‘Delete-Revision’, ‘Delete-Revision’,8, basename(__FILE__), ‘my_options_delete_revision’);
add_options_page(‘Delete-Revision’, ‘Delete-Revision’, ‘manage_options’, basename(__FILE__), ‘my_options_delete_revision’);
注意这个8,修改成‘manage_options’即可
virtual memory exhausted: Cannot allocate memory
goaccess nginx 默认格式参数
goaccess.conf
# Nginx default
log-format %^ %^ %^ [%d:%t %^] "%r" %s %b "%R" "%u" ~h{," }
shell
goaccess -f /var/log/nginx/access.log --log-format="%^ %^ %^ [%d:%t %^] \"%r\" %s %b "%R" \"%u\" ~h{,\" }"
goaccess log-format 参数说明
log-format The log-format variable followed by a space or \t for tab-delimited, specifies the log format string.
SPECIFIERS
%xA date and time field matching the time-format and date-format variables. This is used when a timestamp is given instead of the date and time being in two separate variables.%ttime field matching the time-format variable.%ddate field matching the date-format variable.%vThe server name according to the canonical name setting (Server Blocks or Virtual Host).%eThis is the userid of the person requesting the document as determined by HTTP authentication.%hhost (the client IP address, either IPv4 or IPv6)%rThe request line from the client. This requires specific delimiters around the request (single quotes, double quotes, etc) to be parsable. Otherwise, use a combination of special format specifiers such as%m,%U,%qand%Hto parse individual fields.- Note: Use either
%rto get the full request OR%m,%U,%qand%Hto form your request, do not use both.
- Note: Use either
%mThe request method.%UThe URL path requested.- Note: If the query string is in
%U, there is no need to use%q. However, if the URL path, does not include any query string, you may use%qand the query string will be appended to the request.
- Note: If the query string is in
%qThe query string.%HThe request protocol.%sThe status code that the server sends back to the client.%bThe size of the object returned to the client.%RThe “Referer” HTTP request header.%uThe user-agent HTTP request header.%DThe time taken to serve the request, in microseconds.%TThe time taken to serve the request, in seconds with milliseconds resolution.%LThe time taken to serve the request, in milliseconds as a decimal number.%^Ignore this field.%~Move forward through the log string until a non-space (!isspace) char is found.~hThe host (the client IP address, either IPv4 or IPv6) in a X-Forwarded-For (XFF) field.
MySQL日期加减/EXCEL日期转时间戳/fastboot命令
MySQL日期加减
http://blog.csdn.net/arkblue/article/details/51860327
EXCEL日期转时间戳
https://yq.aliyun.com/ziliao/28096
fastboot命令
http://blog.csdn.net/whu_zhangmin/article/details/23848597
论make clean的重要性?
PHP配置不能忘记的东西
时区
date.timezone = Asia/Shanghai
opcache
zend_extension=opcache.so
MySQL链式复制一坑–log-slave-updates
A -> B -> C
默认情况下,来至master的数据是不会写入二进制日志的,导致A复制到B,却不能接着复制到C,要解决这个问题必须开启log-slave-updates=1
https://dev.mysql.com/doc/refman/5.7/en/replication-options-slave.html
bzip2
压缩文件
bzip2 -z filename