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.
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.Sign up to join this community
I recently setup a wordpress server and ran into this same issue.
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
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
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 /etc/php/7.0/apache2/php.ini /etc/php/7.0/apache2/php.ini.ucf-dist /etc/php/7.0/apache2/php.ini.ucf-old /etc/php/7.0/cli/php.ini /etc/php/7.1/apache2/php.ini /etc/php/7.1/apache2/php.ini.ucf-dist /etc/php/7.1/cli/php.ini /usr/lib/php/5.6/php.ini-development /usr/lib/php/5.6/php.ini-production /usr/lib/php/5.6/php.ini-production.cli /usr/lib/php/7.0/php.ini-development /usr/lib/php/7.0/php.ini-production /usr/lib/php/7.0/php.ini-production.cli /usr/lib/php/7.1/php.ini-development /usr/lib/php/7.1/php.ini-production /usr/lib/php/7.1/php.ini-production.cli subroot@subroot:~$
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.
find / -iname '*php.ini*'