Solved

changing php.ini using ssh

Posted on 2012-03-23
4
1,006 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 7

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 7

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Fine Tune your automatic Updates for Ubuntu / Debian
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
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…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

726 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