Home  >  Article  >  Backend Development  >  LAMP中PHP效能 的动态扩展

LAMP中PHP效能 的动态扩展

WBOY
WBOYOriginal
2016-06-13 11:36:45700browse

LAMP中PHP功能 的动态扩展


php的动态扩展

我的php版本是php-5.4.6,现在在线跑着lamp,但是目前不支持gd扩展,不想重新编译安装,所以我想尝试一下给php来个动态扩展

第一步,需要执行phpize生成先关的编译包

[[email protected] src]# cd php-5.4.6/ext


里面有各种扩展,当然也有我要选的gd,既然我想装gd,为了避免出错先

[[email protected] ext]# yum install gd-devle  -y

[[email protected] ext]# cd gd


[[email protected] gd]#  phpize


[[email protected] gd]# ./configure && make && make install

在执行这一步的时候报错了

/usr/src/php-5.4.6/ext/gd/gd.c:1582: error: too many arguments to function ;zend_list_insert‘

解决这个问题vi /usr/src/php-5.4.6/ext/gd/gd.c

将zend_list_insert(font, le_gd_font TSRMLS_CC) 改为zend_list_insert(font, le_gd_font )然后保存,重新编译安装即可。


安装成功后会出现下面的语句
Installing shared extensions:     /usr/local/lib/php/extensions/no-debug-zts-20090626/

第二步,修改php配置文件

编译完成后

[[email protected] gd]# cd modules/
[[email protected] modules]# ls
gd.so

生成一个gd.so的库文件,需要加到php.ini的扩展中,然后需要在/usr/local/lib/php.ini文件中加下面两行

vi /usr/loca/lib/php.ini

extension_dir="/usr/local/lib/php/extensions/no-debug-zts-20090626/"
extension=gd.so

第三步,重启apache服务即可


Statement:
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