55

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.

karel
  • 122,292
  • 133
  • 301
  • 332
wiry
  • 551

5 Answers5

37

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

Zanna
  • 72,312
waltinator
  • 37,856
18

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

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

14

First come out of the vim editor using: :qa!

Next, use sudo vim filename and later: :wq

Eliah Kagan
  • 119,640
NadZ
  • 241
12

Try the below command

:w !sudo tee %

Explanation, What's happening?

  • :w – write
  • !sudo – call shell sudo command
  • tee – the output of write (:w) command is redirected using tee
  • % – current file name

So, in next Press L to reload.

just this!!!

shgnInc
  • 4,431
1

This happens when the user is trying to write on a file without the right permissions. Login as root using sudo su and now you can do the edit...

Zanna
  • 72,312