Gaining Sudo privileges to alter httpd.conf Apache2 file

  • CE/ Pyrocy
  • Proficient
  • Proficient
  • User avatar
  • Posts: 374
  • Loc: Santa Barbara, CA

Post 3+ Months Ago

For some reason I can't change the file to install php on OS X... I'm the admin and have full privileges??? do i need to access the file through terminal with sudo?

I'm trying to install PHP and am trying to change the 2 lines:

Code: [ Select ]
(taking the "#" out)LoadModule php5_module      libexec/apache2/libphp5.so
#LoadModule fastcgi_module     libexec/apache2/mod_fastcgi.so
(and adding this line)AddType application/x-httpd-php .php
  1. (taking the "#" out)LoadModule php5_module      libexec/apache2/libphp5.so
  2. #LoadModule fastcgi_module     libexec/apache2/mod_fastcgi.so
  3. (and adding this line)AddType application/x-httpd-php .php
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • CE/ Pyrocy
  • Proficient
  • Proficient
  • User avatar
  • Posts: 374
  • Loc: Santa Barbara, CA

Post 3+ Months Ago

so it turns out I did have to use "sudo" to change the file.
For any1 that is curious... to access and change the apache2 file httpd.conf in order to "install" php on OS X.

you need to open terminal (WARNING: it is very easy to "F*$(" your system up if you don't know what your doing with the following)

type in:
Code: [ Select ]
sudo pico /etc/apache2/httpd.conf


terminal will return "Password:"
type in your admin password. (what you use to login) you need to have admin privileges on your computer to continue.

also when your typing your password... it wont show that your actually typing anything... but you really are

then hit "ENTER"
a new screen should appear... using the down arrow key... scroll to about line 115 i think... it's the end of the long list of "LoadModule" lines.

look for:
Code: [ Select ]
#LoadModule php5_module      libexec/apache2/libphp5.so

and take out the pound sign in front of the line by using the arrow keys and delete key.

then go past the next line that looks like this:
Code: [ Select ]
#LoadModule fastcgi_module     libexec/apache2/mod_fastcgi.so

and make a new line... type in the following:

Code: [ Select ]
AddType application/x-httpd-php .php

then hit "control+x"

this will ask you if you want to save the file "p.s... i would recommend creating a backup of this file in case things go wrong"

then hit the "y" character on your keyboard to confirm the changes... then hit "enter"... you will be taken back to the main terminal bash window... and your done. if you want it to be active you either reboot your machine or go into

system preferences - sharing - and uncheck and then check the box labeled "web sharing"

and you can check it by making an index.php file and placing it in the sites directory.

hope that helps
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13502
  • Loc: Florida

Post 3+ Months Ago

What does the filesystem for Apache look like on Mac ?

I know on Ubuntu the configuration files are setup in multiple directories and there's specific places other than the main httpd.conf to put directives. I'm just wondering if Mac is the same since I don't have access to a Mac at all.
  • CE/ Pyrocy
  • Proficient
  • Proficient
  • User avatar
  • Posts: 374
  • Loc: Santa Barbara, CA

Post 3+ Months Ago

there's several config files distributed throughout apache subfolders
if that answers your question

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 5 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.