PHP Noob in need! lol

Discussion in 'PHP' started by Pixel T., Sep 4, 2007.

  1. #1
    Hey,

    I'd like to learn PHP but for some reason, when I edit the code, and then save it as .PHP, when I click the icon for it, it comes out in a web browser and I download it. How would I preview my own code?

    Sorry for typing fast, hope you understand.
     
    Pixel T., Sep 4, 2007 IP
  2. YoEli

    YoEli Peon

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    PHP is a preprocessed server side language, you can't just open it up like HTML.

    For it to function you need to have your PHP scripts on a web server with PHP enabled. I myself develop on a packaged setup mostly.

    One setup--the one I use--that will have all the servers/settings you need to get started is VertrigoServ (vertrigo.sourceforge.net), it's free so go download it and have a good time.

    Once you start the server, you can use the icon in the task manager to goto the website, or the folder where you docs are stored.

    Hope this helps.

    Eli
     
    YoEli, Sep 4, 2007 IP
  3. NickD

    NickD Well-Known Member

    Messages:
    262
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    130
    #3
    Another great program that installs PHP, MySQL, Apache on your windows box is EasyPHP :)
     
    NickD, Sep 4, 2007 IP
  4. nabil_kadimi

    nabil_kadimi Well-Known Member

    Messages:
    1,065
    Likes Received:
    69
    Best Answers:
    0
    Trophy Points:
    195
    #4
    Yet another great package is WAMP (Win, Apache, MySQL, PHP)
    - When you install it, you choose where to put the www/ folder;
    - So if you save your file like this c:/.../www/myFirstSite/test.php
    the url to test it will be http://localhost/myFirstSite/test.php
     
    nabil_kadimi, Sep 4, 2007 IP
  5. Arson

    Arson Well-Known Member

    Messages:
    622
    Likes Received:
    27
    Best Answers:
    0
    Trophy Points:
    120
    #5
    Arson, Sep 4, 2007 IP
  6. webrickco

    webrickco Active Member

    Messages:
    268
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    60
    #6
    As to me, i'm very satisfied with UniformServer
     
    webrickco, Sep 5, 2007 IP
  7. MMJ

    MMJ Guest

    Messages:
    460
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #7
    AppServ for me. Lol.
     
    MMJ, Sep 5, 2007 IP
  8. Pixel T.

    Pixel T. Well-Known Member

    Messages:
    1,205
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    170
    #8
    I have downloaded it and installed it. Im just wondering what is it suppose to do? Sorry, noob here
     
    Pixel T., Sep 6, 2007 IP
  9. liam1412

    liam1412 Active Member

    Messages:
    387
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    60
    #9
    Okay here is a quick run down


    Click on the easyphp icon to start the servers. It should come up with a little box with traffic lights on when the server are started they will turn green. You can then minimize this and it will go to your system tray.


    Now if you go into the folder for easyphp in your programme files. Find a folder called www. This is your document root. The document root is where all files you want to be processed by php should be stored. Create a shortcut this folder on your desktop as you need access to it all the time.

    Now as a start just to check all your servers are working


    Open a word document

    Input this

    <?php
    
    echo "If this is written in the browser then we have lift off.";
    
    ?>
    PHP:
    Save this file as test.php to that folder called www.


    Now open your web browser and type the following into the address bar

    http://localhost/test.php

    When you hit enter the above message should appear.

    Lemme know if you need any more help
     
    liam1412, Sep 6, 2007 IP
    Pixel T. likes this.
  10. Pixel T.

    Pixel T. Well-Known Member

    Messages:
    1,205
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    170
    #10

    Thanks man, I got it working. Repped!

    EDIT:

    
    Notice: Uninitialized string offset: 0 in C:\Program Files\EasyPHP 2.0b1\www\PHProxy.class.php on line 1020
    
    Notice: Uninitialized string offset: 0 in C:\Program Files\EasyPHP 2.0b1\www\PHProxy.class.php on line 1023
    
    Notice: Uninitialized string offset: 0 in C:\Program Files\EasyPHP 2.0b1\www\PHProxy.class.php on line 1026
    
    Notice: Uninitialized string offset: 0 in C:\Program Files\EasyPHP 2.0b1\www\PHProxy.class.php on line 1029
    
    Warning: PHProxy::include_once(url_form.inc) [function.PHProxy-include-once]: failed to open stream: No such file or directory in C:\Program Files\EasyPHP 2.0b1\www\PHProxy.class.php on line 435
    
    Warning: PHProxy::include_once() [function.include]: Failed opening 'url_form.inc' for inclusion (include_path='.;C:/Program Files/EasyPHP 2.0b1\php5\pear\') in C:\Program Files\EasyPHP 2.0b1\www\PHProxy.class.php on line 435
    Code (markup):
    Whats that all about? btw, its a PHP code and when I put it in, thats what comes up above the the webpage
     
    Pixel T., Sep 7, 2007 IP
  11. liam1412

    liam1412 Active Member

    Messages:
    387
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    60
    #11
    I take it its a cut and paste of a code. I wouldn't really know withous seeing the code what the problem was.

    Thanks
     
    liam1412, Sep 9, 2007 IP