-1

A few days ago, I compiled PHP 5.5 from sources and installed it on my Debian 8.5 server but I got some issues. I decided to remove it and re-install PHP through package. But I still got issues because the path of my php.ini did not change.

What I actually have is :

kevin@debian:~$ php --ini
Configuration File (php.ini) Path: /usr/local/lib
Loaded Configuration File: /usr/local/lib/php.ini
Scan for additional .ini files in: (none)

I would like to retrieve a default configuration like this :

kevin@debian:~$ php --ini
Configuration File (php.ini) Path: /etc/php/5.6/cli
Loaded Configuration File: /etc/php/5.6/cli/php.ini
Scan for additional .ini files in: /etc/php/5.6/cli/conf.d

I tried to re-install php5, php5-fpm... through apt-get but my path never changed.

Is there any command on Debian to change the default path of my php.ini conf ?

Thx.

Edit :

which php :

kevin@debian:~$ which php
/usr/local/bin/php

php -v :

kevin@debian:~$ php -v
PHP 5.5.15 (cli)
kevin-ta
  • 11
  • 1
  • 5

1 Answers1

1

The default PHP package of Debian installs php as /usr/bin/php and not in /usr/local/bin/. Also the version will almost always contain a trace of debian:

vagrant@jessie:~$ which php
/usr/bin/php
vagrant@jessie:~$ /usr/bin/php --version
PHP 5.6.24-0+deb8u1 (cli) (built: Jul 26 2016 08:17:07)

(see the deb8u1 in the version string).

You are still using the self-compiled version. Probably /usr/local/bin is earlier in your PATH.

The easiest thing to do is mv /usr/local/bin/php /usr/local/bin/php.bak. This will solve your current problem (you might have to re-login/close your terminal and start it again), but you will want to clean up whatever the compilation and installation process did.

madeddie
  • 418
  • 2
  • 6