Jump to content


Photo

editing php.ini with ssh


  • Please log in to reply
4 replies to this topic

#1 movealong

movealong
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 14 June 2006 - 11:29 PM

ive been told i need to access my php.ini file via ssh to edit a setting.

i can log into my ssh and i get a basic white page with the following text

root@server [~]#

im guessing i need to type a command in to access my php.ini file. could anyone tell me how. thanks :)

#2 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 15 June 2006 - 12:41 AM

Do you know where it is? This might take a bit otherwise.

More than likely it is in /etc/php. What do you see when you issue...
ls -l /etc/php
?

#3 Koobi

Koobi
  • Staff Alumni
  • Advanced Member
  • 419 posts
  • LocationColombo, Sri Lanka | South Asia

Posted 15 June 2006 - 03:21 AM

put this file on your host:
<?php
    phpinfo (INFO_GENERAL);
?>

now view it via http. that should indicate where php.ini is.


using ssh, you can edit it. i know vim or vi exists on every *nix machine but vim is weird to use for a first time user. there's also the nano editor but i don't think it comes on every *nix installation.

once you make the changes, you have to restart apache for the changes to take place.

#4 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 15 June 2006 - 02:54 PM

[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]i know vim or vi exists on every *nix machine[/quote]
Not necessarily, but most likely.

vim is easy to use, once youve found the file type.
vim /pathtofile
Push enter

This will open the file. Type...
:set nocompatable
Push enter

This turns vi mode off. Hit i, this puts vim into editor mode. Edit the file, then once your finished hold down Ctrl and hit z twice.

Restart apache. More than likely by typing...
/etc/init.d/apache restart


#5 Koobi

Koobi
  • Staff Alumni
  • Advanced Member
  • 419 posts
  • LocationColombo, Sri Lanka | South Asia

Posted 15 June 2006 - 07:15 PM

[!--quoteo(post=384205:date=Jun 15 2006, 08:54 PM:name=thorpe)--][div class=\'quotetop\']QUOTE(thorpe @ Jun 15 2006, 08:54 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Not necessarily, but most likely.
[/quote]


as far as i've heard, its the standard editor for any OS qualified to be called a UNIX by the Open Group Base Specifications of IEEE. but i might be mistaken, i only know what i've read :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users