Jump to content


Photo

How to open PHP file ???


  • Please log in to reply
2 replies to this topic

#1 j4mes_bond25

j4mes_bond25
  • New Members
  • Pip
  • Newbie
  • 8 posts

Posted 08 June 2006 - 03:49 PM

After formatting my laptop's harddrive, I have to reinstall PHP setup. Earlier a friend of mine did it, which was working perfectly well. But now, I've used the software "XAMPP" which contains PHP, MySQL along with Apache server.

However, this time I used XAMPP & in it's control window, Apache, MySQL and FireZilla are all running & hence I believe the installation went successful.

I now want to open my PHP files. The program's instruction say that All the documents should be saved in folder ".\xampp\htdocs" [a href=\"http://www.apachefriends.org/en/xampp-windows.html#1168\" target=\"_blank\"]http://www.apachefriends.org/en/xampp-windows.html#1168[/a]
I saved my website's folder i.e. "Personal Website" folder in the location c:/program files/xampp/htdocs"

Problem is everytime, I try to open the document in the browser, I get the message window asking "What should Firefox do with this file? with couple of option saying "Open with: phpfile (default) or Save to disc" & when I say OK for "open with "phpfile (default)" it opens its "coding" in my Dreamweaver instead of its "result" in the web browser.

Could anyone possibly point me in the right direction as how do I go about opening my PHP pages as I was able to earlier.


#2 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 08 June 2006 - 04:16 PM

How are you trying to display the page now? The correct way is via a UTL specifying the localhost as the server:
[a href=\"http://localhost/Personal%20Website/yoursource.php\" target=\"_blank\"]http://localhost/Personal%20Website/yoursource.php[/a]

Ken

#3 poirot

poirot
  • Members
  • PipPipPip
  • Advanced Member
  • 646 posts
  • LocationAustin, TX

Posted 08 June 2006 - 05:16 PM

Most likely the server is misconfigured.
Try to edit the .htaccess and add a line like:

AddType application/x-httpd-php .php
or
AddHandler php-script php

~ D Kuang




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users