Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 stackoverflow.com Jan 22 '13 at 8:39

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

1  
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
2  
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

1 Answer 1

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

 
discard

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.