XAMPP无法解析PHP [英] XAMPP not parsing PHP
问题描述
我刚刚安装了XAMPP 1.8.1,并重新启动了计算机,开始运行Apache和MySQL,并在XAMPP下htdocs目录中的测试文件夹中创建了测试文件.
I just installed XAMPP 1.8.1 and have restarted my computer, started running Apache and MySQL, and created a test file in a test folder in my htdocs directory under XAMPP.
当我转到xampp/index.php时,他们的页面显示正常.但是我的测试文件仅在Firebug的"Response"选项卡中返回PHP文件中的实际字符,但窗口中的屏幕完全空白.该文件肯定是.php扩展名-任何人都可以帮忙吗?
When I go to xampp/index.php, their page comes up fine. But my test file only returns the actual characters in my PHP file in the "Response" tab in firebug, but a completely blank white screen in the window. The file is definitely .php extension - can anyone help?
疯狂的事情是,我六个月前就完成了这项工作,并且刚刚重新安装它.
The crazy thing is, I had this working 6 months ago just fine and have just gotten back to it on a new install.
推荐答案
我认为您可能使用的是短标签<? ?>
或<?= ?>
而不是<?php ?>
.
检查您的 php.ini .它位于 \ path \ to \ xampp \ php \ php.ini . short_open_tag
应该打开.
I think you might be using short tag <? ?>
or <?= ?>
instead of <?php ?>
.
Check your php.ini. It locates at \path\to\xampp\php\php.ini. The short_open_tag
should be On.
;允许
<?
标记.否则,将仅识别<?php
和<script>
标签.
;注意:开发应用程序或
时应避免使用短标签 ;用于重新分发或在PHP上部署的库
;不在您控制范围内的服务器,因为短标签可能不受限制
;在目标服务器上受支持.对于可移植的可再发行代码,请确保不要使用短标签.
short_open_tag =开
; Allow the
<?
tag. Otherwise, only<?php
and<script>
tags are recognized.
; NOTE: Using short tags should be avoided when developing applications or
; libraries that are meant for redistribution, or deployment on PHP
; servers which are not under your control, because short tags may not
; be supported on the target server. For portable,redistributable code, be sure not to use short tags.
short_open_tag = On
这篇关于XAMPP无法解析PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!