Home > Backend Development > PHP Problem > What to do if the php-v version is inconsistent

What to do if the php-v version is inconsistent

藏色散人
Release: 2023-03-17 19:54:01
Original
1611 people have browsed it

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.

What to do if the php-v version is inconsistent

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
Copy after login

What to do if the php-v version is inconsistent

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"

What to do if the php-v version is inconsistent

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
Copy after login

Add:

What to do if the php-v version is inconsistent

export PATH=/usr/local/php/bin:$PATH
Copy after login

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!

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