我已经安装了Apache2.4.12 (Win64) VC11。输入httpd -M可以告诉我,php5_module是加载和共享的。
我已经安装了PHP5.6.6 win32 VC11线程安全。
Apache服务器启动得很好,但是当我输入本地phpinfo文件的位置时,就会出现空白。将任何通用HTML添加到文件中都很好,但是PHP标记之间的任何内容都会被忽略。Apache日志正在记录服务器的启动和停止,但没有注意到任何错误。访问日志显示对phpinfo文件的任何访问的服务器代码200或304。
有没有人对在哪里查找任何附加错误有建议?
发布于 2015-03-17 14:13:07
问题是,配置文件中缺少一个AddHandler php5-script .php。
发布于 2015-03-16 18:39:18
首先,检查您的php.ini文件,如果您没有,尝试重新安装PHP,然后您将创建一个。通常在这一点上,php将正常工作。如果不是,那么修改short_open_tag和asp_tags值,并确保engine=on列在同一节中。
[PHP]
; This directive determines whether or not PHP will recognize code between
; <? and ?> tags as PHP source which should be processed as such. It is
; generally recommended that <?php and ?> should be used and that this feature
; should be disabled, as enabling it may result in issues when generating XML
; documents, however this remains supported for backward compatibility reasons.
; Note that this directive does not control the <?= shorthand tag, which can be
; used regardless of this directive.
; Default Value: On
; Development Value: Off
; Production Value: Off
; http://php.net/short-open-tag
short_open_tag = Off
; Allow ASP-style <% %> tags.
; http://php.net/asp-tags
asp_tags = Off如果apache仍然停止并启动,那么php5_module需要比您的系统留下的内存更多的内存,或者它的损坏。
您还可能希望更改memory_limit设置。在大多数情况下,32M的值是可以的。
此外,检查错误日志并确保打开了错误报告。随着PHP的新安装,许多选项将在php.ini文件中解释。
另一种选择是检查您的系统是否有磁盘损坏,并可能重新安装apache和PHP,以排除对文件本身造成的任何损害,特别是如果apache报告了分段错误。如果计算机上的其他任务异常冻结(特别是windows启动),则可能需要替换RAM (内存芯片)。
发布于 2015-05-01 12:53:47
这条线索就在评论中,很有趣。
我使用的是长格式标记,并且在查看源时会出现标记和phpinfo();函数调用。
这意味着页面不是作为PHP处理的。
但是,您确实需要处理PHP。
配置文件中可能缺少一个AddHandler php5-script .php。您还可以将其添加到您的.htaccess文件中(假设您的windows系统需要确认它们)。例如:
AddHandler php5-script .php .html .CustomExt .stuff这将使所有四个结尾都发送到PHP引擎。第一个问题引起争议,第二个问题引起争论,另外两个问题令人怀疑。
根据php.net,其他问题可能是需要添加mime类型处理程序:
AddType application/x-httpd-php .php这需要添加到以下之一:
阅读更多:http://php.net/manual/en/faq.installation.php#faq.installation.processing
https://webmasters.stackexchange.com/questions/78204
复制相似问题