In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article will explain in detail how to solve the problem that there is no version of php-v after installing php7.2. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.
After installing php7.2, there is no version of php-v solution: 1, find the PHP-related directories or files in the system; 2, view the listed php version information; 3, delete all PHP-related directories under the bin directory; 4, add the path of the correct PHP version to the environment variables.
This article operating environment: centos7 system, php7.2, Dell G3 computer.
Fixed the issue that php-v shows version 5.4 after CentOS7 installs php7.2
1. Find 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
two。 View the version information of the listed php
/ usr/local/bin/php-vPHP 5.4.17 (cli) (built: Sep 21 1997 10:27:13) Copyright (c) 1997-2013 The PHP GroupZend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies/usr/bin/php-vPHP 7.2.6 (cli) (built: Jun 2 2018 07:49:42) (NTS) Copyright (c) 1997-2018 The PHP GroupZend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologieswith Zend OPcache v7.2.6, Copyright (c) 1999-2018 By Zend Technologies
3. Because version 5.4.17 php is under / usr/local/bin/, delete all PHP-related directories or files under the / usr/local/bin/ directory
Cd / usr/local/bin/lscourierauthconfig c_rehash parl par.pl peardev phantomjs phar.phar php-cgi phpize scandeps.pl zipdetailscrc32 openssl parldyn pear pecl phar php php-config pp tkpprm-rf. / phprm-rf. / php-cgirm-rf. / php-config
4. Add the path of the correct PHP version to the environment variable
Add export PATH= "/ usr/local/php/bin:$PATH" at the end of the vim / etc/profile file
5. Execution
Source / etc/profile
6. If there is no error, check the php version again. If it is 7, it is successful.
Php-vPHP 7.2.6 (cli) (built: Jun 2 2018 07:49:42) (NTS) Copyright (c) 1997-2018 The PHP GroupZend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologieswith Zend OPcache v7.2.6, Copyright (c) 1999-2018, by Zend Technologies
7. If there is no sokcet function to report an error, stream_socket_server () has been disabled for security...
Edit php.ini to put disable_functions=... Find stream_socket_server (), stream_socket_client in, delete it, 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
See which configuration file PHP is loading, and this gets the location of the php.ini within the system. Not a php.ini file loaded by a web page apache
Php- I | grep php.iniConfiguration File (php.ini) Path = > / usr/local/lib this is the end of the article on "how to solve the problem of no version of php-v after installing php-v". I hope the above content can be helpful to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.