您好,欢迎访问一九零五行业门户网

ngx_lua实现重启php

nginx
location /reload { default_type text/html; content_by_lua_file reload_php.lua; }
lua
local args = ngx.req.get_query_args();local uid = args[uid]local key = args[key]local uidmd5 = string.sub(ngx.md5(uid),0,12)if key ~= uidmd5 then ngx.say(hey man, you can't do this.) ngx.exit(200)elselocal f = io.open(reload_access.log , a) time = os.date(%c,os.time()) f:write(uid .. .. time) f:close() local command =sh reload_php.sh --local command =/bin/kill -usr2 `cat /var/run/php-fpm.pid` type = os.execute(command) if type == 0 then ngx.print(ok) ngx.exit(200) else ngx.print(error) f:write( error) f:close() ngx.exit(200) endend
shell
#!/bin/bash##reload php-fpm##kill -usr2 `cat /var/run/php-fpm.pid`killall php-fpm/php/sbin/php-fpm -c /etc/php.ini -y /php/etc/php-fpm.confecho ok >> /reload_access.log
写这玩的,大神请指正。
').addclass('pre-numbering').hide(); $(this).addclass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadein(1700); }); }); 以上就介绍了ngx_lua实现重启php,包括了方面的内容,希望对php教程有兴趣的朋友有所帮助。
其它类似信息

推荐信息