January 9, 2008

Modify php.ini through SSH for Plesk

I recently ordered a VPS and began to customize it. Unfortunately, I'm not a linux expert (or geek for that matter) so some of what I needed to do didn't come natural to me.

Like altering the php.ini file. Through SSH command line. Thingy.

But through the power of Google and my sheer determination to do this myself, I managed to increase my VPS' memory limit! (Drupal just won't work well at 8M.) And here's how I did it.

(Some notes: I did this through Apple's Terminal utility, logged into ssh mode to my server as root. Plesk keeps the php.ini file in the /etc/ folder, and nano wouldn't work, so I used vi )

First, I typed this is:
cd /etc/
Then I opened up the vi editor with:
vi php.ini

At this point you're seeing half a screen of text (the top of the php.ini file.) You MUST read the Basic vi Commands Page if you don't know what you're doing. I actually found it to be extremely helpful and not too intimidating after a bit of practice. Command b and Command f will go through the pages, and the other commands are pretty intuitive.

Follow the instructions from the Basic vi Commands webpage to alter the php.ini file. (Read the sections on deleting and changing text.)

When you've made the changes type in
:w < Hit Return >
to save (write) the changes then
:q < Hit Return >
to quit.

Restart Apache
service httpd restart
and your changes should be live.

I know, this stuff is pretty basic for a lot of people, but I was just thrilled I did it! And if I can do it... well...

Sources:
I discovered the two lines to get into vi here.
The Basic vi Commands.
Restart Apache.

Comment Information
Magpie Coffeehouse's picture
Magpie Coffeehouse
Feb 16, 2008
7:39am

Sounds complex!

#2no

Comment Information
david's picture
david
Feb 16, 2008
12:17pm

not really. Just takes a few minutes of getting the hand of navigating through the page. One you learn the keyboard commands (and page down to where you want to go) it's pretty easy.

Comment Information
Demy's picture
Demy
Jun 28, 2008
5:32am

Thank you David!
With few simple lines and a couple of links, you saved me! Smiling

#4Nano

Comment Information
Jamie Le Souef's picture
Jamie Le Souef
Jul 21, 2008
8:50pm

Hi,
If you are wanting to use nano, type
yum install nano

(if you are using CentOS or something like that) or

apt-get install nano
(if you are using Debian based OS)

That'll install nano for you and make life much easier Smiling

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Post new comment

By leaving a comment on this site you agree to the Comment Guidelines.
Spammers please note that "nofollow" tags are used for your website. Spammers, this site is not for you to advertise on. I reserve the right to rename or delete spam links.
The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • Textual smileys will be replaced with graphical ones.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
9 + 4 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.