SitePoint Sponsor

User Tag List

View Poll Results: How do you test your PHP scripts/apps?

Voters
21. You may not vote on this poll
  • External Host

    3 14.29%
  • Local Machine

    17 80.95%
  • Something else, just let me know what.

    1 4.76%
Results 1 to 17 of 17
  1. #1
    Evil Genius MilchstrabeStern's Avatar
    Join Date
    Nov 2003
    Location
    Arizona
    Posts
    1,131
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Local Machine, or external Host?

    How do you test your PHP apps/scripts?

    Personally I've always used my Host, and just uploaded the files and checked them in the browser. But I was sheltered, and wasn't even aware PHP could be installed on my personal machine. Plus, I always thought it would be a major hassle to install php, mysql, apache, I never found the motivation to do it.

    What do you guys do, and why?
    ]

  2. #2
    SitePoint Addict
    Join Date
    Jun 2005
    Posts
    262
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I do most work on localhost PC. It's more convenient.

    My localhost config:
    apache_2.0.46-win32-x86-no_src.msi
    php-4.4.0-Win32.zip
    mysql-essential-4.1.13-win32.msi

    Windows File Layout:
    C:\Server\Apache2\bin
    C:\Server\Apache2\conf\httpd.conf
    C:\Server\Apache2\...etc, etc, etc

    C:\Server\PHP4_4_0
    C:\Server\PHP4_4_0\extensions
    C:\Server\PHP4_4_0\php.ini
    C:\Server\PHP4_4_0\...etc, etc, etc

    C:\Program Files\MySQL\MySQL Server 4.1
    C:\Program Files\MySQL\MySQL Server 4.1\my.ini
    C:\WINDOWS\my.ini

    my apache httpd.conf document root:
    DocumentRoot "D:/home/html"

    When reformatting windows, backup the following:
    C:\Server\Apache2\conf\httpd.conf
    C:\Server\PHP4_4_0\php.ini
    C:\Program Files\MySQL\MySQL Server 4.1\my.ini
    C:\Program Files\MySQL\MySQL Server 4.1\data\*
    C:\WINDOWS\my.ini

    Installation of the above testing environment is just a matter of installing apache, mysql, and unzipping PHP. The whole process takes about 2 minutes.

  3. #3
    SitePoint Wizard bronze trophy Tyssen's Avatar
    Join Date
    Oct 2005
    Location
    Brisbane, QLD
    Posts
    4,067
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Get yourself a copy of XAMPP and you'll be up and running in no time.

  4. #4
    SitePoint Member
    Join Date
    Jun 2006
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I use localhost, and remote when im lazy.
    Websoft Blog Web Software Blog
    Gaming Wise Web Gaming Network with a Twist
    Seekpire Make money searching!

  5. #5
    SitePoint Wizard silver trophy
    Join Date
    Mar 2006
    Posts
    6,132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    local machine.

    when im coding it drives me nuts to have the ftp the file every tiny change i make.

    i develop on my local box, and then give it a good test on the production server.

  6. #6
    SitePoint Enthusiast
    Join Date
    Jul 2005
    Location
    Dallas, TX, USA
    Posts
    49
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I hope it is ok if I add questions to this thread.

    I checked my test version of mysql (IB Server product), and it is at version 3. r937 has been assisting me in some DB queries which have not worked due to me being on version 3. I checked out the link above (XAMPP), installed the software, and have a few questions.

    1) After the install, I was asked if I wanted these as services? What does this mean?

    2) I have been using IB Server. I place all my files in a folder called "www". Where do I place my files using XAMPP so I can see them using a browser at "localhost"?

    Thank you.
    Last edited by jandk; Jul 4, 2006 at 10:59.

  7. #7
    play of mind Ernie1's Avatar
    Join Date
    Sep 2005
    Posts
    1,252
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Apache 2.0.54
    php-4.4.0-Win32.zip
    mysql 5.0.18
    phpMyAdmin 2.7.0-pl2

    They all work like a charm on my local machine.
    I wouldn't even think it to work on my host because it's hard to check errors and the coding would take a lot of time.
    my mobile portal
    ghiris.ro

  8. #8
    SitePoint Wizard bronze trophy Immerse's Avatar
    Join Date
    Mar 2006
    Location
    Netherlands
    Posts
    1,661
    Mentioned
    7 Post(s)
    Tagged
    1 Thread(s)
    I test my stuff mostly on another PC within my network at home (a crappy old slo-mo laptop), it's easy 'cos I can map the web folders to a share on my proper PC. After about every 16 or so hours of development, I upload everything to my host and then do some pretty thorough testing there to make sure everything works as expected on linux-type platforms.

    I'm almost at the point now where I think I'll install Ubuntu or something onto the laptop, as that might be more representative of a 'real-life' situation.

  9. #9

  10. #10
    SitePoint Enthusiast
    Join Date
    Jul 2006
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I use an external host, although I useto develop locally, and I must say it improves development deployment time alot, although currently the box that I useto develop on is fried, so I program in editplus + nice little nifty upload feature, to auto keep track of client/server files and upload... makes it with ease, so I like it for the time being, while I do not have the time to sit down and setup a local dev. environment.

  11. #11
    Evil Genius MilchstrabeStern's Avatar
    Join Date
    Nov 2003
    Location
    Arizona
    Posts
    1,131
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Since I started this thread I've installed PHP 5, MySQL 5, and Apache 2 onto my Windows machine (WAMP). I MUCH prefer being able to hit ctrl + s and view my script. Not having to use an FTP program to upload my files, just for testing, has helped a ton. Although I could use dreamweaver to auto upload.
    ]

  12. #12
    SitePoint Enthusiast
    Join Date
    Jul 2005
    Location
    Dallas, TX, USA
    Posts
    49
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the replies. Any thoughts to question #2? I think I will continue to use my laptop/notebook for testing. I travel quite a bit. The server on my computer works well when I'm on a plane. I can work on things in-flight. So since I will continue to do this, where would I place my files?

    Thanks.

  13. #13
    Evil Genius MilchstrabeStern's Avatar
    Join Date
    Nov 2003
    Location
    Arizona
    Posts
    1,131
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wherever you set the directory to in the apache config file (I think?). I think the default is a /www/. So when you type localhost/ in your browser, that will be the directory.
    ]

  14. #14
    SitePoint Wizard cranial-bore's Avatar
    Join Date
    Jan 2002
    Location
    Australia
    Posts
    2,634
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Any thoughts to question #2?
    The htdocs folder in the apache directory (wherever you installed it) is where documents are served from.
    Thus http://localhost/ will by default serve ...Apache/htdocs/index.html

    Also, if you haven't already, you should edit your apache config file to treat index.php files as a valid index. Just look for the line that says index.html and append to it.

    When I was starting PHP I uploaded each time and essentially built my first site online. Bad idea, as it cost about $200 in dial up usage charges.

    I wouldn't even consider being without a local setup now. Also dual monitors can help too, code on the left, browser on the right and you can see your changes more quickly.
    mikehealy.com.au
    diigital.com art, design . Latest WorkSaturday Morning

  15. #15
    SitePoint Wizard HarryR's Avatar
    Join Date
    Dec 2004
    Location
    London, UK
    Posts
    1,376
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    At the moment I'm using both a local Apache/PHP/MySQL instance for testing, as well as a 'nearly production' environment setup using VMWare with the same os/packages/setup as the production environment.

  16. #16
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,806
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    online host.
    Purely because the host is running linux and I am running XP/IIS, they have php 4.xx and I have php5, they have GD2.x and I have something entirely different, I have error reporting set to maximum they have it at low. So basically my localhost would behave VERY differently to the server.

    So writing the site that would run on my machine perfectly and bug free might not work on my server because of incompatability so I might as well write it once and ftp it.
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  17. #17
    SitePoint Enthusiast
    Join Date
    Jul 2005
    Location
    Dallas, TX, USA
    Posts
    49
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks. I found the folder and changed the index file name to index1 to force a directory if I had the right folder and file. I received the directory on the web page. So that's good and will place my files there.

    FYI - the server files are located in htdocs folder but not in the apache directory. It followed this path: xampp\htdocs\xampp\index.php. Just thought you'd like to know.

    Also, one other question, I had another local server as I mentioned before. When I installed XAMPP, the DB was directed to my previous DB. When I click on the new phpAdmin, all my DB data is there and I haven't loaded anything. Could someone please explain why this happened? Did XAMPP look for an existing DB when it was installed and point to it?

    Thank you all.


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
  •