Jump to content

Archived

This topic is now archived and is closed to further replies.

movealong

editing php.ini with ssh

Recommended Posts

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 :)

Share this post


Link to post
Share on other sites
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...
[code]
ls -l /etc/php
[/code]
?

Share this post


Link to post
Share on other sites
put this file on your host:
[code]
<?php
    phpinfo (INFO_GENERAL);
?>
[/code]

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.

Share this post


Link to post
Share on other sites
[!--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.
[code]
vim /pathtofile
[/code]
Push enter

This will open the file. Type...
[code]
:set nocompatable
[/code]
Push enter

This turns vi mode off. Hit [i]i[/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...
[code]
/etc/init.d/apache restart
[/code]

Share this post


Link to post
Share on other sites
[!--quoteo(post=384205:date=Jun 15 2006, 08:54 PM:name=thorpe)--][div class=\'quotetop\']QUOTE(thorpe @ Jun 15 2006, 08:54 PM) [snapback]384205[/snapback][/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 :)

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.