请教高手:我在freebsd下面编写php扩展,出现错误Unable to load dynamic library
hahu 2006-02-15 10:16:54 下面是我操作的过程
1. ext目录下面./ext_skel --extension=test_module
2. 编辑test_module目录下的config.m4,去掉下面三行的dnl注释
dnl PHP_ARG_ENABLE(test_module, whether to enable test_module support,
dnl Make sure that the comment is aligned:
dnl [ --enable-test_module Enable test_module support])
3. 执行./buildconf
4. 执行./configure --enable-test_module
5. 编译make
6. 测试扩展./php -f ext/sms_queue/test_module.php
出现下面这样的错误
Content-type: text/html
X-Powered-By: PHP/4.3.1
<br />
<b>Warning</b>: dl() [<a href='http://www.php.net/function.dl'>function.dl</a>]: Unable to load dynamic library
'./test_module.so' - Cannot open "./test_module.so" in <b>/home/packages/php-4.3.1/ext/test_module/test_module.php</b> on line
<b>3</b><br />
Functions available in the test extension:<br>
<br />
<b>Warning</b>: Invalid argument supplied for foreach() in <b>/home/packages/php-4.3.1/ext/test_module/test_module.php</b> on
line <b>8</b><br />
<br>
Module test_module is not compiled into PHP