Server works with XAMPP php but wont run php files in htdocs

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Server works with XAMPP php but wont run php files in htdocs

Postby AjServers » 16. April 2012 21:23

I just installed Apache, mysql, and php using XAMPP on my machine which is running a 64bit version of windows 7 pro. When i click admin on the control pannel and it opens XAMPP in my opra web browser it lists that php is "ACTIVATED" and all the php scripts such as phpinfo() and the cd program under the XAMPP web interface run properly in my browser. However when i try to open my files all i see it the raw php code. This happens even on the simple <? phpinfo(); ?> file that i made to test which is named phpinfo.php. Html file work just fine too. According to my php book if you see the raw code either php is not installed properly or the browser isnt sure what to do with the .php extension. Ive even gone into the .conf file to be sure to add the LoadModule code and the AddType code. Ive had XAMPP running without issuses on my old xp machine but now im completely lost as to why im only seeing raw code with my files but XAMPP's php files run just fine under the localhoast... Any suggestions are greatly appreciated!
AjServers
 
Posts: 1
Joined: 16. April 2012 17:56
Operating System: Windows 7

Re: Server works with XAMPP php but wont run php files in ht

Postby Altrea » 16. April 2012 21:43

Hi AjServers,

AjServers wrote:According to my php book if you see the raw code either php is not installed properly or the browser isnt sure what to do with the .php extension.

Your php book is just partly correct. There are several possible issues causing that php is not served correctly, beginning with the wrong request protocol up to Server configuration issues. PHP is working correct on your environment, because the status page is served to you with php too.

To give you the correct hint we need some more information about your script, especially which URL your browser adressbar shows at the time you see the raw php output.

best wishes,
Altrea
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11933
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 224 guests