Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

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 want to change the upload_max_filesize = 2M to 50M, then I started edit on php.ini, but when try to save it, it displays error message below

Could not create a backup file while saving /etc/php5/apache2/php.ini

gedit could not back up the old copy of the file before saving the new one. You can ignore this warning and save the file anyway, but if an error occurs while saving, you could lose the old copy of the file. Save anyway?

cannot save php.ini

share|improve this question
up vote 21 down vote accepted

You are opening that file in a folder owned by root! Hence you need root access to that file. Type this code in the terminal:

gksudo gedit /etc/php5/apache2/php.ini

When the file opens edit the file and you can save it normally by pressing Ctrl+S.

share|improve this answer
Thank you Ravi, it works fine by your command.. – Ashok KS Jun 7 '12 at 7:01
I have edited the answer. The root folder is /, the file is in another place. – Javier Rivera Jun 7 '12 at 7:12
@JavierRivera Thanks! – Ravi Jun 7 '12 at 7:13

You don't have permission when your text editor creates a backup file.

You can either

  1. Run gedit using administrative permission.

$ sudo gedit /etc/php5/apache2/php.ini

In this part gedit will create a backup file with root permission. A new file will be create with root as an owner.


  1. You can disable the gedit feature thats create backup copy before saving.

    a. Go to Edit -> Preferences -> Editor.

    b. Unchecked Create a backup copy of files before saving.

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.