问候专家和大师,我正在寻找有关 apache php 配置问题的帮助。
一段时间以来,我一直在 ubuntu 服务器上的 apache2 设置中运行多个网站,在我的 etc/apache2/conf.d/virtual.conf 文件中使用 NameVirtualHost * 行没有问题。我最近将服务器版本更新为最新的 lts 版本,现在我无法运行 php 文件。
我正在为位置“/home/www/[site-name]/htdocs”运行我的所有站点,并且我已经在 /etc/apache2/sites-available 中设置并启用了我的所有站点。我还禁用了默认站点。
对于每个站点文件,我指定了以下内容:
# Indexes + Directory Root.
# DirectoryIndex index.html index.htm index.php
DocumentRoot /home/www/[site-name]/htdocs/
# CGI Directory
ScriptAlias /cgi-bin/ /home/www/[site-name]/cgi-bin/
<Location /cgi-bin>
Options +ExecCGI
</Location>
# Logfiles
ErrorLog /home/www/[site-name]/logs/error.log
CustomLog /home/www/[site-name]/logs/access.log combined
我重新启动 apache 并在我的服务器上输入 php 测试页面的 url,我遇到了“内部服务器错误”。当我检查错误日志时,我得到:
脚本“/home/www/[site-name]/htdocs/test.php”解析为“/home/www/[site-name]/htdocs/test.php”不在配置的 docroot 中。