Freeswitch ESL PHP不适用于php7.2
当我用PHP5或5.6编译phpmod时,一切正常。但是当我安装php7.2时,php ESL不再工作 事实证明,在ESL.php中,使用dl在运行时动态加载扩展。然而,dl选项在后来的php版本中被删除 下面是Freeswitch ESL PHP不适用于php7.2,php,freeswitch,php-7.2,Php,Freeswitch,Php 7.2,当我用PHP5或5.6编译phpmod时,一切正常。但是当我安装php7.2时,php ESL不再工作 事实证明,在ESL.php中,使用dl在运行时动态加载扩展。然而,dl选项在后来的php版本中被删除 下面是 # ./single_command.php status PHP Warning: dl(): Dynamically loaded extensions aren't enabled in /usr/src/freeswitch/libs/esl/php/ESL.php on
# ./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.3Web框架要求
我在吉拉身上开了一张票,但我什么也没拿回来
您需要在安装了PHP7.2开发设置之后编译ESL.so,以避免API编译不匹配错误,并使用extension=语句将ESL.so扩展加载到[PHP]部分下的PHP.ini文件中 以下是我举的一个例子:
[PHP]
...
extension=/usr/local/src/freeswitch-git/libs/esl/php/ESL.so
...
/usr/local/src/freeswitch git/是freeswitch的源目录,ESL.so已在/usr/local/src/freeswitch git/libs/ESL中使用make phpmod编译
一些有用的命令:
# 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
希望这有帮助 你好,菲利普。谢谢你的回答。实际上我以前试过,但没用。不幸的是,我仍然得到一个不匹配。是的,我在编译之前安装了php7.2。问题出在/usr/src/freeswitch/libs/esl/php/esl.php文件中,该文件从源代码构建freeswitchPHP_SHLIB_后缀在MacOS X上给出'dylib',但模块是'so'。如果PHP_SHLIB_SUFFIX=='dylib'{if!dl'ESL.so'return;}否则{if!dl'ESL.'.PHP_SHLIB_SUFFIX return;}dl就是导致问题的那个。下面是我目前使用的。套接字的老式方式:嗨,Anis,您是否下载了FreeSWITCH并在安装PHP后运行了./bootstrap.sh+./configure?您可能希望在生成的/usr/src/freeswitch/libs/esl/php/Makefile中grep php,以检查其中的各种文件是否引用了正确的php版本。是的,Phillipe,当然我会运行./bootstrap以获取标题、./configure、make和make install