2

I am trying to find the php.ini file on Ubuntu server with the command:

sudo vim /etc/php5

However, this tells me that the file does not exist. How can I find and edit the php.ini file?

Flyk
  • 1,480
user227802
  • 21
  • 1
  • 1
  • 3

3 Answers3

4

With ubuntu find command

sudo find / -name "php.ini"

or you can see the phpinfo page

enter image description here

LF-DevJourney
  • 111
  • 11
3

If you're using apache2, it's located in /etc/php5/apache2.

1

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()