Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Jul 2007
    Posts
    67
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Running PHP files

    I have a html file with some php snippets inside. I saved it as index.php and now I want to run it. When I open it with a web browser it just displays the code I typed in.

    I have php, mysql and apache installed on my computer, but dont know how to use them.

  • #2
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    2,958
    Thanks
    2
    Thanked 304 Times in 296 Posts
    I'll assume that you have put the index.php file into the Apache web server's document root folder and are opening it in your browser using something like - http://localhost/index.php

    If you are doing both of the above and are seeing the actual source php code in the browser, then either php is not setup to work with the Apache web server or you are possibly using short open tags <? instead of <?php.

    Tell us more about what you are doing and what you have done up to this point when you installed PHP.
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.

  • #3
    New Coder
    Join Date
    Jul 2007
    Posts
    67
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Well, I don't really know where my Apache root folder is.

  • #4
    Senior Coder rafiki's Avatar
    Join Date
    Aug 2006
    Location
    Floating around somewhere...
    Posts
    2,042
    Thanks
    19
    Thanked 42 Times in 42 Posts
    XAMPP google it download it and install it. its that simple great application too

  • #5
    New Coder
    Join Date
    Jul 2007
    Posts
    67
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Nevermind, I figured it out.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •