Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using lamp on my computer for development only.The problem is that i can not make any changes to it because the owner in root.How could i change the permissions to it.Its realy frustrating.

share|improve this question

Changing the ownership and permissions of system files is not a good idea and can result in this particular case you may be able to "get away" with this change, in general changing ownership and permissions on system files is asking for problems ranging from security to system failures.

You should edit the files as root

# Command line
sudo -e /path/to/php.ini

# Graphical
gksu gedit /path/to/php.ini

If you do not have root access talk to your system administrator.

See for further information.

share|improve this answer

You can change the owner of file once and then make changes to it as you do to any other file you own. You need to run:

sudo chown user /path/to/your/file/php.ini

Where user is your username.

To make sure any user on system can read (but not edit it):

chmod 644 /path/to/your/file/php.ini

share|improve this answer

I assume you're working/testing a particular application and need the PHP configuration to be changed for that, and in this case you can simply "Sudo" edit that.

If you installed a stack version using either Tasksel or aptitude, the wollowing will work

sudo nano /etc/php5/apache2/php.ini

If you like you can use gedit as well.

However, if you want to edit/make frequent changes, you can change the file ownership to the userid you use during your development.

You can use,

sudo chown oli_dev /etc/php5/apache2/php.ini

oli_dev being your user name and /etc/php5/apache2/php.ini being your primary php configuration file.

In case you're unsure of the php.ini file used by your interpreter, use phpinfo() inside a test script and call it in browser. It should help you locate the configuration file loaded.

Hope this helps, plz do revert if you need more assistance.


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.