How to edit php.ini from ssh

Type:

1. “cd /etc”
2. “ls”

Check that there is the php.ini listed if not you will have to ask your hosting provider where it is.

3. “vi php.ini”

Find the bit in php.ini you would like to edit.

4. “i” – This enables you to edit the php.ini file

5. After changing the file, please Esc.

6: “:wq” – (w = saves the file, q = quit)

7. reboot your server and your done.

Related posts:

  1. Installing LAMP on Ubuntu
  2. Enable mod_rewrite in xampp
  3. Getting .htaccess to work on windows apache
  4. How to Enable SSL on Xampp with Vhosts

  • http://www.dewebtimes.com De Web Times

    this is helpful, thx

  • http://companysite Seth

    Thank you so much!! exactly what I needed!

  • http://www.tafuma.co.uk/ Price Comparison

    This is very helpful. Thanks a lot

  • http://virtual paramount

    Hi, just a small query. Will this change erase the contents on the server? Do I have to reinstall the website again after finishing the steps and restarting the server or will the steps stated by you will have no effect on the contents, database etc, but will only modify the php.ini file as desired?
    Many thanks in advance

  • http://www.webomotor.com Ray

    SOOOOOOO helpful for me newbe.

  • http://janckos.net Janckos

    Gracias.

  • http://ghetto-hoodz.com ClayC

    the ;wq didn’t happen to me… I try press the keys but the windows beep sound keeps coming up -.-

    I am still struggling this to maybe make it work xD

    very good tutorial thought, if possible please tell me what’s wrong with my SSH thingy

    Thanks alot

  • http://www.lenatsu.co.uk admin

    @ClayC

    It’s :wq not ;wq.

    That might help. Otherwise sorry no idea why it might be doing that.

  • http://www.vnwi.com www.vnwi.com

    Thanks , i have susseccfull config my VPS server by your stuff :

    Largest buy|sell machine tool, manufacturing technology

  • http://www.vnwi.com david

    Thanks for this tutorial!
    This was a great help and like you i’m not too familiar with SSH commands, i managed to update my PHP ini file and now my upload limit has been increased.
    Many thanks..!

  • http://www.isolveit.co.uk Joe

    Hi, being a windows techie i hadn’t a clue how to edit the PHP.ini. It took me ages to your so user friendly way to find and edit the file. Although I want to become more familiar with Linux I find most of the info from competant users over techie. They give an answer but without the ‘how to do’. So a big thanks, keep up the good work.
    P.S. I’m book marking your site for future answers.

  • http://auto-insurance.co.il omer

    Many thanks! this really helped me with an installation i had (i know nothing about PHP, Linux etc…)

  • matt

    excellent. great tutorial and worked like a charm!

  • http://www.kefpo.co.il משחקים ברשת

    thank you about it

  • http://www.gmx.co.il משחקים

    nice post.. thanks u a lot for this post.

  • http://www.resumes-india.com resumes

    Thanks… I could locate and edit

  • http://lalallalasdaldasd.com serg

    how do u restart using putty?

    • http://www.leonardaustin.com Leonard Austin

      just type: reboot

  • http://ritwik.com aditya

    thx a lot very helpful

  • http://patrickrauland.com Patrick Rauland

    Very helpful tutorial. Thanks. Every other site I found was no where near as informative or concise.

  • http://www.animestatic.com/ Anime

    I found some really good instructions if anyone is interested. They worked perfectly for me since I was having trouble with this method:

    Log in as root.
    Type the following and hit enter: vi /usr/local/lib/php.ini
    Now that you’re in vi, hit escape a few times then type the following
    and hit enter: /memory_limit
    That basically does a “find” in the file you’re editing.
    Press the “i” key. This puts you in “insert” mode, which basically
    allows you to edit things.
    Change the current setting (probably 8M) to 16M.
    Press escape, then type :wq and hit enter. That says “save the file
    and quit.”

    Obviously you don’t have to use this, but it’s just here in case someone other then me needs it, I know it helped me!

  • http://www.thediyworld.com TheDIYWorld

    Thank you very much. This helped me modify my settings and saved some money.

Twitter Updates