From:             dezzell at gamanetworks dot com
Operating system: Windows 2003 Server
PHP version:      5.2.6
PHP Bug Type:     COM related
Bug description:  Problem using new com

Description:
------------
I'm having problems getting COM objects to work. I'm trying to get Crystal
Reports to work with my PHP application and have been working on this for
the past 2 days. I've done so many searches and have tried every example I
have come across. I always get HTTP 500 server errors with PHP Fatal errors
in the log files when trying to load COM objects.
I have PHP 5.2.6 installed on two different Windows 2003 servers, one with
IIS 6 and the other with Apache HTTP 2.2 server. PHP works great on both
servers, but when I try to create a new com object, I get an HTTP 500
error. Below is some of the code that I have tried with no success.

$creport=new com("CrystalReports12.ObjectFactory.1 ") or die("cannot load
cr com");
$o_CrApplication = $creport
->CreateObject("CrystalDesignRunTime.Application");
or
$o_CrApplication = $creport ->CreateObject("CrystalRunTime.Application");
or
$o_CrApplication = $creport
->CreateObject("CrystalRunTime.Application.12");
I have tried other com objects and get the same HTTP 500 error.
$fso = new COM("Scripting.FileSystemObject");
$f = $fso->GetFile("c:\\test.txt");

I checked my php.ini and made changes to the [com] section, but still have
problems.
[COM]
com.allow_dcom = true
com.autoregister_typelib = true
>From the command prompt, I run php -r "new
COM('CrystalReports12.ObjectFactory.1')->
CreateObject('CrystalRuntime.Application.12');" and do not get any errors
or warnings. 
I currently have Crystal Reports 12 installed and even tried to test with
version 9, but always get the HTTP 500 error with log errors such as the
following:
PHP Fatal error:  Uncaught exception 'com_exception' with message
'<b>Source:</b> Unknown<br/><b>Description:</b> Unknown'
PHP Fatal error:  Call to undefined method com::OpenReport()
PHP Fatal error:  Uncaught exception 'com_exception' with message 'Failed
to create COM object


I need to get this to work and can't seem to find the solution. Let me
know if you need me to provide any additional information.

Thanks,
Dave



-- 
Edit bug report at http://bugs.php.net/?id=46522&edit=1
-- 
Try a CVS snapshot (PHP 5.2):        
http://bugs.php.net/fix.php?id=46522&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):        
http://bugs.php.net/fix.php?id=46522&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):        
http://bugs.php.net/fix.php?id=46522&r=trysnapshot60
Fixed in CVS:                        
http://bugs.php.net/fix.php?id=46522&r=fixedcvs
Fixed in CVS and need be documented: 
http://bugs.php.net/fix.php?id=46522&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=46522&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=46522&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=46522&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=46522&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=46522&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=46522&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=46522&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=46522&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=46522&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=46522&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=46522&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=46522&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=46522&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=46522&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=46522&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=46522&r=mysqlcfg

Reply via email to