Solved

changing php.ini using ssh

Posted on 2012-03-23
4
986 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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

These days socially coordinated efforts have turned into a critical requirement for enterprises.
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

863 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now