How to Find and Edit php.ini File Using SSH

This is very simple way to find php.ini file to make changes. You need to have access to these files, and SSH login.

images/webmaster/find-and-edit-php-ini-file-using-ssh.jpg

Step 1: To quickly find the file type:

php -i | grep 'Configuration File'

It will show you the location of the file. For most VPS servers, the file is located is /usr/local/lib.

Step 2: Enter the following command to change the directory:

cd /usr/local/lib

Step 3: You can use ls command to confirm the location. This command will display list of all the files and directories in the current location.

ls

Step 4: To edit the file:

pico php.ini

That's all!