当前位置: 首页 > 工具软件 > PHP-Calendar > 使用案例 >

php添加calendar扩展模块

袁英豪
2023-12-01

#首先查找当前使用的的php版本
[root@server1 src]# /usr/local/bin/php --version
PHP 5.6.24 (cli) (built: Aug 25 2016 12:14:39)
Copyright © 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright © 1998-2016 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright © 1999-2016, by Zend Technologies

#找到相对应的php版本,下载、上传到服务器并解压

#重新编译php
#phpize是否在对应的目录下
[root@server1 ~]# ll /usr/local/php/bin/phpize
-rwxr-xr-x. 1 root root 4534 Jul 11 2018 /usr/local/php/bin/phpize

[root@server1 ~]#/usr/local/php/bin/phpize

[root@server1 php-5.6.24]# cd ext/calendar/

[root@server1 calendar]# pwd
/usr/local/src/php-5.6.24/ext/calendar

#php-config是否在对应的目录下
[root@server1 calendar]# ll /usr/local/php/bin/php-config
-rwxr-xr-x. 1 root root 3392 Jul 11 2018 /usr/local/php/bin/php-config

[root@server1 calendar]#./configure —with-php-config=/usr/local/php/bin/php-config —enable-calendar

[root@server1 calendar]#make & make install

#修改php.ini
[root@server1 calendar]# cd /usr/local/php/etc/

[root@server1 etc]#vim php.ini
#添加对应的模块
[curl]
extension_dir = /usr/local/php/lib/php/extensions/no-debug-zts-20131226/
extension = calendar.so

#重启php-fpm
/etc/init.d/php-fpm restart

#查看calendar模块是否添加成功,如果有calendar,则该模块添加成功
[root@server1 etc]# php -m| grep calendar
calendar

#至此大功告成

 类似资料: