


What should I do if there is no version of php-v after installing php7.2?
Solution to the problem that php-v has no version after installing php7.2: 1. Search for PHP-related directories or files in the system; 2. View the version information of php listed; 3. Delete all files in the bin directory PHP related directories; 4. Add the path to the correct PHP version to the environment variable.
The operating environment of this article: centos7 system, php7.2, Dell G3 computer.
What should I do if there is no version of php-v after installing php7.2?
Solve the problem that after CentOS7 installs php7.2, the version displayed by php -v is 5.4
1. Find the PHP-related directories or files in the system
find / -name php /var/lib/php /usr/bin/php /usr/lib64/php /usr/share/swig/2.0.10/php /usr/share/php /usr/include/php-zts/php /usr/include/php /usr/local/bin/php /usr/local/include/php /usr/local/lib/php /usr/local/php /selftemp/php-5.4.17/ext/pcntl/sapi/cli/php
2. Check the version information of php listed
/usr/local/bin/php -v PHP 5.4.17 (cli) (built: Sep 21 2017 10:27:13) Copyright (c) 1997-2013 The PHP Group Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies /usr/bin/php -v PHP 7.2.6 (cli) (built: Jun 2 2018 07:49:42) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.2.6, Copyright (c) 1999-2018, by Zend Technologies
3. Because the 5.4.17 version of php is under /usr/local/bin/, delete all PHP related files in the /usr/local/bin/ directory Directory or file
cd /usr/local/bin/ ls courierauthconfig c_rehash parl par.pl peardev phantomjs phar.phar php-cgi phpize scandeps.pl zipdetails crc32 openssl parldyn pear pecl phar php php-config pp tkpp rm -rf ./php rm -rf ./php-cgi rm -rf ./php-config
4. Add the path to the correct PHP version to the environment variable
vim /etc/profile 文件末尾加上 export PATH="/usr/local/php/bin:$PATH"
5. Execute
source /etc/profile
6. If no error occurs, check the PHP version again If it is 7, it means success
php -v PHP 7.2.6 (cli) (built: Jun 2 2018 07:49:42) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.2.6, Copyright (c) 1999-2018, by Zend Technologies
7. If the error is reported and there is no sokcet function, stream_socket_server() has been disabled for security...
Edit php.ini and set disable_functions=... Find stream_socket_server(), stream_socket_client, delete them, and restart the web component
-------------------------------- -------------------------------------------------- --------------------
Other knowledge points that may be used:
Find the php.ini configuration file: find / - name php.ini
/etc/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 the web apache
php -i | grep php.ini Configuration File (php.ini) Path => /usr/local/lib
Recommended study: "PHP Video Tutorial"
The above is the detailed content of What should I do if there is no version of php-v after installing php7.2?. 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

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

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

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

Hot Topics

