11月21日任务
11.32 php扩展模块装安装
- /usr/local/php/bin/php -m //查看模块
- 下面安装一个redis的模块
- cd /usr/local/src/
- wget https://codeload.github.com/phpredis/phpredis/zip/develop
- mv develop phpredis-develop.zip
- unzip phpredis-develop.zip
- cd phpredis-develop
- /usr/local/php/bin/phpize //生成configure文件
- ./configure --with-php-config=/usr/local/php/bin/php-config
- make && make install
- /usr/local/php/bin/php -i |grep extension_dir //查看扩展模块存放目录,我们可以在php.ini中去自定义该路径
- vim /usr/local/php/etc/php.ini //增加一行配置(可以放到文件最后一行)
- extension = redis.so
#安装develop模块
[root@zgxlinux-01 111.com]# cd /usr/local/src/
[root@zgxlinux-01 src]# wget https://codeload.github.com/phpredis/phpredis/zip/develop --2018-11-21 18:15:19-- https://codeload.github.com/phpredis/phpredis/zip/develop 正在解析主机 codeload.github.com (codeload.github.com)... 13.250.162.133, 54.251.140.56, 13.229.189.0 正在连接 codeload.github.com (codeload.github.com)|13.250.162.133|:443... 已连接。 已发出 HTTP 请求,正在等待回应... 200 OK 长度:未指定 [application/zip] 正在保存至: “develop”[ <=> ] 254,682 232KB/s 用时 1.1s
2018-11-21 18:15:21 (232 KB/s) - “develop” 已保存 [254682]
[root@zgxlinux-01 src]# ls
apr-1.6.5 apr-1.6.5.tar.gz apr-util-1.6.1 apr-util-1.6.1.tar.gz develop httpd-2.4.37 httpd-2.4.37.tar.gz mariadb-10.2.6-linux-glibc_214-x86_64.tar.gz mysql-5.6.39-linux-glibc2.12-x86_64.tar.gz pcre-8.10 pcre-8.10.zip php-5.6.32 php-5.6.32.tar.bz2 [root@zgxlinux-01 src]#mv develop phpredis-develop.zip [root@zgxlinux-01 src]# ls apr-1.6.5 apr-1.6.5.tar.gz apr-util-1.6.1 apr-util-1.6.1.tar.gz phpredis-develop.zip httpd-2.4.37 httpd-2.4.37.tar.gz mariadb-10.2.6-linux-glibc_214-x86_64.tar.gz mysql-5.6.39-linux-glibc2.12-x86_64.tar.gz pcre-8.10 pcre-8.10.zip php-5.6.32 php-5.6.32.tar.bz2[root@zgxlinux-01 src]# cd phpredis-develop/
[root@zgxlinux-01 phpredis-develop]# ls arrays.markdown INSTALL.markdown redis_array_impl.c cluster_library.c ISSUE_TEMPLATE.md redis_array_impl.h cluster_library.h liblzf redis.c cluster.markdown library.c redis_cluster.c common.h library.h redis_cluster.h config.m4 mkdeb-apache2.sh redis_commands.c config.w32 mkdeb.sh redis_commands.h COPYING package.xml redis_session.c crc16.h php_redis.h redis_session.h CREDITS README.markdown rpm debian redis_array.c serialize.list debian.control redis_array.h tests[root@zgxlinux-01 phpredis-develop]# /usr/local/php/bin/phpize
[root@zgxlinux-01 phpredis-develop]# ./configure --with-php-config=/usr/local/php/bin/php-config
[root@zgxlinux-01 phpredis-develop]# echo $?
0[root@zgxlinux-01 phpredis-develop]# make && make install
[root@zgxlinux-01 phpredis-develop]# ls /usr/local/php/lib/php/extensions/no-debug-zts-20131226/
opcache.so redis.so [root@zgxlinux-01 phpredis-develop]# /usr/local/php/bin/php -i |grep -i extension_dir extension_dir => /usr/local/php/lib/php/extensions/no-debug-zts-20131226 => /usr/local/php/lib/php/extensions/no-debug-zts-20131226 sqlite3.extension_dir => no value => no value