Page 1 of 1

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

PostPosted: 16. April 2012 21:23
by AjServers
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!

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

PostPosted: 16. April 2012 21:43
by Altrea
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