我遵循了一些答案,告诉我更改DocumentRoot
和Directory
这是我当前用于xampp 7.2.5的httpd.conf
ServerRoot "/opt/lampp"
DocumentRoot "~/Code/php-xampp"
<Directory "~/Code/php-xampp">
# comments removed for readability
Options Indexes FollowSymLinks ExecCGI Includes
AllowOverride All
Require all granted
</Directory>
从xampp gui界面启动Apache Web Server
时,出现以下错误
Starting Apache Web Server...
Exit code: 8
Stdout:
apache config test fails, aborting
Stderr:
AH00526: Syntax error on line 229 of /opt/lampp/etc/httpd.conf:
DocumentRoot '/opt/lampp/~/Code/php-xampp' is not a directory, or is not readable
为什么将DocumentRoot
附加到ServerRoot
上,这在我重新启动计算机之前是可行的。