1.Wordpress Not automatically update in the background
the user of the file which running wordpress needs more permission.
chown -R apache:apache /var/www/html/*(/var/www/html is the dir of wordpress )
2.The WordPress program can not switch or install themes in the background
1、vi /usr/local/php/etc/php.ini
2、find “disable_functions” and delete “scandir”
502 Bad Gateway Automatically restart Script
Automatically restart the PHP process. Applicable to LNMP environment.
The following files, stored in / root or other directory:
#!/bin/bash MY_URL="http://www.vpsmm.com/" RESULT=`curl -I $MY_URL|grep "HTTP/1....1 502"` if [ -n "$RESULT" ]; then /etc/init.d/php-fpm restart fi
Give Executable permission:
chmod +x /root/php.sh
use crontab set up automatic operation:
crontab -e
* * * * * /root/php.sh
crontab -e , a(Enter the edit mode) , shift+:wq (save and quite)