Basic UNIX questions

Discussion in 'Mac Programming' started by ercw, May 4, 2006.

  1. ercw macrumors regular

    May 4, 2006
    I am in the process of attempting to connect the dots in my learning of dynamic sites. I decided to learn the concept of PHP and MySQL. I'm taking it very slow as I have a very limited knowledge of scripting. I like to start on a solid base of understanding what I'm doing instead of blindly jumping too far ahead of myself.

    I have installed the PHP5 package from It seem to work fine on my local apache server.

    The instructions explain that if I want to remove this package, I'll have to remove the directory: /usr/local/php5. Being the novice I am, I was looking for a folder that looked like that but I realized this was at the unix level of my computer.

    My questions are:

    - if I decided to remove this directory, how do I do that from the mac terminal?
    - How do I find and open the Apache config file: /etc/httpd/httpd.conf and how do I delete a specific line in this file?

    I would greatly appreciate any help.
    Thank you

  2. dr_lha macrumors 68000

    Oct 8, 2003
    rm -fr /usr/local/php5
    Open the file in a text editor of your choosing and delete the line, then save it. Note you'll probably have to have elevated privaledges to do this. From a terminal you could do:

    sudo nano /etc/httpd/httpd.conf
  3. ercw thread starter macrumors regular

    May 4, 2006
  4. yellow Moderator emeritus


    Oct 21, 2003
    Portland, OR
  5. jon-chan macrumors newbie

    Feb 27, 2006
    A simple warning to ercw, be VERY careful when using "rm -rf" commands. Especially with SUDO. For someone not familiar with UNIX/LINUX I would suggest navigating to the /usr/local directory using the finder and dragging "php5" to the trash. Use the Finder "Go" Menu --->> "Go To Folder"
  6. dr_lha macrumors 68000

    Oct 8, 2003
    On the other hand I find people learn UNIX very quickly after the accidentally delete their entire hard drive. Its a learning experience, everyone should do it at least once in their lives. ;)
  7. ercw thread starter macrumors regular

    May 4, 2006

    That's very good advice! you helped me find that folder that lives inside the "USR" folder. Why didn't think of this method! I would have never found it.
    where exactly does this "usr" folder lives in my machine? cause it wouldn' t even show up by making a local serch on my drive.
  8. mrichmon macrumors 6502a

    Jun 17, 2003
    "usr" resides in the root directory of your system disk. You would not have found it using the finder because usr along with many other folders are set to be hidden from view in the finder.

    Hiding these folders results in an uncluttered finder and for the most part prevents users from seeing things that they generally should not be poking at. :)
  9. ercw thread starter macrumors regular

    May 4, 2006

    Thats why I like the mac so much. thanks

Share This Page