今天在安装了最新版phpstudy之后,启动报错“AH00526: Syntax error on line 5 of D:/Program Files/phpstudy_pro/Extensions/Apache2.4.39/conf/vhosts/localhost_80.conf:
Wrapper D:/Program cannot be accessed: (720002)\xcf\xb5\xcd\xb3\xd5\xd2\xb2\xbb\xb5\xbd\xd6\xb8\xb6\xa8\xb5\xc4\xce\xc4\xbc\xfe\xa1\xa3”,如下图所示:
以前没碰见过这个问题,在没仔细看错误提示之前,第一时间以为是phpstudy新版本的bug,仔细一看,发现原来是说第5行路径搞错了,提示里面有说“D:/Program cannot be accessed”,也就是说这个路径找不到,打开检查了一下:
<VirtualHost _default_:80>
DocumentRoot "D:/Program Files/phpstudy_pro/WWW"
FcgidInitialEnv PHPRC "D:/Program Files/phpstudy_pro/Extensions/php/php7.3.4nts"
AddHandler fcgid-script .php
FcgidWrapper "D:/Program Files/phpstudy_pro/Extensions/php/php7.3.4nts/php-cgi.exe" .php
<Directory "D:/Program Files/phpstudy_pro/WWW">
Options FollowSymLinks ExecCGI
AllowOverride All
Order allow,deny
Allow from all
Require all granted
DirectoryIndex index.php 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>
第5行的FcgidWrapper配置中,指向的也是“Program Files”目录中的路径,初步猜测是因为它识别不了空格,而我的安装目录“Program Files”刚好就有空格,百度查了一下资料,果不其然,也有其他人出现了这个问题,证实我的猜测没错,真的是low啊。。。
问题原因:
安装目录带有空格(不过很好奇,为什么第5行上面那几行配置中,一样带有空格,但是却没报错)
解决方案:
将phpstudy安装到不带空格的目录下,如“D:\phpstudy”。
评论