Phpstudy 0.7版本 创建本地站点域名nginx+apache

it2026-03-14  3

参照:Phpstudy v8.0创建本地站点域名 特殊说明:nginx配置出现404时,经过检查nginx.conf配置发现真正起作用的是vhosts.conf配置文件。所以要在里面加,但是打开如果是:

<VirtualHost *:80> DocumentRoot "D:/work/code/public" ServerName dsp.test ServerAlias FcgidInitialEnv PHPRC "D:/phpstudy_pro/Extensions/php/php7.4.3nts" AddHandler fcgid-script .php FcgidWrapper "D:/phpstudy_pro/Extensions/php/php7.4.3nts/php-cgi.exe" .php <Directory "D:/work/code/public"> Options FollowSymLinks ExecCGI AllowOverride All Order allow,deny Allow from all Require all granted DirectoryIndex index.php index.html error/index.html </Directory> ErrorDocument 400 /error/400.html ErrorDocument 403 /error/403.html ErrorDocument 404 /error/404.html ErrorDocument 500 /error/500.html ErrorDocument 501 /error/501.html ErrorDocument 502 /error/502.html ErrorDocument 503 /error/503.html ErrorDocument 504 /error/504.html ErrorDocument 505 /error/505.html ErrorDocument 506 /error/506.html ErrorDocument 507 /error/507.html ErrorDocument 510 /error/510.html </VirtualHost> 一大串。。。。。 那么你需要这样操作 点击伪静态

重启nginx 然后 就会正常了 再加上

# 伪静态配置-start if (!-e $request_filename) { rewrite ^(.*)$ /index.php?s=$1 last; break; } # 伪静态配置-end

再重启nginx执行就会成功 不会报404找不到资源了

最新回复(0)