Nginx
location /reload { default_type text/html; content_by_lua_file reload_php.lua; }
Lua
Localargs = Ngx.req.get_query_args ();LocalUID = args["UID"]LocalKey = args["Key"]LocalUIDMD5 = String.sub (NGX.MD5 (UID),0, A)ifKey ~= Uidmd5 then Ngx.say("Hey man, you can ' t do this.") Ngx.Exit( $)ElseLocalf = io.Open("Reload_access.log","a") Time= Os.date ("%c", OS. Time()) F:Write(UID:" ".. Time) F:Close()LocalCommand ="Sh reload_php.sh"--LocalCommand ="/BIN/KILL-USR2 ' cat/var/run/php-fpm.pid '"Type = Os.execute (command)ifType = =0Then Ngx.Print("OK") Ngx.Exit( $)ElseNgx.Print("Error") F:Write("Error") F:Close() Ngx.Exit( $) 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
Write this play, the great god please correct me.
'). addclass (' pre-numbering '). Hide (); $ (this). addclass (' has-numbering '). Parent (). append ($numbering); for (i = 1; i <= lines; i++) {$numbering. Append ($ ('
'). Text (i)); }; $numbering. FadeIn (1700); }); });
The above describes the Ngx_lua implementation to restart PHP, including the aspects of the content, I hope that the PHP tutorial interested in a friend helpful.