我有一台 2009 年末的 Imac,装有 Mac OS 10.13.6 High Sierra,安装了 XAMPP 7.0.30 并尝试运行 openEMR 5.0.1,我在服务器领域和 PHP 方面还是一个真正的初学者。
一开始 Apache 服务器运行良好,但是在安装开放 EMR 并按照建议正确运行服务器后,服务器无法工作并立即停止。
XAMPP 日志中的消息如下。
Starting Apache Web Server...
Exit code: 8
Stdout:
apache config test fails, aborting
Stderr:
httpd: Syntax error on line 523 of /Applications/XAMPP/xamppfiles/etc/httpd.conf: Syntax error on line 10 of /Applications/XAMPP/xamppfiles/apache2/conf/httpd.conf: /Applications/XAMPP/xamppfiles/apache2/conf/httpd.conf:10: <Directory> was not closed.
这些是 httpd.conf 中的行
Line 523 Include "/Applications/XAMPP/xamppfiles/apache2/conf/httpd.conf"
Line 10 <Directory "/Applications/XAMPP/xamppfiles/htdocs/openemr"
下面的 http.conf
Alias /bitnami/ "/Applications/XAMPP/xamppfiles/apache2/htdocs/"
Alias /bitnami "/Applications/XAMPP/xamppfiles/apache2/htdocs"
<Directory "/Applications/XAMPP/xamppfiles/apache2/htdocs">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<Directory "/Applications/XAMPP/xamppfiles/htdocs/openemr">
AllowOverride FileInfo
</Directory>
<Directory "/Applications/XAMPP/xamppfiles/htdocs/openemr/sites">
AllowOverride None
</Directory>
<Directory "/Applications/XAMPP/xamppfiles/htdocs/openemr/sites/*/documents">
order deny,allow
Deny from all
</Directory>
<Directory "/Applications/XAMPP/xamppfiles/htdocs/openemr/sites/*/edi">
order deny,allow
Deny from all
</Directory>
<Directory "/Applications/XAMPP/xamppfiles/htdocs/openemr/sites/*/era">
order deny,allow
Deny from all
</Directory>
其他 httpd.conf
Line 523 Include "/Applications/XAMPP/xamppfiles/apache2/conf/httpd.conf"
我必须做什么才能再次运行 apache?
答案1
错误信息说明了一切:<Directory> was not closed
。你只有<Directory ...
在第 10 行末尾添加“>”,使得该行内容如下:
<Directory "/Applications/XAMPP/xamppfiles/htdocs/openemr">