Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 trying to open private/etc/php.ini.default file to add detect_unicode = Off. But after opening above file with this command vim php.ini.default, it only opens this file as readonly. How can I open this file as writable? I need to add above line of code because I want to install composer and facing some problems and cannot install it without adding above line of code.

share|improve this question

migrated from Jan 22 '13 at 8:39

This question came from our site for professional and enthusiast programmers.

You can force write with :w! or if you don't have permissions you can edit the file with sudo vim. This is a weird question. – user53145 Jan 22 '13 at 5:10
Not weird, just off-topic. – meagar Jan 22 '13 at 5:15
it's weird because vim would give you one of two error messages, "file is readonly, add ! to write" or "permission denied", both of which are googlable, and both are pretty obvious as to what to do. why waste your time asking us? – user53145 Jan 22 '13 at 5:18
I am with @AndyRay on this one mostly because if I read "file is readonly, add ! to write," I add '!' to write. – Khanal Jan 22 '13 at 7:20
up vote 1 down vote accepted

At your own risk, You can use sudo to open and change it. If you need to change it's permission you can use

chmod u+w <filewithpath>
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.