Home >Backend Development >PHP Tutorial >Under Linux, solve the problem of inconsistency between php -v and phpinfo versions

Under Linux, solve the problem of inconsistency between php -v and phpinfo versions

不言
不言Original
2018-04-23 14:21:534117browse

The content of this article is about solving the problem of inconsistency between php -v and phpinfo versions under Linux. It has certain reference value. Now I share it with everyone. Friends in need can refer to it

First find php.ini


find / -name php.ini
Get two ini
/usr/local/php/etc/php.ini
/etc/php.ini



php -i | grep php.ini
Check which configuration file PHP loads. This gets the location of php.ini in the system. It is not the php.ini file loaded by apache on the web page


Look for things related to the PHP directory in the system

find / -name php


This seems to be the PHP installed by Aliyun by default
/usr/bin/php -v



==============================
Solution: Delete
All the PHP stuff in the/usr/bin/ directory




Add the PHP you want to use in the environment variables The path
vim /etc/profile
At the end of the document, add:
export PATH="/usr/local/php /bin:$PATH"
Save, exit, then run:
#source /etc/profile


##Success if no error is reported.

Related recommendations:

Yum installation under linux httpd php mysql operating environment

The above is the detailed content of Under Linux, solve the problem of inconsistency between php -v and phpinfo versions. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn