How can I find and edit the php.ini file? [duplicate]
By Mia Morrison •
I am trying to find the php.ini file on Ubuntu server with the command:
sudo vim /etc/php5However, this tells me that the file does not exist. How can I find and edit the php.ini file?
3 Answers
If you're using apache2, it's located in /etc/php5/apache2.
With ubuntu find command
sudo find / -name "php.ini"or you can see the phpinfo page
The other answers can correctly locate php.ini files in the system, but to find out which one is used by the process you are running, you can use the php_ini_loaded_file() function.
Note that the file loaded is different depending on how you invoke php (apache, nginx, command line, etc).
This information is also available through phpinfo()