In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article is about how unrecognized php commands are handled in linux. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
Linux can not recognize the php command solutions: 1, go to linux to find the location of the integrated environment php file; 2, set php environment variables; 3, execute the update environment variable command.
This article operating environment: linux5.9.8 system, PHP5.4.26 version, DELL G3 computer
The php command under linux cannot be used to solve the problem. Test whether to add the php environment variable method:
As follows: enter php-v to show that the php command was not found
[root@iz8vbhc4d7zoazstpw7gw8z ~] # php-v-bash: php: command not found
1. First, go to linux to find the location of the php file in 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's bin directory as above. I use the phpstudy integrated environment for linux.
Then you need to go to the environment variable file of the linux system to set the php environment variable, similar to that in windows. Etc of the file in the root directory /
[root@iz8vbhc4d7zoazstpw7gw8z ~] # cd / [root@iz8vbhc4d7zoazstpw7gw8z /] # vim etc/profile
Then start editing the configuration file of the environment variable
As shown in the figure:
Put the path to the bin directory of the found php here to add these two lines of code
To add other environment variables, just find the directory where the execution file is located, append a colon (":") followed by the directory, and then save and exit.
Execute the update environment variable command:
[root@iz8vbhc4d7zoazstpw7gw8z /] # source / etc/profile
Then type php-v to OK.
[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 Thank you for reading! This is the end of the article on "how to deal with unrecognized php commands in linux". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can 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.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.