参照: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 /err