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 introduces the relevant knowledge of "downloading and compiling redis extension steps for php". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
When you see this article, you should encounter the dilemma that there is no redis extension in the php environment in homestead, and the online tutorials are not universal, because those tutorials are only aimed at the installation method in a single machine and single version php environment, while homestead installs multiple php versions with slightly different installation methods. Look down:
Note: when the command authority is not enough, please automatically add the sudo prefix to the command; the tutorial also requires that you can simply write the contents of the file using the vi editor (of course, you can also create the contents of the file in other ways).
1. Connect to homesteadvagrant ssh2. Vagrant using the ssh option of the command. Download the redis extension for compiling php. Download the redis extension to be installed on the http://pecl.php.net/package/redis page ~ / Code/modules$ tar-xzvf phpredis-streams.zip~/Code/modules$ cd phpredis-streams ~ / Code/modules/redis-5.1.1 $/ usr/bin/phpize7.2. The phpize version varies with different php versions) Configuring for:PHP Api Version: 20170718Zend Module Api No: 20170718Zend Extension Api No: 320170718~/Code/modules/redis-5.1.1 $. / configure-- with-php-config=/usr/bin/php-config7.2 (you also need to specify the version of php-config according to the situation And consistent with the version of phpize. ) ~ / Code/modules/redis-5.1.1$ sudo make & & sudo make install
* after compilation, redis's php is extended in the module directory, and its file name is redis.so*
3. View the extension_dir of php
Php7.2-I | grep extension_dir
* you may see the following fields in the small black window *
Extension_dir = > / usr/lib/php/20170718 = > / usr/lib/php/20170718
* this indicates that the extension directory of php is / usr/lib/php/20170718*
* or you can use phpinfo () to output a page where you can find extension_dir. *
4. Move the redis.so extension module to the php extension directory
~ / Code/modules/redis-5.1.1$ sudo mv. / modules/redis.so / usr/lib/php/20170718
In fact, the step that the _ _ redis.so generated after compilation has been regained / usr/lib/php/20170718/, can be skipped
5. Add an ini file for the php configuration file
* create a file *
Sudo touch / etc/php/7.2/fpm/conf.d/20-redis.ini
* use the vim editor to write the following: *
Extension=redis.so
* remember to use the: wq command to save when using the vi editor *
6. Everything is fine. Restart php-fpm.
* Command: *
~ / Code/modules/redis-5.1.1$ sudo service php7.2-fpm restart
This article is transferred from the homestead installation php redis extension tutorial of piggy code on CSDN, and has been verified by my practice on Homestead v5.4.0.
Note that this article only passed the test on the early development environment configuration on Laravel China (Homestead v5.4.0, virtualbox 3.0.0, operating system 16.04), and could not be tested and verified on the new version of the development environment configuration (Homestead v7.8.0, virtualbox 6.1.0, operating system 18.04) because phpize was not found in the / usr/bin directory.
Supplement
The following installation method applies to Homestead v5.4.0 and Homestead v7.8.0. PS: install openssl and openssl-dev if you are prompted to find OpenSSL during installation
After sudo apt-get install php5.6-dev downloads the mongo package and unzips it, enter the folder, sudo / usr/bin/phpize5.6sudo. / configure-- with-php-config=/usr/bin/php-config5.6sudo make & & sudo make install, and then update php.ini cli and fpm with the addition of mongo.so "download and compile php redis extension steps". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
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.