Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

read-only php.ini file is preventing saving new configuration

Tags:

php

ubuntu

pecl

I've installed "PHP PECL EXTENSION/MODULE ON UBUNTU". At the end, I was asked to add some configuration lines in the a file called php_ini that can be found in this path:

/etc/php5/apache2/php.ini

However, after making my changes, I can't save the file because the file is read-only.

What the appropriate action to save my changes. I don't really why the file is read-only, I don't know if there is some thing I need to do. I'm new in Ubuntu/php

Thanks for helping.

like image 420
Richard77 Avatar asked Sep 15 '14 16:09

Richard77


People also ask

How do I save a PHP ini file?

Click on the link to edit the php. ini file. You can see the current version of the file in the editor. After you changed the file click on the Save button to save all changes you have made.

How do I save a PHP ini file in Windows?

In Windows 8 search for the notepad, right click on it and select "run as administrator" then click File and then open your php. ini which is stands by the name of "php" only, then modify it and save it.


2 Answers

For accessing the system files you need root permission.So you would need to use sudo command.it would be like sudo vim /etc/php5/apache2/php.ini(if u are using vim editor) as user2075215 mentioned in comment.

like image 186
Avinash Babu Avatar answered Nov 03 '22 22:11

Avinash Babu


Use command: "sudo gedit /etc/php5/apache2/php.ini"
It will open text editor, change your settings and save with ctrl+s and close the editor.
All changes will be saved.

like image 29
Usman Avatar answered Nov 03 '22 21:11

Usman