E45 readonly option is set (add ! to override)

I'm trying to configure the extension mcrypt in my Ubuntu Server VirtualBox for work in my phpMyAdmin page.

I ran vi /etc/php5/mods-available/mcrypt.ini and then I changed extension=mcrypt.so to extension=/usr/lib/php5/20121212/mcrypt.­so and when I tried to save changes it said this:

E45 readonly option is set (add ! to override)

I think that maybe I made a mistake deleting something before extension=mcrypt.os and I don't know what to do.


Solution 1:

Probably the user you ran vi /etc/php5/mods-available/mcrypt.ini as did not have write access to the file. vi notices this on file open, and, when you try to save the file, gives you the E45error, and reminds you that you could attempt to override the read-onlyness of the file by appending '!' to the command.

For example, if you edited a file owned by your user, protected 444 (r--r--r--), you would get this message when you did the :wq, but could try to force the write with :wq!. In your case, I suggest doing ls -l /etc/php5/mods-available/mcrypt.ini. To actually edit the file, you could use sudo to temporarily use the power of root, and do sudo vi /etc/php5/mods-available/mcrypt.ini

Solution 2:

You can press Esc , and then U , and then type :q .

You can try opening the file with sudo privilege: sudo vi <file_name>