Home  >  Article  >  Backend Development  >  What should I do if php7 cannot be used after downloading and installing it?

What should I do if php7 cannot be used after downloading and installing it?

藏色散人
藏色散人Original
2022-12-01 09:13:305959browse

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.

What should I do if php7 cannot be used after downloading and installing it?

#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

What should I do if php7 cannot be used after downloading and installing it?

Cause: When starting the script execution, the execution file could not be found. Check the startup script:

vim /etc/init.d/php-fpm

What should I do if php7 cannot be used after downloading and installing it?

Just modify the execution file path in the script correctly. For example, I directly changed it to an absolute path.

What should I do if php7 cannot be used after downloading and installing it?

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn