Enabling PHP

Discussion in 'macOS' started by chloe.gray, Apr 20, 2009.

  1. chloe.gray macrumors newbie

    Joined:
    Apr 20, 2009
    #1
    Hi,

    I am in Terminal, trying to enable PHP. I have found

    #LoadModule php5_module libexec/apache2/libphp5.so

    but I cannot delete the # sign. When I highlight the # and press delete, nothing happens, but I can delete other letters in this window. Is there another way to enable? I would appreciate any suggestions as to what I might be doing wrong.

    Thanks!

    Chlow:mad:
     
  2. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #2
    What editor are you using i.e., pico, Text Edit, etc.? If you're in Terminal you can't highlight text and type over it or delete, that's why I'm asking. It's easiest to open the httpd.conf file in a GUI editor and work from there.
     
  3. chloe.gray thread starter macrumors newbie

    Joined:
    Apr 20, 2009
    #3
    Thanks for your reply.

    I'm in nano. I'm following a lynda tutorial. I have BB edit on my computer. Where can i find this same file?

    Thanks!

    I meant to say: where can I find the httpd.conf file?

    Thanks!
    Chloe
     
  4. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #4
    I'm not at my mac currently but I believe it was around /private/etc/Apache2/httpd.conf

    Also, you may find that installing MAMP makes the setup of the web server a bit easier. It'll install a newer version of Apache, PHP, MySQL, and some other goodies.
     
  5. chloe.gray thread starter macrumors newbie

    Joined:
    Apr 20, 2009
    #5
    I found the httpd.conf file and was able to edit it. Now I am trying to edit the php.ini file but cannot access it. Do you know how I might do this? I am looking at several different tutorials but am still not able to open and edit php.ini.

    Thanks!
     
  6. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #6
    Here's one way: From Terminal put in the following command,
    Code:
    bbedit /private/etc/php.ini
    Or a different location if that's not where your is. This will open the file in BBEdit, which you mentioned having. In BBEdit you'll notice in the upper-left of the window there's an icon of a pencil with a red line through it. This means you don't have permission to edit it. If you click on the icon it'll prompt you for your administrator account info, at least usually, or if not the red line will disappear. After that you should be able to edit and save any changes you need to make.

    An alternative, to open in TextEdit use the following command,
    Code:
    sudo open -t /private/etc/php.ini.default
    This will prompt your for a password. If you're using a admin account it should work and open the file in TextEdit for you to work with.
     

Share This Page