There is no php.ini after installing php (7.1) on ubuntu 16.04

I installed php using apt install php. I already tried to find the php.ini using the find command, but there is no file called php.ini anywhere.

  • If one of the below answers works for you, please accept it by clicking the checkmark icon. If none works for you, please edit your question and add a postscript to say so. – unforgettableidSupportsMonica Aug 4 '17 at 0:17

I recently setup a wordpress server and ran into this same issue.

I used apt-get install php

Everything seemed to be normal except I could not find the php.ini file either. That file is usually located in /etc/php/7.0/apache2/php.ini

My solution, and I guess is also your solution would be that apache mod didn't get installed for php. So all you need to run is apt-get install libapache2-mod-php

I also bounced apache just to be safe, but then my php.ini file was then located where I expected it in /etc/php/7.0/apache2/php.ini


Try using the command php --ini. Since you're running command line, it won't necessarily show you the config files you may be looking for (apache, nginx, etc), but it will hopefully get you on the right path.

When I run it I see:

$ php --ini
Configuration File (php.ini) Path: /etc/php/7.0/cli

Which tells me if I'm looking for Apache files, I can find the rest up one directory from there:

$ ls /etc/php/7.0/
apache2  cli  fpm  mods-available

If all else fails, and you're able to browse to a .php file on the server, create a file using phpinfo like this and take a look to see what ini files are in use:


Kindly use the locate command instead. Here is my output:

subroot@subroot:~$ find php.ini
find: ‘php.ini’: No such file or directory

subroot@subroot:~$ locate php.ini

Type man find and man locate for the difference between the two commands.


You may have passed the wrong options to find, just like Parto did in his answer.

Try this find command:

find / -iname '*php.ini*'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.