$Three3 Posted December 4, 2009 Share Posted December 4, 2009 Hi, I have been trying to edit my php.ini file through the command line using putty. I need to edit this: max_upload_filesize = 2M I need it to be 10MB. Any instructions would be great. I am on a virtual dedicated server so I have ssh access. I can also use instructions for a Mac or PC so let me know. Thanks! Quote Link to comment Share on other sites More sharing options...
Zane Posted December 4, 2009 Share Posted December 4, 2009 I've never edited this setting but I'd imagine it's as easy as this max_upload_filesize = 10M Although you may have to restart Apache directly afterwards Quote Link to comment Share on other sites More sharing options...
premiso Posted December 4, 2009 Share Posted December 4, 2009 If you have SSH access use the vi editor (given that its a *nix based sever). Quote Link to comment Share on other sites More sharing options...
trq Posted December 4, 2009 Share Posted December 4, 2009 Simplest way is probably using sed. sudo sed -i 's/upload_max_filesize = 2M/upload_max_filesize = 10M/' /etc/php.ini You may need to change the last part to point to where your ini file is. Quote Link to comment Share on other sites More sharing options...
$Three3 Posted December 4, 2009 Author Share Posted December 4, 2009 If you have SSH access use the vi editor (given that its a *nix based sever). I have managed to change the file name using the vim command but I do not know how to save the changes? any ideas? Simplest way is probably using sed. Code: [select] sudo sed -i 's/upload_max_filesize = 2M/upload_max_filesize = 10M/' /etc/php.ini You may need to change the last part to point to where your ini file is. I tried this but it is giving me an odd error. Quote Link to comment Share on other sites More sharing options...
premiso Posted December 4, 2009 Share Posted December 4, 2009 If I remember correctly the vi exit/save is something like :wq! Just remember to be "esc" out of text editing before attempting to run that command. EDIT: Given that vim is the same as vi (sorry I haven't used SSH in ages). Quote Link to comment Share on other sites More sharing options...
$Three3 Posted December 4, 2009 Author Share Posted December 4, 2009 If I remember correctly the vi exit/save is something like :wq! Just remember to be "esc" out of text editing before attempting to run that command. EDIT: Given that vim is the same as vi (sorry I haven't used SSH in ages). ok cool thanks I will give that a try. One quick question though, when I am editing the file it say "Warning: You are editing a read only file." Is it suppose to say that? Quote Link to comment Share on other sites More sharing options...
trq Posted December 4, 2009 Share Posted December 4, 2009 If I remember correctly the vi exit/save is something like :wq! Just remember to be "esc" out of text editing before attempting to run that command. EDIT: Given that vim is the same as vi (sorry I haven't used SSH in ages). ok cool thanks I will give that a try. One quick question though, when I am editing the file it say "Warning: You are editing a read only file." Is it suppose to say that? You will need to edit the php.ini as the root user. The warning it is giving you is basically saying 'you don't have permissions to write to this file'. Quote Link to comment Share on other sites More sharing options...
$Three3 Posted December 4, 2009 Author Share Posted December 4, 2009 If I remember correctly the vi exit/save is something like :wq! Just remember to be "esc" out of text editing before attempting to run that command. EDIT: Given that vim is the same as vi (sorry I haven't used SSH in ages). ok cool thanks I will give that a try. One quick question though, when I am editing the file it say "Warning: You are editing a read only file." Is it suppose to say that? You will need to edit the php.ini as the root user. The warning it is giving you is basically saying 'you don't have permissions to write to this file'. Thanks a lot. It work now. That was the reason because of the permissions. Thank a lot for the help. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.