Warning: Use of undefined constant ‘classic_options’ - assumed '‘classic_options’' (this will throw an Error in a future version of PHP) in /www/wwwroot/blog.itisxx.com/wordpress/wp-content/themes/fullstack/single.php on line 4

Warning: Use of undefined constant ‘notice’ - assumed '‘notice’' (this will throw an Error in a future version of PHP) in /www/wwwroot/blog.itisxx.com/wordpress/wp-content/themes/fullstack/single.php on line 5
首页 > 技术 > Ubuntu 17.10 设置php7.1和nginx使用root权限运行

Ubuntu 17.10 设置php7.1和nginx使用root权限运行

技术 2017-11-4 15:53:03 22℃ 评论已关闭

nginx修改nginx.conf

user data-www 改为user root即可,

 

php7.1修改/etc/php/7.1/fpm/pool.d/www.conf,

user = data-www 和group = data-www 修改为

user = root

group = root

然后 sudo vim /lib/systemd/system/php7.1-fpm.service

在这一行中间加上参数 -R,

ExecStart=/usr/sbin/php-fpm7.1 --nodaemonize --fpm-config /etc/php/7.1/fpm/php-fpm.conf

改为 :

ExecStart=/usr/sbin/php-fpm7.1 --nodaemonize -R --fpm-config /etc/php/7.1/fpm/php-fpm.conf

然后 sudo systemctl daemon-reload 重新加载配置文件,再启动

sudo systemctl restart php7.1-fpm.service

sudo systemctl restart nginx.service

即可。

上一篇: 下一篇:
请安装多说插件-下载地址