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 4 of 4

Thread: PHP Testing

  1. #1
    New to the CF scene
    Join Date
    Sep 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question PHP Testing

    Hi folks,

    This question may have already been asked but I haven't seen it as of yet.

    I'm not a coding expert and I'm egar to get in to it more, but I don't want to pay a monthly subscription to a website, just to test my coding.

    Most free websites give you the annoying templates and don't accept anything other than HTML.



    Is there a website / freeware that I can download to test it in? So far I've been learning the theory, no practise yet

  • #2
    Senior Coder
    Join Date
    Jul 2011
    Posts
    1,226
    Thanks
    3
    Thanked 171 Times in 171 Posts
    Why not run your code from your local machine? I'm guessing you use windows, look up WAMP. That will give you all the tools you need to run a local web server.

    And/or, codepad.org is a great tool that I use quite a bit when answering questions here and for many other tasks. It allows you to run code (obviously you can't use mysql, sockets or other such functions) for multiple languages - php happens to be one of them . It also gives you the ability to save snippets, and share snippets with other people.

  • #3
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,352
    Thanks
    61
    Thanked 528 Times in 515 Posts
    There are several varieties of WAMP the two most popular are XAMPP and (IMO) the uniformserver. Both will turn up on google.

    They contain everything you need: Apache (Webserver), PHP (script programming language), MySQL (Database engine) and a sendmail variant (for connecting via SMTP and sending emails through PHPs mail() function).

    With both wamp systems you can run them manually via a script or install them as system services (which means they run in the background before you logon to your machine and they continue to run if you logoff). Both systems are suitable for hosting your website to the public not just testing however if you choose to do this ensure you have a firewall and I highly recommend running the wamp in a virtual computer - preferably on a seperate physical machine if you have one spare. For testing though you'll be fine running it on your main machine.

    Also, there are a few websites that allow you to test and run PHP code online in your browser. freephptest.com is the first one that springs to mind. You can't use sockets or connect to a database but you can test out other bits of code (eg testing a function) which is very convenient.

    As far as an editor goes, I use notepad++ which supports many languages and also allows you (with a pretty hard to find plugin which I can supply if you can't find it) to debug your php using xdebug. This allows you to inspect the values that variables hold at runtime and step through the code line by line.

    @BP: I just tried codepad.org and for my code I used:
    PHP Code:
    print 'test'
    Shockingly the actual output was : print 'test';


    In other words it didn't run any code. Thats either intentional or its broken.
    Last edited by tangoforce; 09-13-2011 at 12:47 PM.
    See my new CodingForums Blog: http://www.codingforums.com/blogs/tangoforce/

    Many useful explanations and tips including: Cannot modify headers - already sent, The IE if (isset($_POST['submit'])) bug explained, unexpected T_CONSTANT_ENCAPSED_STRING, debugging tips and much more!

  • #4
    Senior Coder
    Join Date
    Jul 2011
    Posts
    1,226
    Thanks
    3
    Thanked 171 Times in 171 Posts
    Quote Originally Posted by tangoforce View Post
    There are several varieties of WAMP the two most popular are XAMPP and (IMO) the uniformserver. Both will turn up on google.

    They contain everything you need: Apache (Webserver), PHP (script programming language), MySQL (Database engine) and a sendmail variant (for connecting via SMTP and sending emails through PHPs mail() function).

    With both wamp systems you can run them manually via a script or install them as system services (which means they run in the background before you logon to your machine and they continue to run if you logoff). Both systems are suitable for hosting your website to the public not just testing however if you choose to do this ensure you have a firewall and I highly recommend running the wamp in a virtual computer - preferably on a seperate physical machine if you have one spare. For testing though you'll be fine running it on your main machine.

    Also, there are a few websites that allow you to test and run PHP code online in your browser. freephptest.com is the first one that springs to mind. You can't use sockets or connect to a database but you can test out other bits of code (eg testing a function) which is very convenient.

    As far as an editor goes, I use notepad++ which supports many languages and also allows you (with a pretty hard to find plugin which I can supply if you can't find it) to debug your php using xdebug. This allows you to inspect the values that variables hold at runtime and step through the code line by line.

    @BP: I just tried codepad.org and for my code I used:
    PHP Code:
    print 'test'
    Shockingly the actual output was : print 'test';


    In other words it didn't run any code. Thats either intentional or its broken.
    The annoying thing about codepad, is for PHP you have to wrap in <?php to execute. It's a minor annoyance though haha.

    Personally, I don't like notepad++. I prefer netbeans, which has xdebug support built in. Also has some convenient version control utilities using SVN, mercurial and one other whose name escapes me.


  •  

    Posting Permissions

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