In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces the "apt-get command installation of Composer and php version conflict how to do", in the daily operation, I believe that many people in the apt-get command installation of Composer and php version conflict how to do have doubts, editor access to all kinds of information, sort out a simple and easy to use method of operation, hope to answer the "apt-get command installation of Composer and php version conflict how to do" the doubt is helpful! Next, please follow the editor to study!
Today, I found that the / usr/bin/php version is different from the / usr/local/php/bin/php version, which was still fine before.
It was later found that apt-get install composer installed a php to / usr/bin/php by default to overwrite the previous version of PHP.
# php-vPHP 7.2.40. # / usr/local/php/bin/php-vPHP 7.2.19 (cli) (built: Jul 3 2019 02:01:24) (ZTS) Copyright (c) 1997-2018 The PHP GroupZend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
Refer to du Niang, modify the PHP version of composer, and find that it still doesn't work.
Qing@qing-PC:~/Desktop$ composerPHP Warning: require (Composer/autoload.php): failed to open stream: No such file or directory in/ usr/bin/composer on line 9Warning: require (Composer/autoload.php): failed to open stream: No such file or directory in/ usr/bin/composer on line 9PHP Fatal error: require (): Failed opening required 'Composer/autoload.php' (include_path='.:/usr/local/php/lib/php') in/ usr/bin/composer on line 9Fatal Error: require (): Failed opening required 'Composer/autoload.php' (include_path='.:/usr/local/php/lib/php') in/ usr/bin/composer on line 9
The 'Composer/autoload.php' file can't be found in the / usr/local/php/lib/php directory at all.
Have no choice but to uninstall composer, delete the php version of composer automatic installation, delete phar and other composer-related files:
# apt-get remove composer# rm-rf / usr/bin/php# rm-rf / usr/bin/php7.2# rm-rf / usr/bin/phar*
Let's install composer through the official way.
# ln-s / usr/local/php/bin/php / usr/bin/php# wget https://getcomposer.org/installer# mv installer composer-setup.php# php composer-setup.php-- install-dir=/usr/bin/-- filename=composer# php/ usr/bin/composer
Check to see if the / usr/bin/php version is still overwritten.
# php-v
Or the php version created through a soft connection (ln-s / usr/local/php/bin/php / usr/bin/php)
Note that / usr/bin/php has not been overwritten.
Composer problem solving...
At this point, the study on "what to do about the conflict between the Composer installed by the apt-get command and the php version" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
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.