我一直在尝试在我的 Apache Web 服务器(本地主机)中 从php.net设置 PHP 。
在过去的一天半时间里,我一直在 Apache 站点、php.net 站点、SO 以及其他任何显示当前错误的地方的文档,以尝试解决问题。以下是我目前的设置和(可能是错误的)理解的一些细节。
Define SRVROOT "/Apache/00"
ServerRoot "${SRVROOT}"
Apache 的公共目录设置为htdocs
. Apache 正在通过localhost
. 只是为了确保我有正确的地址并且它是 Apache,我进行了如下所述的开/关测试。
我运行了为 PHP 提供的 Windows MSI。然后我调整了/conf/httpd.conf
文件以添加:
ScriptAlias /php/ "${SRVROOT}/php/"
AddType application/x-httpd-php .php
注意: php
, htdocs
(公共文件)&conf
目录都在同一个目录的根目录下,SRVROOT
.
测试阿帕奇
http://localhost/lib/
可能会产生:
Index of /lib
Parent Directory
amd64/
web.jar
x86/
在关闭 Apache 并刷新列表时,我看到一个 FF 错误。
Unable to connect
Firefox can't establish a connection to the server at localhost.
所以 Apache 本身似乎工作正常,当它运行时我可以做目录列表。
测试 PHP
http://localhost/php/
显示:
Forbidden
You don't have permission to access /php/ on this server.
好吧,这似乎是合乎逻辑的,Apache 现在承认该目录的存在,但表示它不打算公开浏览。
我phpinfo.php
在目录的根php
目录中有一个。
<?phpinfo();?>
我希望如果我浏览到http://localhost/phpinfo.php
应该给我信息,但我收到 404 消息:
Not Found
The requested URL /phpinfo.php was not found on this server.
因为http://localhost/php/phpinfo.php
我收到禁止消息:
Forbidden
You don't have permission to access /php/phpinfo.php on this server.
典型的error.log
sl:warn] [pid 1504:tid 336] AH01909: RSA certificate configured for localhost:443 does NOT include an ID which matches the server name
[Sun Aug 04 19:06:01.995343 2013] [ssl:warn] [pid 1504:tid 336] AH02292: Init: Name-based SSL virtual hosts only work for clients with TLS server name indication support (RFC 4366)
[Sun Aug 04 19:06:02.298078 2013] [ssl:warn] [pid 1504:tid 336] AH01909: RSA certificate configured for localhost:443 does NOT include an ID which matches the server name
[Sun Aug 04 19:06:02.298078 2013] [ssl:warn] [pid 1504:tid 336] AH02292: Init: Name-based SSL virtual hosts only work for clients with TLS server name indication support (RFC 4366)
[Sun Aug 04 19:06:02.300031 2013] [mpm_winnt:notice] [pid 1504:tid 336] AH00354: Child: Starting 64 worker threads.
[Sun Aug 04 19:06:03.279523 2013] [authz_core:error] [pid 1504:tid 1004] [client ::1:50589] AH01630: client denied by server configuration: I:/Apache/00/php/index.html
[Sun Aug 04 19:15:39.932843 2013] [authz_core:error] [pid 1504:tid 1004] [client ::1:50599] AH01630: client denied by server configuration: I:/Apache/00/php/
[Sun Aug 04 19:21:49.700421 2013] [authz_core:error] [pid 1504:tid 1004] [client ::1:50608] AH01630: client denied by server configuration: I:/Apache/00/php/phpinfo.php
[Sun Aug 04 19:26:58.432843 2013] [authz_core:error] [pid 1504:tid 1004] [client ::1:50621] AH01630: client denied by server configuration: I:/Apache/00/php/phpinfo.php
[Sun Aug 04 19:37:26.403546 2013] [mpm_winnt:notice] [pid 4400:tid 324] AH00422: Parent: Received shutdown signal -- Shutting down the server.
[Sun Aug 04 19:37:28.403546 2013] [mpm_winnt:notice] [pid 1504:tid 336] AH00364: Child: All worker threads have exited.
[Sun Aug 04 19:37:28.418195 2013] [mpm_winnt:notice] [pid 4400:tid 324] AH00430: Parent: Child process 1504 exited successfully.
问题
我想出示phpinfo.php
文件。谁能看到我犯的愚蠢错误(我是新手)?
也可以看看:
这些是我一直在查看的主要文档: