Home > Article > Backend Development > What should I do if php7 cannot be used after downloading and installing it?
Solution to the problem that php7 cannot be used after downloading and installing: 1. Check the startup script through "vim /etc/init.d/php-fpm"; 2. Modify the execution file path in the script correctly or pass The "sed -i 's/@sbindir@/\/usr\/local\/php\/sbin/g' /etc/init.d/php-fpm" statement can be modified directly.
#The operating environment of this tutorial: Windows 7 system, PHP 7 version, Dell G3 computer.
What should I do if php7 cannot be used after downloading and installing it?
Solution to the problem that the service cannot be started after PHP7.4 source code is installed
The source code installs PHP7.4, the test passes, but the service cannot be started. The following error is reported:
Starting php-fpm /etc/init.d/php-fpm: line 57: /usr/local/php/php-fpm: No such file or directory failed
Cause: When starting the script execution, the execution file could not be found. Check the startup script:
vim /etc/init.d/php-fpm
Just modify the execution file path in the script correctly. For example, I directly changed it to an absolute path.
Of course, you can also use sed to modify it directly:
sed -i 's/@sbindir@/\/usr\/local\/php\/sbin/g' /etc/init.d/php-fpm sed -i 's/@sysconfdir@/\/usr\/local\/php\/etc/g' /etc/init.d/php-fpm sed -i 's/@localstatedir@/\/usr\/local\/php\/var/g' /etc/init.d/php-fpm
Recommended learning: "PHP Video Tutorial"
The above is the detailed content of What should I do if php7 cannot be used after downloading and installing it?. For more information, please follow other related articles on the PHP Chinese website!