Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Applications > How do you get permission to edit a php.Ini file by using terminal?

How do you get permission to edit a php.Ini file by using terminal?
Thread Tools
Fresh-Faced Recruit
Join Date: Jan 2006
Status: Offline
Reply With Quote
May 7, 2007, 12:48 AM
 
okay. I need to edit this php.ini but How do you get permission to edit the php.Ini file by using terminal?
     
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
May 7, 2007, 01:09 AM
 
Use sudo.
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
Fresh-Faced Recruit
Join Date: Jan 2006
Status: Offline
Reply With Quote
May 7, 2007, 01:12 AM
 
I tried that and this what happens:

damian-hynes-computer:~ Damo$ sudo /usr/local/php5/lib/php.ini
sudo: /usr/local/php5/lib/php.ini: command not found
     
Clinically Insane
Join Date: Oct 2000
Location: Los Angeles
Status: Offline
Reply With Quote
May 7, 2007, 01:15 AM
 
Don't you have to do something like authenticate using sudo and then open the file using one of the text editors? It looks like you're just writing sudo and then typing the path to the file, but then again I may have missed something because that's an obvious thing.

"The natural progress of things is for liberty to yield and government to gain ground." TJ
     
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
May 7, 2007, 01:30 AM
 
Sudo gives the command it's executed with permission to affect the file; it doesn't do anything to the file itself. I'm not sure what the permissions on the file are, but you might be able to do something like sudo chmod g+w /usr/local/lib/php.ini. Of course, you'd want to reverse that afterward unless you want to leave the file with looser permissions.
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
Senior User
Join Date: Jul 2002
Location: Arizona Wasteland
Status: Offline
Reply With Quote
May 7, 2007, 02:00 AM
 
Make sure you make a backup of that file first (or maybe your entire drive). I say this because it doesn't sound like you know what you are doing. And not knowing what you are doing with sudo will lead to disaster.

By default php.ini isn't in /usr/local/php5/lib which makes me think you installed some package, which makes me wonder why it's not already read/writeable by you. If the reason is you don't know how to open and edit a file, then the correct command to use is:

'pico /usr/local/php5/lib/php.ini'

If the reason is you don't know how to use sudo then the syntax for sudo is

sudo [I]program to execute as root/I]

So to edit /usr/local/php5/lib/php.ini' as root the command would be:

sudo pico /usr/local/php5/lib/php.ini

WARNING: Improper use of the sudo command could lead to data loss or the deletion of important system files. Please double-check your typing when using sudo.
     
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
May 7, 2007, 09:00 AM
 
Apple's php.ini is in /etc (or /private/etc, which is the same thing)
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 04:28 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2