问题
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.
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.
回答1:
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.
; 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
来源:https://stackoverflow.com/questions/14555669/xampp-not-parsing-php