The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Easy SSH?

Discussion in 'General Discussion' started by Hines, Apr 27, 2010.

  1. Hines

    Hines Active Member

    Joined:
    Apr 23, 2010
    Messages:
    44
    Likes Received:
    0
    Trophy Points:
    6
    I need to access the root of my server. Specifically, I need to modify the php.ini file in my virtual apache server.

    I don't know much aboout SSH but i gather I need to use it to gain root access. I downloaded "putty" but kept getting "access denied" messages and gave up. (Luckily--I had the help of the most gracious guy in these forums: Spiral!!!)

    However, I'm done with my old taks and now I need root access so I can get to this php.ini file. Perhaps I need to go ahead and get putty working? Any suggestions from you folks as to the easy way to accomplish this? :D
     
  2. Shrex

    Shrex Member

    Joined:
    Apr 28, 2010
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Mangalore
    Hello pal

    I am not sure that you can edit php.ini in shared hosting. And i am using SSH to access my account without using keys and i can access as root. Try SSH using account user name and pass disabling key for your account.

    Shrex!:)
     
  3. Hines

    Hines Active Member

    Joined:
    Apr 23, 2010
    Messages:
    44
    Likes Received:
    0
    Trophy Points:
    6
    I got it working. thanx. so now ssh works. but now what do ido? what do i need to type in to see the directory. i guess i need to know a command line?
     
  4. thewebhostingdi

    thewebhostingdi Well-Known Member

    Joined:
    Jan 10, 2008
    Messages:
    141
    Likes Received:
    0
    Trophy Points:
    16
    To edit the php.ini you will have to type below mentioned command in your command prompt:

    [root@server] : pico /usr/local/lib/php.ini

    Generally, php.ini file is located inside the /usr/local/lib. You can edit the file using the above command and save the file.
     
  5. Hines

    Hines Active Member

    Joined:
    Apr 23, 2010
    Messages:
    44
    Likes Received:
    0
    Trophy Points:
    6
    Thanx a lot. I typed exactly what you wrote:
    pico /usr/local/lib/php.ini

    also

    usr/local/lib/php.ini


    also

    (my usernam)/usr/local/lib/php.ini


    All I got was: "No such file or directory."

    Is there no way to get a directory tree of the root?
     
  6. ChrisRHS

    ChrisRHS Well-Known Member

    Joined:
    Jul 12, 2006
    Messages:
    292
    Likes Received:
    5
    Trophy Points:
    18
    What exactly do you need to edit in the php.ini file? I ask, because you can edit most of the settings right through WHM, under Main >> Service Configuration >> PHP Configuration Editor, then switch to advanced mode.
     
  7. Hines

    Hines Active Member

    Joined:
    Apr 23, 2010
    Messages:
    44
    Likes Received:
    0
    Trophy Points:
    6
    I need to change the value of max_execution_time. I am trying to upload packages to my site and they keep timing out. The default "max_execution_time" is 30 seconds, I think. I need to increase this to 60 or 120.

    I did the research and found out this is what i need to do to solve the problem. I had a hosting account but now have a virtual server and am trying to learn more complex functions.
     
  8. LiquidWebBenny

    PartnerNOC

    Joined:
    Nov 3, 2006
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Lansing, Mi
    try using:

    Code:
    # php -i | grep php.ini[code]
    
    That should show you where the file is that you need to edit, assuming you are logged in via root.
     
  9. Spiral

    Spiral BANNED

    Joined:
    Jun 24, 2005
    Messages:
    2,023
    Likes Received:
    7
    Trophy Points:
    0
    You said that "pico /usr/local/lib/php.ini" is not working ....

    Systems that have nano usually have pico aliased but maybe not yours .....

    However just type "edit /usr/local/lib/php.ini"

    (This should invoke whatever is the 'default' editor on your server)

    You should know that the script timeout can and often are set from the scripts themselves and I've seen scripts complain they only have 30 seconds and the system actually have 5 minutes and turned out the script that was complaining was overriding the longer time with a shorter one in what is somewhat amusing irony.

    PS: something else you need to know is that you **MUST** be logged into SSH as 'root' in order for that to work so if you are logged in using some other username then that would also explain why you are unable to access the php.ini file.
     
  10. ChrisRHS

    ChrisRHS Well-Known Member

    Joined:
    Jul 12, 2006
    Messages:
    292
    Likes Received:
    5
    Trophy Points:
    18

    That setting can be found in WHM's advanced PHP editor. If you are not familiar with SSH commands, then I would not recommend fooling around with a live server trying to learn. If down time does not matter, then by all means, play, as it is a great way to learn what not to do :).

    Chris
     
Loading...

Share This Page