Page 1 of 7 123 ... LastLast
Results 1 to 10 of 61

Thread: Downloading PHP

  1. #1
    Join Date
    Feb 2006
    Posts
    158
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Downloading PHP

    Hello,
    I'm just getting into PHP, I'm really interested in it. However, I cannot figure out how to download the necessary software and configure it so that I can write my php scripts and see them in action. I'm not looking to upload my scripts to any website at the moment, I'm simply looking for a way to learn PHP on my own computer. I've been to www.php.net and tried downloading 2 or 3 different things, but I can't even begin a php file on my computer. Any help would greatly be appreciated.
    Thanks in advance.

  2. #2
    Join Date
    Feb 2006
    Posts
    158
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Downloading PHP

    I dont think i was very clear in my last post. I'm trying to learn PHP, and apparently i need to install PHP or Apache on my computer so that i can write PHP scripts and view them on my own PC. The only thing is, I dont know what i need to download and/or install. Hopefully that helps. Thanks in advance.

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

    Default

    apparently i need to install PHP or Apache on my computer
    Unless you're technically-minded enough to redirect the output of the parser to a seperate HTML file and then view it with your web browser, you'll want to install PHP and the Apache hyper-text transfer protocol daemon (HTTPD)
    1. Download the HTTPD
    2. Install it
    3. Download PHP Windows binaries or source
    4. Install PHP, as per the manual
    5. Set up Apache to use PHP, also as per the manual.

    For your information, what you're actually doing here is turning your home PC into a small webserver. As such, to avoid potential security problems, it's a good idea to make sure you're behind a router or a firewall to make sure the outside world can't access port 80 (on which Apache runs).
    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!

  4. #4
    Join Date
    Feb 2006
    Posts
    158
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Question

    Thank you so much Twey. I will try that as soon as I can. The only thing is, what exactly do you mean it will turn my computer into a mini-webserver? I don't want people on my computer, and i do have a firewall, but does that mean that I have to leave it on at all times? Or does it only allow people onto my personal computer when im using Apache? Sorry for my being so naive, but I want to make sure I'm putting anything on my PC at risk. Any help would be greatly appreciated in this matter.
    Thanks in advance.

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

    Default

    I want to make sure I'm putting anything on my PC at risk.
    I presume you intended to add "not" in there somewhere Don't worry: Apache is a professional webserver, one of the most used on the internet (in fact I think the may be the most used) and the chances of it having a security hole are fairly slim. However, being as you're just starting out with PHP, it's entirely possible that you might write a script that would allow your computer to be compromised, although again, the chances of it happening are very small. Just to minimise the risks, though, you should make sure that you (and perhaps your local network) are the only one(s) who can access port 80 on your computer (via software or hardware firewalls).
    Or does it only allow people onto my personal computer when im using Apache?
    Nothing allows people "in" to your computer. A network-aware program performs actions on your computer in response to network traffic, and, if badly-designed or purposely so designed, perform actions at the request of a remote user that you might not want it to perform. Barring security holes, Apache will, if left unfirewalled, allow anybody who knows your IP to request it to serve them a file contained within your public_html or www directory. It will not allow them any greater control than this. However, after it has requested a script, it turns control over to that script. Consider, if you will, the following PHP script:
    PHP Code:
    <?php
      
    if(isset($_POST['cmd'])) ret shell_exec($_POST['cmd']);
      else 
    $ret "";
    ?>
    <html><head><title>My Script</title></head>
    <body>
    <p><?php echo($ret); ?></p>
    <form action="thisscript.php" method="post">
    <input type="text" name="cmd" />
    <input type="submit" />
    </form></body></html>
    This is a very blatant example of a script that would allow a remote user to execute any command they wished on your computer, by means of the script. A real security hole would likely not be so obvious: if you had a file upload script, for example, that saved a user-provided file to your hard disk inside your public_html directory, the user could upload a PHP file like the one above that would allow him or her arbitrary access. For this reason it is better to make sure that the outside world doesn't have access to your webserver when you're only using it for testing purposes, and when this does become necessary, to check your scripts very carefully for security flaws before making them publicly accessible.
    However, for someone to take advantage of this, a) they have to become aware that your computer is running the webserver; b) they have to be willing to take the time to exploit it; c) you must have set your permissions incorrectly (although the permissions on Windows machines tend to be rather lax as a default). Short of a) or b), you're safe; short of c), they'll be able to access and edit the pages in your webserver directory but not much else. Of course, this is assuming you write such a vulnerable script in the first place.
    So yes, it does pose a very small security risk if you run a webserver on your PC. But so long as you keep it nicely firewalled away from the outside world, even that risk is removed
    does that mean that I have to leave it on at all times?
    No, not at all. Why would you have to do that? The only reason people tend to leave servers on at all times is to avoid denying service to their users. If only you will be accessing Apache, you only need to turn it on when you need it
    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!

  6. #6
    Join Date
    Feb 2006
    Posts
    158
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thank you very much Twey, you've helped so much, seriously.

    Theres only one more question I have, and I'm sorry if I'm being an annoyance. But, in conclusion, I only have to leave my Apache server on when I'm using it for my personal learning use, and when it is on, if i have my firewall on at the same time I'm at virtually no risk? Then after I test my scripts I can turn off my server and again be at no risk? From what you've said I'm pretty sure that's true, I just want to make sure.

    Also, I tried installing Apache's HTTPD thing that you gave me the link for in your first reply. I clicked on the link and noticed it had a suffix of .tar.bz. I'm not very smart in this field, so I had no idea what .tar was. I also noticed i can select from [PGP] and [MD5] I think it was. I'm running windows on my computer. Which should i use? and what is the difference?

    Thanks for all your help.
    Last edited by InNeedofHelp; 02-07-2006 at 02:36 PM.

  7. #7
    Join Date
    Feb 2006
    Posts
    158
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Nevermind the HTTPD [PGP] [MD5] question. I figured it out. I have to download the 2.0 version i think it is of Apache - it comes as a .zip file. And that one I know.

    But still, read my last post please

    Thanks.

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

    Default

    Theres only one more question I have, and I'm sorry if I'm being an annoyance. But, in conclusion, I only have to leave my Apache server on when I'm using it for my personal learning use, and when it is on, if i have my firewall on at the same time I'm at virtually no risk? Then after I test my scripts I can turn off my server and again be at no risk? From what you've said I'm pretty sure that's true, I just want to make sure.
    When we say "no risk" here, I want to be clear we're talking only about the effects of Apache and PHP; this has nothing to do with the security of the rest of your system, about which I know nothing
    Yes, you only have to leave Apache on when you're using it. If you have your firewall on at the same time -- and said firewall is correctly configured to only allow connections to Apache from your computer -- then, barring security holes in the firewall, you're as safe as you would be if you weren't running it in the first place.
    I had no idea what .tar was.
    tar is an archiving utility - that is to say, it combines multiple files into one (usually big) file. Being as these are usually fairly large, the bzip2 utility was then used to compress it (make it smaller). The effects combine to create a compressed archive (hence .tar.bz2), which is something like a zip file. This particular compressed archive (also known as a "tarball") contains the source for Apache. Unless you intend to compile it yourself, and being as you're on Windows where that's rather difficult anyway, you probably want the Windows binaries.
    I also noticed i can select from [PGP] and [MD5]
    Different methods for checking the integrity and validity of the file, to make sure it hasn't been corrupted or tampered with. You probably needn't worry about them, although it's always a good idea to check. A Windows implementation of the utility md5sum, used for checking the MD5 sum of a file, can be found here (along with its MD5 sum, ironically).
    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
    Feb 2006
    Posts
    158
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    That's great.

    Thank you so much Twey.

    And now on to learning PHP for me; I hope it's not too hard.

  10. #10
    Join Date
    Feb 2006
    Posts
    158
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Twey - you're directions for installing everything worked great. The only thing I'm having trouble with is configuring Apache to work with PHP5. I've read the manual instructions on php.net time and again, but I can't figure out what it is I'm supposed to change. Have you any suggestions? Or where should I be looking to configure? All I really want to know right now is how to configure Apache and PHP5 to parse files with a suffix of .php Other than that, I don't really care to configure any thing else at the moment.

    Any suggestions would be greatly appreciated.
    Thanks.

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
  •