0

当我用 php 5(或 5.6)编译 phpmod 时,一切正常。但是当我安装 php7.2 时,php ESL 不再起作用。

原来,在 ESL.php 中使用 dl() 在运行时动态加载扩展。然而, dl() 选项在后来的 php.ini 版本中被删除了。

这是输出

# ./single_command.php status

PHP Warning: dl(): Dynamically loaded extensions aren't enabled in 
/usr/src/freeswitch/libs/esl/php/ESL.php on line 24 
Command to run is: status 
PHP Fatal error: Uncaught Error: Call to undefined function 
new_ESLconnection() in /usr/src/freeswitch/libs/esl/php/ESL.php:157 
Stack trace: 
#0 /usr/src/freeswitch/libs/esl/php/single_command.php(9): 
ESLconnection->__construct('127.0.0.1', '8021', 'ClueCon') 
#1 {main} 
thrown in /usr/src/freeswitch/libs/esl/php/ESL.php on line 157 

我试图在 php.ini 中加载 ESL.so 扩展,但这也不起作用。

这是输出:

# php -dextension=/usr/lib/php/20160303/ESL.so 

PHP Warning: PHP Startup: ESL: Unable to initialize module 
Module compiled with module API=20131226 
PHP compiled with module API=20170718 
These options need to match 
in Unknown on line 0 

任何想法让 ESL PHP 与 php7.2 一起工作?

我需要使用 php > 7.1.3(网络框架要求)

PS:我在 JIRA 上开了一张票,但我什么也没回来。

https://freeswitch.org/jira/browse/ESL-132

4

1 回答 1

1

您需要在安装 PHP 7.2 开发设置编译 ESL.so以避免 API 编译不匹配错误,并在使用语句部分php.ini下的文件中加载 ESL.so 扩展名。[PHP]extension=

这是我的例子:

[PHP]
...
extension=/usr/local/src/freeswitch-git/libs/esl/php/ESL.so
...

/usr/local/src/freeswitch-git/是 FreeSWITCH 的源码目录,ESL.so已经用make phpmodin编译过/usr/local/src/freeswitch-git/libs/esl

一些有用的命令:

# list the compiled extensions/modules (ESL would be listed here on success)
php -m
# detailed PHP configuration
php -i
# get the API option in the compiled ESL module (adapt to your case)
strings /usr/local/src/freeswitch-git/libs/esl/php/ESL.so | grep API

希望这可以帮助!

于 2018-03-05T22:05:02.000 回答