PHP Find php.ini and edit configuration settings from command line

Manipulating the PHP ini file from the command line is really quite straight forward.

To get yourself started on the command line, just ask PHP for help like this:

You’ll see a list of options and arguments.

From the php help output one can see that the -i option will show what amounts to the contents of the phpinfo() function.

By piping this output through grep, we can filter for the php.ini file and figure out where the file is.

With this information one can use the -d flag to alter php.ini setting from the command line as well.

 

Posted in

Leave a Reply

Your email address will not be published. Required fields are marked *