Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

chloe.gray

macrumors newbie
Original poster
Apr 20, 2009
10
0
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:
 

angelwatt

Moderator emeritus
Aug 16, 2005
7,852
9
USA
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.
 

chloe.gray

macrumors newbie
Original poster
Apr 20, 2009
10
0
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
 

angelwatt

Moderator emeritus
Aug 16, 2005
7,852
9
USA
I meant to say: where can I find the httpd.conf file?

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.
 

chloe.gray

macrumors newbie
Original poster
Apr 20, 2009
10
0
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!
 

angelwatt

Moderator emeritus
Aug 16, 2005
7,852
9
USA
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!

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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.