Home > Backend Development > PHP Tutorial > PHP怎么编译安装扩展包

PHP怎么编译安装扩展包

PHPz
Release: 2020-09-05 14:28:21
Original
2504 people have browsed it

PHP编译安装扩展包的方法:首先进入源码包扩展目录;然后修改“php.ini”文件中的“extension=pdo_mysql.so”;最后打开“Zlib”库支持即可。

PHP怎么编译安装扩展包

PHP 编译后安装扩展包

1.phpize 安装

  进入源码包扩展目录:

[root@d1 pdo_mysql]# cd /usr/local/src/php-5.6.13/ext/pdo_mysql
[root@d1 pdo_mysql]# /usr/local/php/bin/phpize
Configuring for:
PHP Api Version:         20131106
Zend Module Api No:      20131226
Zend Extension Api No:   220131226
[root@d1 pdo_mysql]# ./configure --with-php-config=/usr/local/php/bin/php-config --with-mysql=/usr --with-zlib-dir=/usr/local/lib
[root@d1 pdo_mysql]make
[root@d1 pdo_mysql]make install
.........
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
Installing shared extensions:     /usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/
 /usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/pdo_mysql.so
Copy after login

 

  修改php.ini 文件extension = /usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/pdo_mysql.so,或者把 /usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/pdo_mysql.so 文件放到php.ini 中指定扩展目录,则添加extension =pdo_mysql.so即可

    注意:1,mysql yum 安装的路径是/usr, curl 编译也是一样添加

             2, --with-mysql=/usr ,--with-zlib-dir 不带会报错(configure: error: Try adding --with-zlib-dir=

. Please check config.log for more information),打开Zlib 库支持。

curl 同上;

更多相关技术文章,请访问PHP中文网

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template