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

不言
Release: 2023-03-24 17:34:02
Original
4061 people have browsed it

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!