PDA

View Full Version : Basic UNIX questions




ercw
May 4, 2006, 09:29 PM
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 http://www.entropy.ch/software/macosx/php/. 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

Eric



dr_lha
May 4, 2006, 09:33 PM
My questions are:

- if I decided to remove this directory, how do I do that from the mac terminal?

rm -fr /usr/local/php5

- 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?

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

ercw
May 5, 2006, 11:10 AM
I'll dig into this.

Thanks

Eric

yellow
May 5, 2006, 11:26 AM
Since you're getting involoved in the command line (it's enevitable for PHP, mySQL, Apache, etc), here's a great place to start learning about the command line in Darwin:

http://osxfaq.com/Tutorials/LearningCenter/index.ws

jon-chan
May 5, 2006, 12:34 PM
rm -fr /usr/local/php5


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"

dr_lha
May 5, 2006, 12:49 PM
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"
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. ;)

ercw
May 5, 2006, 07:46 PM
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"


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.

mrichmon
May 5, 2006, 10:35 PM
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.

"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. :)

ercw
May 6, 2006, 11:09 AM
"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. :)


Thats why I like the mac so much. thanks