Home  >  Article  >  Backend Development  >  Set nginx+PHP to start automatically at boot

Set nginx+PHP to start automatically at boot

不言
不言Original
2018-04-08 09:23:163333browse

The content of this article is to share with you how to set nginx and PHP to start automatically at boot, using code. Friends in need can refer to it

Switch to the root user and execute the command: vim /etc/rc.local

Add the following content:

source /etc/profile
nginx -c /usr/local/nginx/conf/nginx.conf
/usr/sbin/php-fpm start

or

/usr/loca/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
/usr/sbin/php-fpm start

           

Switch to the root user and execute the command: vim /etc/rc.local

Add the following content:

source /etc/profile
nginx -c /usr/local/nginx/conf/nginx.conf
/usr/sbin/php-fpm start

or

/usr/loca/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
/usr/sbin/php-fpm start

The above is the detailed content of Set nginx+PHP to start automatically at boot. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn