Results 1 to 9 of 9

Thread: Viewing PHP pages locally

  1. #1
    Join Date
    May 2007
    Location
    England, UK
    Posts
    235
    Thanks
    3
    Thanked 6 Times in 6 Posts

    Question Viewing PHP pages locally

    Is there any way that I can test my PHP pages locally rather than having to upload them first. (using IE and firefox)

    If i try and load my index.php page locally the browsers that I use try to download the php file instead of displaying them.

    any ideas?
    Last edited by jc_gmk; 06-13-2007 at 08:39 AM.

  2. #2
    Join Date
    May 2006
    Location
    Sydney, Australia - Near the coast.
    Posts
    1,995
    Thanks
    0
    Thanked 8 Times in 7 Posts

    Default

    You could make your computer a local server.
    Download a WAMPP package (I would recommend this) and install it.
    Your home directory would be drive name:\xampp\htdocs
    Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
    Currently: enjoying the early holidays :)
    Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide

  3. #3
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Browsers don't parse PHP. You need a server.
    Either make your computer a server as tech_support says, or just upload to your server and test from there.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  4. #4
    Join Date
    Jun 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    use easyphp

    easyphp.org

  5. #5
    Join Date
    Mar 2007
    Posts
    38
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Download http://www.devside.net/server/webdeveloper

    I used this absolutely brilliant bit of software that makes your PC a localhost in seconds.....and its free

    ps...just look at all the stuff you get with it, scroll down the devside website and look at components.

    -NairB

  6. #6
    Join Date
    May 2007
    Location
    England, UK
    Posts
    235
    Thanks
    3
    Thanked 6 Times in 6 Posts

    Default

    I've now made my pc a server by installing Apache.
    It works fine I can view all my PHP pages locally execpt if I try and connect to a remote MySQL database (not stored locally.)

    I get the message:

    Warning: mysql_connect() [function.mysql-connect]: Access denied for user: 'myusername@123.123.123.123' (Using password: YES) in K:\Websites\index.php on line 2
    Access denied for user: 'myusername@123.123.123.123' (Using password: YES)


    Any Ideas?

  7. #7
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by jc_gmk View Post
    ... I can view all my PHP pages locally execpt if I try and connect to a remote MySQL database (not stored locally.)
    The best security for a database server is achieved not only when user credentials are checked, but also the IP address of the incoming connection. As your request will come from an unrecognised IP address, it will be rejected - at least that's what I would expect.
    Mike

  8. #8
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Yes, you'll need to modify the permissions on the database server to allow access from your PC.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  9. #9
    Join Date
    May 2007
    Location
    England, UK
    Posts
    235
    Thanks
    3
    Thanked 6 Times in 6 Posts

    Default

    Any ideas how I do that?
    Do I need to edit one of the files?

    The server isn't my own it is provided by a hosting company.

Bookmarks

Posting Permissions

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