解决php的readonly filesystem问题
原因
php-fpm
的systemd
服务默认开启了ProtectSystem=full
选项,使得网站根目录所在的/usr
对php-fpm
只读
解决方法
假设网站根目录为/usr/share/nginx/html/
sudo systemctl edit php-fpm.service
添加
[Service]
ReadWritePaths=/usr/share/nginx/html/
重启服务
sudo systemctl restart php-fpm.service
即可