Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XAMPP not parsing PHP

Tags:

php

parsing

xampp

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.

like image 264
Adam Avatar asked Jan 28 '13 04:01

Adam


People also ask

Why localhost is not working in XAMPP?

Resolve Apache port conflicts by changing your listening port to 8080. Include the listening port in the address when accessing localhost. Change your MySQL port to 3307 if another application is blocking the default port 3306.

What to do if Apache is not working in XAMPP?

So, to fix Apache not starting on XAMPP Control Panel, follow these all possible methods: Clear World Wide Web Services. Change the default Apache TCP/IP port. Stop World Wide Web Publishing Service.


1 Answers

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

like image 73
Sithu Avatar answered Oct 04 '22 22:10

Sithu