Centos 6リモートサーバーでfreeswitchを実行していて、テスト用にローカルマシン(Windows 7 x64 PHPバージョン5.3.8)にXAMPPをインストールしています。Modイベントソケット(http://wiki.freeswitch.org/wiki/Event_Socket )を使用して、イベントソケットライブラリ( http://wiki.freeswitch.org/wiki/Event_Socket_Library)を使用してphpスクリプトからfreeswitchに接続しようとしています。 )。
私のphpスクリプトは次のとおりです。
#!/usr/bin/php
<?php
require_once('ESL.php');
$command = "show channels";
$sock = new ESLconnection('xxx.xxx.xxx.xxx', '8021', 'fsAdmin');
$res = $sock->api($command);
printf("%s\n", $res->getBody());
?>
ここで、xxx.xxx.xxx.xxxはfreeswitchサーバーのアドレスです。
私には2つの問題があります:
Windowsでは、どこにも見つからないphp_ESL.dllが必要なようです。私が持っている唯一のファイルは次のとおりです。
- ESL.php
- esl_wrap.cpp
- Makefile
- php_ESL.h
PHPバージョン5.3.8を使用しており、ESL.phpでdl()関数を使用すると、次のようになります。致命的なエラー:C:\ xampp \ htdocs \ phpesl \ ESL.phpで未定義の関数dl()を呼び出す
+ dl()関数はESL.phpで呼び出されます:
// Try to load our extension if it's not already loaded. if (!extension_loaded("ESL")) { if (strtolower(substr(PHP_OS, 0, 3)) === 'win') { if (!dl('php_ESL.dll')) return; } else { // PHP_SHLIB_SUFFIX is available as of PHP 4.3.0, for older PHP assume 'so'. // It gives 'dylib' on MacOS X which is for libraries, modules are 'so'. if (PHP_SHLIB_SUFFIX === 'PHP_SHLIB_SUFFIX' || PHP_SHLIB_SUFFIX === 'dylib') { if (!dl('ESL.so')) return; } else { if (!dl('ESL.'.PHP_SHLIB_SUFFIX)) return; } } }
誰かがこれを解決する方法を知っているか、同じ問題に遭遇しましたか?
ありがとう。