估计是你的PHP初始化文件没有设置,你可以参照手册里对dl()的说明,比方:/***
The directory where the extension is loaded from depends on your platform: Windows - If not explicitly set in the php.ini, the extension is loaded from c:\php4\extensions\ by default. Unix - If not explicitly set in the php.ini, the default extension directory depends on 
whether PHP has been built with --enable-debug or not whether PHP has been built with (experimental) ZTS (Zend Thread Safety) support or not the current internal ZEND_MODULE_API_NO (Zend internal module API number, which is basically the date on which a major module API change happened, e.g. 20010901) Taking into account the above, the directory then defaults to <install-dir>/lib/php/extensions/ <debug-or-not>-<zts-or-not>-ZEND_MODULE_API_NO, e.g. /usr/local/php/lib/php/extensions/debug-non-zts-20010901 or /usr/local/php/lib/php/extensions/no-debug-zts-20010901. 注: dl() is not supported in multithreaded Web servers. Use the extensions statement in your php.ini when operating under such an environment. However, the CGI and CLI build are not affected ! 注: dl() is case sensitive on Unix platforms. */

解决方案 »

  1.   

    Not supported in multithreaded Web servers
      

  2.   

    Not supported in multithreaded Web servers
      

  3.   

    Not supported in multithreaded Web servers是不是意味着不能在WINXP(多线程)上使用?
    the CGI and CLI build are not affected ! 这句话是指CGI模式不受影响还是CGI模式无效(无法调用dl()? )??
      

  4.   

    我总结一下这几天得到的结论,请大家看看对不对:
    1、可以php可以调用第三方的DLL
    2、但第三方的DLL必须使用COM接口编写(不知道这样表达对不对,因为我还没有使用过COM编程)
    3、第三方的DLL必须使用regsvr32进行注册才能被调用,并且DLL文件要复制到system32 和 php/extensions目录下,要在PHP.INI里面加入extension=mydll.dll
    4、调用的语句为:
     <?php
        dl('mydll.dll');  //dl()函数据说在PHP6以后就不能使用了
        $api = new win32;
        $api->registerfunction("int plus(int x,int y) From mydll.dll");//一个加法运算
        $sum=$api->plus(1,2);
        echo $sum;  //结果应该为3
     ?>
    5、PHP必须以CGI模式加载有没有错误和遗漏的,请大家帮忙看看。
      

  5.   

    各位方便的话,帮忙讲讲怎样以CGI方式安装PHP吧,唉,搞不定啊
      

  6.   

    终于搞定了,不过是用的IIS+PHP的模式,APACHE的CGI模式始终搞不定。请大家帮帮忙,搞定马上结帖。