linux环境下安装PHP中间件ICE(三)

来源:互联网 发布:晨光麦事件 知乎 编辑:程序博客网 时间:2024/05/29 19:07

前面我们已经在linux环境下成功安装了支持PHP的ICE环境,接下来就是怎么在PHP使用ICE了。

1、修改PHP配置文件php.ini,载入ICE扩展

vim /usr/local/php/etc/php.ini
添加:
extension = "IcePHP.so"
重启服务
/etc/init.d/php-fpm reload
查看ICE是否载入成功:

1)通过命令查看已安装PHP扩展

[root@localhost ~]# php -m
显示:
gettextgmphashiceiconvlibxml
可以看到有ICE的身影了,说明已经成功了。

另外也可以通过phpinfo的方式查看:

PHP ice扩展

接下来就是在应用中载入Ice了,这里我们可以查看官方是怎么介绍的:

Your application will also need to include at least some of the Ice for PHP run-time source files (installed in /usr/share/php on RHEL, Amazon Linux, and Ubuntu, and in /usr/share/php5 on SLES). This installation directory is included in PHP's default include path, which you can verify by executing the following command:

% php -i | grep include_path

If the installation directory is listed, no further action is necessary to make the run-time source files available to your application. Otherwise, you can modify the include_path setting in php.ini to add the installation directory:

include_path = /usr/share/php:...

Another option is to modify the include path from within your script prior to including any Ice run-time file:

PHP
ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . '/usr/share/php');require 'Ice.php'; // Load the core Ice run time definitions.

0 0
原创粉丝点击