Terminal Help

Discussion in 'Mac Apps and Mac App Store' started by demuro1, Nov 8, 2012.

  1. macrumors newbie

    Aug 20, 2007
    I was hoping someone familiar with terminal could help me out.

    I am taking a class on unix and another class on web development. Somehow between the two classes I have encountered a difference eon my mac that I'd like to fix.

    depending on what network I am on my hostname changes in terminal. I have enabled php but apache is currently off.

    Does anyone have any advice they can offer here?

    Thanks in advance.
  2. kgs
    macrumors regular

    Jul 29, 2012
    If all you're trying to do is setup apache with php, you should probably just try this:


    At least on your Mac.

    That said, I'm not entirely sure I understand your question. You say hostname, and then php and apache. What exactly are you trying to do?
  3. thread starter macrumors newbie

    Aug 20, 2007
    I am experiencing strange behavior in terminal. I am attaching a photo. everything before :~demuro1$ in the terminal window changes depending on the network I'm on and the whether I am connected to a network or not.

    I am taking two classes, one has to do with linux/unix and the other has to do with web development. I have enabled php and apache on my mac.

    I think one of the above listed items is at fault for this new behavior in terminal. Is there anything you might suggest that can correct this issue?

  4. macrumors 6502a

    Apr 30, 2008
    USA (Virginia)
    I don't think it has anything to do with you enabling php and apache. I say this because I've seen similar behavior with my MacBook Pro on my home network.

    Like you, I have the hostname as part of my command prompt in Terminal. (You can also see the current hostname by typing the command 'hostname'.)

    I haven't completely figured this out, but I believe it has to do with whether my portable connects to my network through the wireless 802.11n (Airport) interface or through the wired ethernet cable interface. I get one hostname one way, and a different one the other way.

    I suspect that my DHCP server is assigning a hostname when the computer connects via the ethernet cable interface, instead of using the hostname I've set on the computer.
  5. kgs
    macrumors regular

    Jul 29, 2012
    That is called the command prompt. It is most likely BASH.. you can change it using the instructions here:


    It has nothing to do with php or apache. That's a web server. Only used really for web pages.

Share This Page