1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

How to test PHP script offline?

Discussion in 'PHP' started by hhheng, May 19, 2007.

  1. #1
    I'm learning PHP script now, and each time when I want to test some php scripts, I have to upload the file to my server to see the result. How to preview the result without uploading the script to server?

    BTW, I'm using dreamweaver and notepad to edit the php script.
     
    hhheng, May 19, 2007 IP
  2. CodyRo

    CodyRo Peon

    Messages:
    365
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You'll need to install Apache, MySQL, and PHP (or some alternative, but it's the most popular).

    Theres a few applications that make this easy for you.. I personally use EasyPHP.
     
    CodyRo, May 19, 2007 IP
  3. tamilsoft

    tamilsoft Banned

    Messages:
    1,155
    Likes Received:
    78
    Best Answers:
    0
    Trophy Points:
    0
    #3
    tamilsoft, May 19, 2007 IP
  4. coderbari

    coderbari Well-Known Member

    Messages:
    3,168
    Likes Received:
    193
    Best Answers:
    0
    Trophy Points:
    135
    #4
    if your OS is windows then there are many insatllers available online(XAMPP,WAMP,LAMP,PHPTRIAD,EASYPHP).these are setup file.you just need to follow instllation instructions.
    these are also available for LINUX.
    after installing them you will have htdocs folder,there you have to copy your scripts and run from your browser localhost/script name

    and one thing,try to find the most updated installer with all recent version of PHP,APACHE,MYSQL
     
    coderbari, May 20, 2007 IP
  5. Squid

    Squid Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I always test my programs on my laptop with http://www.uniformserver.com/ because it operates off a virtual drive W.
     
    Squid, May 20, 2007 IP
  6. ibrahim_mhmd

    ibrahim_mhmd Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    You can try using QuickPHP. It's perfect for beginners as there's no need to install anything. Simply download and run and you'll have yourself a little web server which runs PHP scripts.

    If anyone is interested, visit the QuickPHP page here: http://www.zachsaw.co.cc/?pg=quickphp_php_tester_debugger&sub=quickphp_php_tester_debugger_moreinfo
     
    ibrahim_mhmd, Jul 20, 2008 IP
  7. Ecreation

    Ecreation Active Member

    Messages:
    823
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    68
    #7
    I use WAMP server.Its easy to install and bundled with apache, mysql, phpmyadmin,SQLLitemanager. Happy PHPing.
     
    Ecreation, Jul 20, 2008 IP
  8. Rory M

    Rory M Peon

    Messages:
    1,020
    Likes Received:
    37
    Best Answers:
    0
    Trophy Points:
    0
    #8
    I use MAMP (Wamp for Macs surprisingly :p)
     
    Rory M, Jul 20, 2008 IP
  9. 4220niller

    4220niller Peon

    Messages:
    35
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Just install WAMP or XAMPP server :)
     
    4220niller, Jul 20, 2008 IP
  10. Cash Nebula

    Cash Nebula Peon

    Messages:
    1,197
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Better yet, get XMAPP Lite for Windows
    It's great. :) Just remember to set it up correctly:
    - set Listen localhost:80 in httpd.conf
    - setup a mysql password.
     
    Cash Nebula, Jul 21, 2008 IP
  11. kosmik

    kosmik Peon

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    If you're looking for something simple to install and requires zero configuration, EasyPHP is the one.

    There's a step-by-step tutorial here too:

    http://klikr.net/local-test/
     
    kosmik, Dec 19, 2008 IP
  12. sitemasters

    sitemasters Peon

    Messages:
    66
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #12
    I need someone to help me with WAMP.

    The root directory is wamp/www/ which is default and I tried to load a script which I downloaded from the net. I tried copying the entire contents of the script to wamp/www/ folder and then accessing http://localhost/myscript/install/index.php . I just get the following error message:

    Internal Server Error

    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator, admin@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    More information about this error may be available in the server error log.

    I have configured WAMP properly. I'm able to see the test page when I goto http://localhost.

    What is the problem? Am I doing it wrong?

    Please help.


    Thanks in advance.
     
    sitemasters, Jan 18, 2009 IP
  13. riteshsanap

    riteshsanap Well-Known Member

    Messages:
    217
    Likes Received:
    2
    Best Answers:
    3
    Trophy Points:
    118
    #13
    riteshsanap, Nov 30, 2010 IP
  14. koula

    koula Peon

    Messages:
    23
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #14
    I recommend XAMPP, personally i had problems with WAMP but that happens 4 years ago.
     
    koula, Dec 1, 2010 IP
  15. techbongo

    techbongo Active Member

    Messages:
    309
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    80
    #15
    I'll like to suggest Apache2Triad. It's my any day first choice, because of its simplicity. Specially if you want to use the server as local one, Apace2Triad is the best.
    PHP, MySQL, CGI, Python is bundled within it. And you get handy tools like PHPMyAdmin, a easy-to-use Control Panel, Email Reader, FTP, PHPPGAdmin.
     
    techbongo, Dec 1, 2010 IP
  16. GabrielBianconi

    GabrielBianconi Peon

    Messages:
    27
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #16
    Download XAMPP or WAMP. It has everything you need.
     
    GabrielBianconi, Dec 3, 2010 IP
  17. sukosari

    sukosari Active Member

    Messages:
    63
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    93
    #17
    I use Eazyphp. it's simple
     
    sukosari, Dec 3, 2010 IP
  18. onlineworkers

    onlineworkers Active Member

    Messages:
    253
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #18
    I use Wamp, its good.
     
    onlineworkers, Dec 5, 2010 IP
  19. riteshsanap

    riteshsanap Well-Known Member

    Messages:
    217
    Likes Received:
    2
    Best Answers:
    3
    Trophy Points:
    118
    #19
    Ya i too use WAMP , its great for testing and trying out scripts offline
     
    riteshsanap, Dec 5, 2010 IP
  20. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #20
    Well, what does the serverlogs say? The reason this doesn't work, might for example be a rogue .htaccess file (which isn't supported by the loaded extensions), or something similar. It's always hard to tell without having access to any logs or similar.

    Just to give you a hint: I installed WampServer2 on my laptop, because I was on a wifi-net which didn't allow normal FTP. So I needed a place to test my theme-making for Wordpress. Anyway, when I loaded my WIP theme, it didn't load at all - it turned out I was using a .htaccess entry which defined cache-options, and that wasn't supported out of the box on the server. Just FYI.
     
    PoPSiCLe, Dec 5, 2010 IP