Simple question: where is the correct PHP.INI location in Mac OSX El Capitan?
I tried to update the one in /etc folder, but nothing changed.
user. ini file is the default configuration file for running applications that require PHP. It is used to control variables such as upload sizes, file timeouts, and resource limits. This file is located on your server in the /public_html folder.
ini file: Whenever we install PHP, we can locate the configuration file inside the PHP folder. If using xampp, we can find the configuration file in one or many versions, inside the path '\xampp\php'.
Check php. ini in CLI (Command Line Interface): To know about php. ini, simply run on CLI. It look for Loaded Configuration File in output for the location of php.
i know three ways:
<?php phpinfo();
and open the file in the browserThe default location on OSX El Capitan and macOS Sierra is /etc/php.ini
But if that file doesn't exist, php will use /etc/php.ini.default
. Don't forget to create a copy if you want to make changes:
$ sudo cp /etc/php.ini.default /etc/php.ini
Also, php will scan /Library/Server/Web/Config/php
dir for additional .ini files
Restart Apache if you made any changes:
$ sudo apachectl -k restart
Note: if you install PHP7, this location will change to
/usr/local/etc/php/7.0/php.ini
Simple solution
create php info file in your web folder
<?php
// Show all information, defaults to INFO_ALL
phpinfo();
?>
open the file in browser
look for
INFO_GENERAL 1 The configuration line, php.ini location, build date, Web Server, System and more.
Taken from php manual
Another option is to use
<? php_ini_loaded_file(); ?>
Strange thing that phpinfo() does not display the file location, but here it is: /etc/php.ini.default
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With