[root@hf-01 ~]# /usr/local/php/bin/php -m [PHP Modules] bz2 Core ctype date dom ereg exif fileinfo filter gd hash iconv json libxml mbstring mcrypt mysql mysqli openssl pcre PDO pdo_mysql pdo_sqlite Phar posix Reflection session SimpleXML soap sockets SPL sqlite3 standard tokenizer xml xmlreader xmlwriter zlib [Zend Modules] [root@hf-01 ~]#
[root@hf-01 ~]# cd /usr/local/src/ [root@hf-01 src]#
[root@hf-01 src]# wget https://codeload.github.com/phpredis/phpredis/zip/develop
[root@hf-01 src]# mv develop phpredis-develop.zip [root@hf-01 src]#
[root@hf-01 src]# unzip phpredis-develop.zip
[root@hf-01 src]# ls apr-1.6.3 apr-1.6.3.tar.gz apr-util-1.6.1 apr-util-1.6.1.tar.bz2 httpd-2.4.29 httpd-2.4.29.tar.gz mariadb-10.2.6-linux-glibc_214-x86_64.tar.gz mysql-5.6.35-linux-glibc2.5-x86_64.tar.gz php-5.6.30 php-5.6.30.tar.gz php-7.1.6 php-7.1.6.tar.bz2 phpredis-develop phpredis-develop.zip [root@hf-01 src]#
[root@hf-01 src]# cd phpredis-develop [root@hf-01 phpredis-develop]#
[root@hf-01 phpredis-develop]# /usr/local/php/bin/phpize //生成configure文件 Configuring for: PHP Api Version: 20131106 Zend Module Api No: 20131226 Zend Extension Api No: 220131226 Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF environment variable. Then, rerun this script.
[root@hf-01 phpredis-develop]# yum install -y autoconf 而後再去生成configure文件 [root@hf-01 phpredis-develop]# /usr/local/php/bin/phpize Configuring for: PHP Api Version: 20131106 Zend Module Api No: 20131226 Zend Extension Api No: 220131226 [root@hf-01 phpredis-develop]#
[root@hf-01 phpredis-develop]# ./configure --with-php-config=/usr/local/php/bin/php-config
[root@hf-01 phpredis-develop]# make
[root@hf-01 phpredis-develop]# make install Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-zts-20131226/ [root@hf-01 phpredis-develop]#
[root@hf-01 phpredis-develop]# ls /usr/local/php/lib/php/extensions/no-debug-zts-20131226/ opcache.so redis.so [root@hf-01 phpredis-develop]#
[root@hf-01 phpredis-develop]# /usr/local/php/bin/php -m |grep redis [root@hf-01 phpredis-develop]#
[root@hf-01 phpredis-develop]# /usr/local/php/bin/php -i |grep 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 [root@hf-01 phpredis-develop]#
[root@hf-01 phpredis-develop]# vim /usr/local/php/etc/php.ini 能夠將配置的一行放在文件最後面,也能夠搜索/exextension,放到相關的下面 extension = redis.so 而後保存退出
[root@hf-01 phpredis-develop]# /usr/local/php/bin/php -m |grep redis redis [root@hf-01 phpredis-develop]#
[root@hf-01 ~]# cd /usr/local/src/php-5.6.30/ [root@hf-01 php-5.6.30]# ls acinclude.m4 netware aclocal.m4 NEWS build pear buildconf php5.spec buildconf.bat php5.spec.in CODING_STANDARDS php.gif config.guess php.ini-development config.log php.ini-production config.nice README.EXT_SKEL config.status README.GIT-RULES config.sub README.input_filter configure README.MAILINGLIST_RULES configure.in README.md CREDITS README.namespaces ext README.NEW-OUTPUT-API EXTENSIONS README.PARAMETER_PARSING_API footer README.REDIST.BINS generated_lists README.RELEASE_PROCESS genfiles README.SELF-CONTAINED-EXTENSIONS header README.STREAMS include README.SUBMITTING_PATCH INSTALL README.TESTING install-sh README.TESTING2 libphp5.la README.UNIX-BUILD-SYSTEM libs README.WIN32-BUILD-SYSTEM libtool run-tests.php LICENSE sapi ltmain.sh scripts main server-tests-config.php makedist server-tests.php Makefile snapshot Makefile.frag stamp-h.in Makefile.fragments stub.c Makefile.gcov tests Makefile.global travis Makefile.objects TSRM makerpm UPGRADING meta_ccld UPGRADING.INTERNALS missing vcsclean mkinstalldirs win32 modules Zend [root@hf-01 php-5.6.30]#
[root@hf-01 php-5.6.30]# cd ext/ [root@hf-01 ext]# ls bcmath ftp mysqli pgsql standard bz2 gd mysqlnd phar sybase_ct calendar gettext oci8 posix sysvmsg com_dotnet gmp odbc pspell sysvsem ctype hash opcache readline sysvshm curl iconv openssl recode tidy date imap pcntl reflection tokenizer dba interbase pcre session wddx dom intl pdo shmop xml enchant json pdo_dblib simplexml xmlreader ereg ldap pdo_firebird skeleton xmlrpc exif libxml pdo_mysql snmp xmlwriter ext_skel mbstring pdo_oci soap xsl ext_skel_win32.php mcrypt pdo_odbc sockets zip fileinfo mssql pdo_pgsql spl zlib filter mysql pdo_sqlite sqlite3 [root@hf-01 ext]#
[root@hf-01 ext]# /usr/local/php/bin/php -m |grep zip [root@hf-01 ext]#
[root@hf-01 ext]# cd zip/ [root@hf-01 zip]# ls config.m4 CREDITS lib php_zip.c tests zip_stream.c config.w32 examples LICENSE_libzip php_zip.h TODO [root@hf-01 zip]#
[root@hf-01 zip]# /usr/local/php/bin/phpize Configuring for: PHP Api Version: 20131106 Zend Module Api No: 20131226 Zend Extension Api No: 220131226 [root@hf-01 zip]#
[root@hf-01 zip]# ./configure --with-php-config=/usr/local/php/bin/php-config
[root@hf-01 zip]# make
[root@hf-01 zip]# make install Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-zts-20131226/ [root@hf-01 zip]#
[root@hf-01 zip]# ls /usr/local/php/lib/php/extensions/no-debug-zts-20131226/ opcache.so redis.so zip.so [root@hf-01 zip]#
php錯誤日誌級別參考mysql
php開啓短標籤linux
php.ini詳解git