tianws 发表于 2022-5-17 10:12:06

【已解决】检测到配置文件有错误,请先排除后再操作

ERROR: 检测到配置文件有错误,请先排除后再操作

tianws 发表于 2022-5-17 10:14:02

ERROR: 检测到配置文件有错误,请先排除后再操作


nginx:

tianws 发表于 2022-5-17 10:14:48

ERROR: 检测到配置文件有错误,请先排除后再操作

open()

tianws 发表于 2022-5-17 10:16:43


"/www/server/nginx/conf/enable-php.conf"

tianws 发表于 2022-5-17 10:18:19

fail ed ....

tianws 发表于 2022-5-17 10:19:11

ERROR: 检测到配置文件有错误,请先排除后再操作

nginx: open() "/www/server/nginx/conf/enable-php.conf" fail ed (2: No such file or directory) in /www/server/nginx/conf/nginx.conf:79
nginx: configuration file /www/server/nginx/conf/nginx.conf test fail ed

南南呦 发表于 2022-5-17 10:32:17

宝塔用户_feylse 发表于 2022-5-17 10:19
ERROR: 检测到配置文件有错误,请先排除后再操作

nginx: open() "/www/server/nginx/conf/enable-p ...

您好!在这个命令下/www/server/nginx/conf新建一个叫enable-php.conf的文件,文件内容为
location ~ [^/]\.php(/|$)
      {
                try_files $uri =404;
                fastcgi_passunix:/tmp/php-cgi-74.sock;
                fastcgi_index index.php;
                include fastcgi.conf;
                include pathinfo.conf;
      }
注意这里的74是php的版本,您安装的哪个版本的php就写哪个版本。

tianws 发表于 2022-5-17 11:15:11

您好!怎么查询php版本?

tianws 发表于 2022-5-17 11:58:52

安装php7.4,建立文件内容:
location ~ [^/]\.php(/|$)
      {
                try_files $uri =404;
                fastcgi_passunix:/tmp/php-cgi-74.sock;
                fastcgi_index index.php;
                include fastcgi.conf;
                include pathinfo.conf;
      }
存盘时出现错误:nginx: invalid number of arguments in "location" directive in /www/server/nginx/conf/enable-php.conf:2
nginx: configuration file /www/server/nginx/conf/nginx.conf test fail ed

南南呦 发表于 2022-5-17 12:04:40

宝塔用户_feylse 发表于 2022-5-17 11:15
您好!怎么查询php版本?

南南呦 发表于 2022-5-17 12:07:32

宝塔用户_feylse 发表于 2022-5-17 11:58
安装php7.4,建立文件内容:
location ~ [^/]\.php(/|$)
      {


请先说明一下你已经做了那些操作?

tianws 发表于 2022-5-17 12:10:18

解决了,谢谢!:victory::handshake

大污污王菌 发表于 2023-11-26 23:20:34

tianws 发表于 2022-5-17 12:10
解决了,谢谢!

请问你是怎么解决的呀?

宝塔用户_zjrpnq 发表于 2024-2-24 02:14:05

南南呦 发表于 2022-5-17 10:32
您好!在这个命令下/www/server/nginx/conf新建一个叫enable-php.conf的文件,文件内容为

注意这里的74 ...

纯静态咋办
页: [1]
查看完整版本: 【已解决】检测到配置文件有错误,请先排除后再操作