解决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
即可