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 > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly introduces "how to solve the linux php -v command can not find the problem", in daily operation, I believe many people in how to solve the linux php -v command can not find the problem there are doubts, Xiaobian consulted all kinds of information, sorted out simple and easy to use the operation method, hope to answer everyone "how to solve the linux php -v command can not find the problem" doubts help! Next, please follow the small series to learn together!
Linux php -v command can not find the solution: 1, find the location of the php file in linux;2, set the php environment variable in the environment variable file of the linux system;3, execute the update environment variable command.
Operating environment: linux 5.9.8 system, PHP 5.4.26 version, DELL G3 computer
Linux php command can not be used how to solve, test whether to add php environment variables method:
Enter php -v to display php command not found
[root@iz8vbhc4d7zoazstpw7gw8z ~]# php -v-bash: php: command not found
1. First go to linux to find the location of the php file for the integrated environment
[root@iz8vbhc4d7zoazstpw7gw8z /]# cd phpstudy/server/php/[root@iz8vbhc4d7zoazstpw7gw8z php]# lsbin do_not_delete etc include lib php sbin var[root@iz8vbhc4d7zoazstpw7gw8z php]# cd bin/[root@iz8vbhc4d7zoazstpw7gw8z bin]# lsphar phar.phar php php-cgi php-config phpize[root@iz8vbhc4d7zoazstpw7gw8z bin]# pwd/phpstudy/server/php/bin
Get the location of php bin directory above, I use phpstudy integration environment for linux
Then you need to go to the linux environment variable file to set php environment variables, similar to windows. File in root directory/etc
[root@iz8vbhc4d7zoazstpw7gw8z ~]# cd /[root@iz8vbhc4d7zoazstpw7gw8z /]# vim etc/profile
Then start editing the configuration file for the environment variables
As shown in the figure:
Add these two lines of code to the php bin directory path found here;
To add other environment variables, simply find the directory where the executable file is located, append a colon (":") to the end, add the directory, and then save and exit.
Execute the Update Environment Variable command:
[root@iz8vbhc4d7zoazstpw7gw8z /]# source /etc/profile
Then type php -v and you're done.
[root@iz8vbhc4d7zoazstpw7gw8z /]# php -vPHP 5.4.26 (cli) (built: Sep 7 2017 12:52:40)Copyright (c) 1997-2014 The PHP GroupZend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies with Zend Guard Loader v3.3, Copyright (c) 1998-2013, by Zend Technologies At this point, the study on "How to solve the Linux php -v command can not be found" is over, hoping to solve everyone's doubts. Theory and practice can better match to help everyone learn, go and try it! If you want to continue learning more relevant knowledge, please continue to pay attention to the website, Xiaobian will continue to strive to bring more practical articles for everyone!
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.