Solved

changing php.ini using ssh

Posted on 2012-03-23
4
998 Views
1 Endorsement
Last Modified: 2012-03-23
I have a dedicated server with my host but when I try to upload a plugin or theme, I get this error:

The uploaded file exceeds the upload_max_filesize directive in php.ini.

Now, according to my host, I have to use ssh to edit the php.ini file.  I'm assuming by increasing that max filesize in that file, that error will go away.

I'm unfamiliar with using ssh but what I want to do is change the php.ini file in root so that all of my website accounts on my box have increased max file size.  I'm using cpanel so what are the steps to opening and editing that file.  I'm assuming I use vi to make changes?
1
Comment
Question by:COwebmaster
  • 2
  • 2
4 Comments
 
LVL 6

Accepted Solution

by:
torakeshb earned 500 total points
ID: 37757781
1. ssh to the server using the command "ssh <ServerName>"
2. in the console provide the command "php -i | grep 'Configuration File'"
    Output would be : php -i | grep 'Configuration File'
<tr><td class="e">Configuration File (php.ini) Path </td><td class="v">/etc/php.ini </td></tr>
3) provide the command "vi /etc/php.ini" and enter (path of php.ini can be got from the previous command"
4) search the word upload_max_filesize by simply typing /upload_max_filesize and enter
5) use the arrow keys to reach the value mentioned
6) press i for inserting
7)  once you edit press escape
8) type ":wq"


or

1. ssh to the server using the command "ssh <ServerName>"
2. in the console provide the command "php -i | grep 'Configuration File'"
    Output would be : php -i | grep 'Configuration File'
<tr><td class="e">Configuration File (php.ini) Path </td><td class="v">/etc/php.ini </td></tr>
3) use winscp and connect to the server
4) browse through the navigation to reach "/etc/php.ini" (got from step 2)
5) double click open "/etc/php.ini" (got from step 2)
6) change the upload_max_filesize to your desired one
7) click save and close. (This will upload to the server by iteself)
0
 

Author Comment

by:COwebmaster
ID: 37757897
Okay, I tried the first option using commands in putty. I made the change from 2M to 100M and tried to save it but it says it read only.  How do I change that in cpanel or in putty?
0
 
LVL 6

Expert Comment

by:torakeshb
ID: 37758057
The first one I mentioned is through putty.. open putty > type the server address > enter which will prompt for login screen

It seems your user account don't have privilege to change the settings.

For CPANEL refer this URL: http://docs.cpanel.net/twiki/bin/view/AllDocumentation/WHMDocs/PhpIni
0
 

Author Closing Comment

by:COwebmaster
ID: 37758287
I wasn't logged in as root before.  Works like a charm now, thanks!
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article discusses four methods for overlaying images in a container on a web page
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question