Solution to inconsistent php-v version: 1. Check the location of your php through "find ./ -name php"; 2. Enter ":export PATH="/usr/local/php" on the command line /bin:$PATH""; 3. Add global variables in the "/etc/profile" file.
The operating environment of this tutorial: Windows 10 system, php7.1.7 version, DELL G3 computer
What to do if the php-v version is inconsistent ?
The problem of inconsistent versions between using php -v and phpinfo()
1. Why does this problem occur?
1.1 php -v is to check the default php version of the Linux system, phpinfo() is the web version to run
If the default version is not modified to be consistent with the web version, the following problems may occur:
I develop a project with laravel under windows using php7.1.7 version, and then git it to the server. Composer install keeps reporting that the php version is not enough, but
phpinfo() can be seen on the browser. The one is php7.1.7;
Solution:
2. Check the location of your php7.1.7
find ./ -name php
I installed it using the lnmp integration package, so my web version is in the /usr/local/php directory
3. Enter on the command line: export PATH="/usr/local/php/ bin:$PATH"
4. Use php -v to check and find that the version is correct, and then the composer install project will not report that the version is insufficient
5. Note that this is only a temporary addition
Permanent addition:
Add global variables in the /etc/profile file
#vi /etc/profile
Add:
export PATH=/usr/local/php/bin:$PATH
Note: = There cannot be any spaces on both sides of the equal sign
Recommended learning: "PHP Video Tutorial"
The above is the detailed content of What to do if the php-v version is inconsistent. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Notepad++7.3.1
Easy-to-use and free code editor

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.
