【问题标题】:PHP files won't run on new xampp installationPHP 文件不会在新的 xampp 安装上运行
【发布时间】:2012-08-24 00:12:59
【问题描述】:

Apache 似乎运行正常,当我进入 xampp 控制面板时,我可以检查 phpinfo(),一切正常。当我尝试在浏览器中打开任何 php 文件时,页面是空白的。

这是我的 Apache 错误日志

[Wed Aug 29 07:07:19.160419 2012] [ssl:warn] [pid 280:tid 376] AH01873: Init: Session    Cache is not configured [hint: SSLSessionCache]
[Wed Aug 29 07:07:19.768831 2012] [mpm_winnt:notice] [pid 280:tid 376] AH00455: Apache/2.4.2 (Win32) OpenSSL/1.0.1c PHP/5.4.4 configured -- resuming normal operations
[Wed Aug 29 07:07:19.768831 2012] [mpm_winnt:notice] [pid 280:tid 376] AH00456: Server built: May 13 2012 14:10:15
[Wed Aug 29 07:07:19.768831 2012] [core:notice] [pid 280:tid 376] AH00094: Command line: 'c:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache'
[Wed Aug 29 07:07:19.768831 2012] [mpm_winnt:notice] [pid 280:tid 376] AH00418: Parent: Created child process 424
[Wed Aug 29 07:07:20.673648 2012] [ssl:warn] [pid 424:tid 268] AH01873: Init: Session Cache is not configured [hint: SSLSessionCache]
[Wed Aug 29 07:07:20.767250 2012] [mpm_winnt:notice] [pid 424:tid 268] AH00354: Child: Starting 150 worker threads.
[Wed Aug 29 07:18:17.441000 2012] [mpm_winnt:notice] [pid 280:tid 376] AH00422: Parent: Received shutdown signal -- Shutting down the server.
[Wed Aug 29 07:19:34.371074 2012] [core:warn] [pid 1608:tid 376] AH00098: pid file C:/xampp/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[Wed Aug 29 07:19:35.104275 2012] [ssl:warn] [pid 1608:tid 376] AH01873: Init: Session Cache is not configured [hint: SSLSessionCache]
[Wed Aug 29 07:19:38.193080 2012] [mpm_winnt:notice] [pid 1608:tid 376] AH00455: Apache/2.4.2 (Win32) OpenSSL/1.0.1c PHP/5.4.4 configured -- resuming normal operations
[Wed Aug 29 07:19:38.224280 2012] [mpm_winnt:notice] [pid 1608:tid 376] AH00456: Server built: May 13 2012 14:10:15
[Wed Aug 29 07:19:38.224280 2012] [core:notice] [pid 1608:tid 376] AH00094: Command line: 'c:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache'
[Wed Aug 29 07:19:38.317881 2012] [mpm_winnt:notice] [pid 1608:tid 376] AH00418: Parent: Created child process 2812
[Wed Aug 29 07:19:40.221084 2012] [ssl:warn] [pid 2812:tid 268] AH01873: Init: Session Cache is not configured [hint: SSLSessionCache]
[Wed Aug 29 07:19:40.252284 2012] [mpm_winnt:notice] [pid 2812:tid 268] AH00354: Child: Starting 150 worker threads.

【问题讨论】:

  • 可以在控制台/命令中执行php吗?
  • 您是否在 xampp/htdocs 下创建了 Xampp 目录,将文件放在 /xampp/htdocs 并在浏览器中输入 localhost/test.php
  • 不,但我删除了 test.php 文件的内容,只写了“test”并显示。我知道它的目标是正确的文件。编辑 - 我试过了,但也没有用。
  • 显示php文件,该文件可能有错误
  • @Naveen Kumar 我只有

标签: php mysql xampp


【解决方案1】:

你使用的是 Windows 7

Windows 7 有使用端口 80 的网络服务器

所以 apache 可能没有运行。 检查80端口是否被使用

要更改 Xampp apache 的端口号,请查看此链接 Xampp server port

【讨论】:

  • ServerName 和 Listen 都设置为 80。在 XAMPP 控制面板上,Apache 显示为在端口 80 和 443 上运行。
  • 检查链接并更改 Xampp 服务器端口 apache 没有正常运行,这就是 php 没有执行的原因。将端口号更改为8080,则浏览器中的路径为localhost:8080/
【解决方案2】:

我在正常安装时遇到了这种情况,结果发现 Skype 正在运行并阻塞了我使用的正常端口。

【讨论】:

    猜你喜欢
    • 2018-09-24
    • 2016-06-10
    • 2023-04-05
    • 2015-03-09
    • 2010-10-19
    • 2012-12-12
    • 2020-07-19
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多