我想对cgi文件使用相同的html目录。有没有办法将ScriptAlias定义为只执行php脚本,而将所有其他脚本作为正常的html内容提供?
我的php代码可以很好地执行,但其他文件不会被提供。
下面是错误:
[error] (13)Permission denied: exec of '/hosting/content/test-dev/htdocs/users.html' failed
[error Premature end of script headers: users.html
[error] script not found or unable to stat: /hosting/content/test-dev/htdocs/error
ScriptAlias / "/hosting/content/test-dev/htdocs/"
<Directory "/hosting/content/test-dev/htdocs/">
....
</Directory>发布于 2017-02-07 06:58:10
是,将其设置为普通Alias,而不是ScriptAlias,然后添加:
Options +ExecCGI然后,它将提供正常内容并运行可执行文件。但是运行PHP脚本并不需要这样做。它们可以使用普通别名或文档根目录,并且可以很好地工作。ScriptAlias或ExecCGI只有可执行文件才需要,而PHP并不需要,它们只是通过一个处理PHP代码的处理程序来运行,这是不同的。
https://stackoverflow.com/questions/42078593
复制相似问题