可以,下面就是php手册上调用com的例子// starting word
$word = new COM("word.application") or die("Unable to instanciate Word");
print "Loaded Word, version {$word->Version}\n";//bring it to front
$word->Visible = 1;//open an empty document
$word->Documents->Add();//do some weird stuff
$word->Selection->TypeText("This is a test...");
$word->Documents[1]->SaveAs("Useless test.doc");//closing word
$word->Quit();//free the object
$word->Release();
$word = null;

解决方案 »

  1.   

    好象不行。
    需要手动注册
    regever32  注册文件
      

  2.   

    那么在linux下可以怎样调用外部库(.so)中的函数了?
      

  3.   

    dl
    载入 PHP 扩充模块。
    语法: int dl(string library);
    返回值: 整数
    函数种类: PHP 系统功能
    内容说明 
    本函数可动态的载入 PHP 所需的外部扩充模块 library。
    eg:
    <?
    if (!extension_loaded('gd')) {
        if (!dl('gd.so')) {
            exit;
        }
    }
    ?>
    Note: 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 ! Note: dl() is case sensitive on unix platforms. 
      

  4.   

    dl()函数用在linux?
    com()用在 win?
      

  5.   

    扩充模块是什么意思?是任意一个.so库吗?
    我写了一个test.so,用dl无法加载?
      

  6.   

    错误提示:
    Warning: Invalid library (maybe not a PHP library) 'test.dll' in E:\web\www\php_test\index.php on line 2php library 怎么写了?