ÄúµÄλÖãºÑ°ÃÎÍøÊ×Ò³£¾±à³ÌÀÖÔ°£¾PHP ±à³Ì£¾PHP5ÖÐÎÄÊÖ²á
PHP5ÖÐÎÄÊÖ²á

PHP ºÍ COM

PHP ¿ÉÒÔÔÚ Win32 ƽ̨ÖзÃÎÊ COM ºÍ DCOM ¶ÔÏó¡£

  1. aˆ‘a»oc«‹ao†a£¬€a£¬a DLL a£¤ašaŸc¡ìeR!cR—a€‚aœ‰aŠža3•aœ¡§ PHP a£¬-e¿e!Œe¿™a£¬a DLL a—i¼Ÿ
  2. a€œUnsupported variant type: xxxx (0xxxxx)a€a˜¡¥a»€a1ˆa„a€i¼Ÿ
  3. aœ¡§ PHP a£¬-aœ‰a¡¥eƒ½a“co¦Ìa¡¥e¡ì†a¡¥1e¡À!a—i¼Ÿ
  4. a¡¥a»£¤a¡ã†a£¬€a£¬a COM a¡¥1e¡À!a¿a-˜aœ¡§ session a£¬-a—i¼Ÿ
  5. a€Ža ¡¤a¡¥a»£¤a•eŽ¡¤ COM cš„e”™e¡¥¡¥i¼Ÿ
  6. aˆ‘eƒ½aƒaœ¡§ Perl a£¬-a£¬€a ¡¤a»Ž PHP e„šaœ¬c”Ÿaˆ DLL a–‡a»¶a—i¼Ÿ
  7. a€œUnable to obtain IDispatch interface for CLSID {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}a€a˜¡¥a»€a1ˆa„a€i¼Ÿ
  8. a€Ža ¡¤a»Že¿œc«¡¥aœaŠ!a™¡§e¿e!Œ COM a¡¥1e¡À!i¼Ÿ
  9. aˆ‘a¾—aˆ¡ãa£¬€a£¬aa€œDCOM is disabled in C:\path...\scriptname.php on line 6a€a¿!a¡¥i¼Œao”e¡¥£¤a€Ža1ˆaŠži¼Ÿ
  10. aœ‰a¡¥eƒ½aœ¡§ PHP e!¦Ìe¡éa£¬-aŠ e½½i¼a“co¦Ì ActiveX a¡¥1e¡À!a—i¼Ÿ
  11. aœ‰a¡¥eƒ½a¾—aˆ¡ãa£¬€a£¬ac»„a»¶aœ¡§e¿e!Œa£¬-cš„aRža¾‹a—i¼Ÿ
  12. aœ‰aŠža3•a¡è„c† COM a¡¥1e¡À!a£¬-a‘e€cš„ao‹a»¶a—i¼Ÿ
  13. aˆ‘aœ¡§a¡ãe¡¥•e¡ãƒc”¡§a£¬€a£¬aa‰“a¼€ao†a¡èšaoŽa£¬€a£¬aaŽ£¤a¡êcš„ COM a¡¥1e¡À!a£¬-cš„a–1a3•a—¶c¡é¡ãaˆ¡ãe—Re¡é˜i¼Œao”e¡¥£¤a€Ža1ˆaŠži¼Ÿ
  14. e¿™a1ˆe¡¥¡¯ PHP a¡¥a»£¤a’Œ COM a£¬€e¦Ì¡¤a¡¤£¤a½œi¼Œe‚¡êa1ˆ COM+ a‘¡éi¼Ÿ
  15. a|‚ažœ PHP a¡¥a»£¤a“co¦Ì COM a¡¥1e¡À!i¼Œe‚¡êa1ˆa¡¥a»£¤eR¾aƒ3c»“aˆ PHP c”¡§ MTS a£¤cR!c†c»„a»¶e¦Ì„aoa—i¼Ÿ
  16. ÎÒ½¨Á¢ÁËÒ»¸ö DLL À´×öijÖÖ¼ÆËã¡£Óа취ÔÚ PHP ÖÐÔËÐÐÕâ¸ö DLL Âð£¿

    Èç¹ûÕâÊǸö¼òµ¥µÄ DLL ÄÇô»¹Ã»Óа취ÔÚ PHP ÖÐÔËÐÐËü¡£Èç¹ûÕâ¸ö DLL Öаüº¬ÓÐÒ»¸ö COM ·þÎñÆ÷²¢ÇÒËüʵÏÖÁË IDispatch ½Ó¿Ú£¬ÄÇÓпÉÄÜ·ÃÎÊËü¡£

    ¡°Unsupported variant type: xxxx (0xxxxx)¡±ÊÇʲôÒâ˼£¿

    Óм¸Ê®ÖÖ VARIANT ÀàÐÍÒÔ¼°ËüÃǵÄ×éºÏ¡£´ó¶àÊýÒѾ­±»Ö§³ÖÁ˵«»¹Óм¸ÖÖÉÐδʵÏÖ¡£Êý×éûÓÐÍêÈ«±»Ö§³Ö¡£Ö»ÓÐһάµÄ½öÓÃ×÷Ë÷ÒýµÄÊý×é¿ÉÒÔÔÚ PHP ºÍ COM Ö®¼ä´«µÝ¡£Èç¹ûÄã·¢ÏÖÆäËüδ֧³ÖµÄÀàÐÍ£¬Çëµ±×÷Ò»¸ö bug ±¨¸æ£¨Èç¹ûÉÐδ±»±¨¸æµÄ»°£©²¢Ìṩ¾¡¿ÉÄܶàµÄÐÅÏ¢¡£

    ÔÚ PHP ÖÐÓпÉÄܲÙ×Ý¿ÉÊÓ¶ÔÏóÂð£¿

    Ò»°ãÀ´ËµÊÇ¿ÉÒԵģ¬µ«ÊÇ PHP ´ó¶¼ÓÃÀ´×÷Ϊ web ½Å±¾ÓïÑÔ²¢ÔËÐÐÔÚ web ·þÎñÆ÷µÄÉÏÏÂÎÄ»·¾³ÖУ¬Òò´Ë¿ÉÊÓ¶ÔÏó¾ö²»»áÔÚ·þÎñÆ÷µÄ×ÀÃæÉÏÏÔʾ¡£Èç¹ûÄã°Ñ PHP ÓÃ×÷Ó¦ÓóÌÐò½Å±¾ÀýÈç½áºÏ PHP-GTK À´Ê¹Óã¬ÄÇô·ÃÎʺÍͨ¹ý COM À´²Ù×Ý¿ÉÊÓ¶ÔÏó·½ÃæûÓÐÏÞÖÆ¡£

    ¿ÉÒÔ½«Ò»¸ö COM ¶ÔÏó±£´æÔÚ session ÖÐÂð£¿

    ²»ÐС£COM µÄʵÀý±»¿´×÷ÊÇ×ÊÔ´£¬Òò´ËÖ»ÔÚÒ»¸ö½Å±¾µÄÉÏÏÂÎÄÖÐÓÐЧ¡£

    ÔõÑù¿ÉÒÔ²¶»ñ COM µÄ´íÎó£¿

    ÔÚ PHP 5 ÖУ¬COM À©Õ¹»á·¢³ö com_exception Òì³£ÐÅÏ¢£¬¿ÉÒÔ²¶»ñ²¢¼ì²é code ³ÉÔ±À´¾ö¶¨ÏÂÒ»²½µÄÐÐΪ¡£

    ÔÚ PHP 4 ÖгýÁËÓà PHP ×Ô¼ºÌṩµÄ°ì·¨Ö®Í⣨@£¬track_errors£¬..£©²»¿ÉÄܲ¶»ñ COM µÄ´íÎó¡£

    ÎÒÄÜÏñÔÚ Perl ÖÐÒ»Ñù´Ó PHP ½Å±¾Éú³É DLL ÎļþÂð£¿

    ²»ÐУ¬PHP ûÓÐÕâÑùµÄ¹¤¾ß¡£

    ¡°Unable to obtain IDispatch interface for CLSID {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}¡±ÊÇʲôÒâ˼£¿

    ´Ë´íÎó¿ÉÒÔÓжàÖÖÔ­Òò£º

    • ´íÎóµÄ CLSID
    • ÕÒ²»µ½ËùÇëÇóµÄ DLL
    • ËùÇëÇóµÄ×é¼þûÓÐʵÏÖ IDispatch ½Ó¿Ú

    ÔõÑù´ÓÔ¶¶Ë·þÎñÆ÷ÔËÐÐ COM ¶ÔÏó£¿

    ÍêÈ«ºÍÔËÐб¾µØ¶ÔÏóÒ»Ñù¡£Ö»Ð뽫Զ¶Ë·þÎñÆ÷µÄ IP ×÷ΪµÚ¶þ¸ö±äÁ¿´«µÝ¸ø COM µÄ¹¹Ô캯Êý¼´¿É¡£

    È·ÈÏÔÚ php.ini ÖÐÉ趨ÁË COM=TRUE¡£

    Îҵõ½Ò»¸ö¡°DCOM is disabled in C:\path...\scriptname.php on line 6¡±ÐÅÏ¢£¬Ó¦¸ÃÔõô°ì£¿

    ±à¼­ php.ini ²¢É趨 COM=TRUE¡£

    ÓпÉÄÜÔÚ PHP Ò³ÃæÖмÓÔØ£¯²Ù×Ý ActiveX ¶ÔÏóÂð£¿

    Õâ²»¹Ø PHP µÄÊ¡£Èç¹ûÔÚ HTML ÎĵµÖÐÇëÇóµÄ»°£¬ActiveX ¶ÔÏó±»¼ÓÔØÔÚ¿Í»§¶Ë¡£ÕâºÍ PHP ½Å±¾Ã»ÓйØϵ£¬Òò´ËÒ²²»¿ÉÄܺͷþÎñÆ÷¶Ë·¢ÉúÖ±½ÓµÄ½»»¥×÷Óá£

    ÓпÉÄܵõ½Ò»¸ö×é¼þÔÚÔËÐÐÖеÄʵÀýÂð£¿

    ÔڴºŵİïÖúÏÂÕâÓпÉÄÜ¡£Èç¹ûÄãÏëµÃµ½Í¬Ò»¸ö word ʵÀýµÄ¶à¸öÒýÓÃÄã¿ÉÒÔÕâÑù½¨Á¢´ËʵÀý£º

    <?php
    $word 
    = new COM("C:\docs\word.doc");
    ?>

    Èç¹ûûÓÐÔËÐÐÖеÄʵÀýÕ⽫½¨Á¢Ò»¸öеÄʵÀý£¬·ñÔò½«»á·µ»ØÕýÔÚÔËÐÐÖеÄʵÀýµÄ¾ä±ú£¬Èç¹û¿ÉÓõĻ°¡£

    Óа취´¦Àí COM ¶ÔÏóÖз¢Ë͵ÄʼþÂð£¿

    ¿ÉÒÔ×Ô¶¨ÒåʼþÊÕ±¨·½²¢ÇÒÓà com_event_sink() º¯Êý°ó¶¨Ö®¡£¿ÉÒÔÓà com_print_typeinfo() À´Èà PHP ²úÉúʼþÊÕ±¨·½ÀàµÄ¿ò¼Ü¡£

    ÎÒÔÚ³¢ÊÔµ÷ÓÃÒ»¸ö´ò¿ªÁ˶àÓÚÒ»¸ö½Ó¿ÚµÄ COM ¶ÔÏóÖеķ½·¨Ê±Åöµ½ÎÊÌ⣬Ӧ¸ÃÔõô°ì£¿

    ÎÒÒ²²»ÖªµÀÔõô°ì£¬ÎÒÏëÕâû°ì·¨¡£Èç¹ûʲôÈËÓжԴËÎÊÌâµÄÃ÷È·ÐÅÏ¢Çë» ¸æËßÎÒ¡£:)

    Õâô˵ PHP ¿ÉÒÔºÍ COM Ò»Æð¹¤×÷£¬ÄÇô COM+ ÄØ£¿

    COM+ ͨ¹ýʹÓà MTS ºÍ MSMQ À´¹ÜÀí×é¼þµÄ¿ò¼ÜÀ©Õ¹ÁË COM£¬µ«²¢Ã»ÓÐʲôÌØÊâÖ®´¦Ê¹ PHP ·ÇÒªÖ§³ÖÕâÑùµÄ×é¼þ¡£

    Èç¹û PHP ¿ÉÒÔ²Ù×Ý COM ¶ÔÏó£¬ÄÇô¿ÉÒÔÉèÏë½áºÏ PHP Óà MTS À´¹ÜÀí×é¼þ×ÊÔ´Âð£¿

    PHP ±¾Éí»¹²¢²»´¦ÀíÊÂÎñ¡£Òò¶øÈç¹û³ö´íÒ²²»»á·¢¶¯³·»Ø»úÖÆ¡£Èç¹ûÄãʹÓÃÁËÖ§³ÖÊÂÎñ´¦ÀíµÄ×é¼þÄÇÄã²»µÃ²»×Ô¼ºÊµÏÖÊÂÎñ¹ÜÀí¡£