要重启PHP,可以通过重启Web服务器或PHP-FPM进程来实现。
-
重启Web服务器:如果你使用的是Apache或Nginx等Web服务器,可以通过以下命令重启Web服务器:
- Apache:sudo service apache2 restart
- Nginx:sudo service nginx restart
-
重启PHP-FPM进程:如果你使用的是PHP-FPM,可以通过以下命令重启PHP-FPM进程:
- Ubuntu/Debian:sudo service php7.4-fpm restart
- CentOS/RHEL:sudo systemctl restart php-fpm
注意:以上命令中的版本号和服务名称可能需要根据你的实际情况进行修改。