Jump to content

Recommended Posts

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!

Link to comment
https://forums.phpfreaks.com/topic/184032-phpini-file-help/
Share on other sites

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.

 

Link to comment
https://forums.phpfreaks.com/topic/184032-phpini-file-help/#findComment-971633
Share on other sites

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?

Link to comment
https://forums.phpfreaks.com/topic/184032-phpini-file-help/#findComment-971636
Share on other sites

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'.

Link to comment
https://forums.phpfreaks.com/topic/184032-phpini-file-help/#findComment-971637
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/184032-phpini-file-help/#findComment-971644
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.