Heim  >  Artikel  >  Backend-Entwicklung  >  LAMP中PHP效能 的动态扩展

LAMP中PHP效能 的动态扩展

WBOY
WBOYOriginal
2016-06-13 12:36:23755Durchsuche

LAMP中PHP功能 的动态扩展


php的动态扩展

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

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

[root@localhost src]# cd php-5.4.6/ext


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

[root@localhost ext]# yum install gd-devle  -y

[root@localhost ext]# cd gd


[root@localhost gd]#  phpize


[root@localhost 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配置文件

编译完成后

[root@localhost gd]# cd modules/
[root@localhost 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服务即可


Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn