Jump to content

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 :)
Link to comment
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.
Link to comment
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]
Link to comment
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 :)
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.