Linux安装PHP扩展模块详解(2)

你想编译一个扩展模块的时候,如果它自带的源码包ext下有这个目录,那就可以直接在目录下编译它,如果没有那就需要去官网下载,下面是给大家举例一个zip模块实验操作如下:

[root@linuxmi ~]# cd /usr/local/src/php-7.1.6 [root@linuxmi php-7.1.6]# ls acinclude.m4 configure install-sh Makefile.global php.gif README.RELEASE_PROCESS server-tests.php aclocal.m4 configure.in libphp7.la Makefile.objects php.ini-development README.SELF-CONTAINED-EXTENSIONS snapshot appveyor CONTRIBUTING.md libs makerpm php.ini-production README.STREAMS stamp-h.in build CREDITS libtool meta_ccld README.EXT_SKEL README.SUBMITTING_PATCH stub.c buildconf ext LICENSE missing README.GIT-RULES README.TESTING tests buildconf.bat EXTENSIONS ltmain.sh mkinstalldirs README.input_filter README.TESTING2 travis CODING_STANDARDS footer main modules README.MAILINGLIST_RULES README.UNIX-BUILD-SYSTEM TSRM config.guess generated_lists makedist netware README.md README.WIN32-BUILD-SYSTEM UPGRADING config.log genfiles Makefile NEWS README.namespaces run-tests.php UPGRADING.INTERNALS config.nice header Makefile.frag pear README.NEW-OUTPUT-API sapi vcsclean config.status include Makefile.fragments php7.spec README.PARAMETER_PARSING_API scripts win32 config.sub INSTALL Makefile.gcov php7.spec.in README.REDIST.BINS server-tests-config.php Zend [root@linuxmi php-7.1.6]# cd ext/ [root@linuxmi ext]# ls bcmath date ext_skel_win32.php gmp json mysqlnd pcre pdo_odbc pspell simplexml sqlite3 tokenizer xsl bz2 dba fileinfo hash ldap oci8 pdo pdo_pgsql readline skeleton standard wddx zip calendar dom filter iconv libxml odbc pdo_dblib pdo_sqlite recode snmp sysvmsg xml zlib com_dotnet enchant ftp imap mbstring opcache pdo_firebird pgsql reflection soap sysvsem xmlreader ctype exif gd interbase mcrypt openssl pdo_mysql phar session sockets sysvshm xmlrpc curl ext_skel gettext intl mysqli pcntl pdo_oci posix shmop spl tidy xmlwriter [root@linuxmi ext]# /usr/local/php7/bin/php -m |grep zip [root@linuxmi ext]# cd zip/ [root@linuxmi zip]# ls config.m4 config.w32 CREDITS examples lib LICENSE_libzip php_zip.c php_zip.h tests TODO zip_stream.c [root@linuxmi zip]# /usr/local/php7/bin/phpize Configuring for: PHP Api Version: 20160303 Zend Module Api No: 20160303 Zend Extension Api No: 320160303 [root@linuxmi zip]# ./configure --with-php-config=/usr/local/php7/bin/php-config [root@linuxmi zip]# make [root@linuxmi zip]# echo $? 0 [root@linuxmi zip]# make install Installing shared extensions: /usr/local/php7/lib/php/extensions/no-debug-zts-20160303/ [root@linuxmi zip]# ls /usr/local/php7/lib/php/extensions/no-debug-zts-20160303/ opcache.so redis.so zip.so

本文永久更新链接地址

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/45b638f37e706dcfe8749972e277b832.html