I'm running into a problem with my php application. I'm building up a service application which should be connected to our ERP ( selectline ).
But I can't get to create a COM Object. This code:
<?PHP
error_reporting(E_ALL);
session_start();
date_default_timezone_set('Europe/Zurich');
echo time();
$obj = new COM("fd6c8b29-e936-4a61-8da6-b0c12ad3ba00") or die("Unable to instantiate Word");
echo "Loaded Word, version {$word->Version}\n";
?>
Returns me:
Fatal error: in C:\xampp\htdocs\com.php on line 21
I got two environments:
Server 2008 R2 + Xampp v3.1.0 |PHP 5.4.7
Server 2012 R2 + Xampp v3.1.0 | PHP 5.4.7
I had to add the php_com_dotnet.dll in the php.ini because I had COM class not found before.
Due to the fact I'm complete new to COM I have no idea where to search for the failure.
May you guys can help me out.
Thanks in advance
I changed my code a bit:
try {
$obj = new COM("word.application") or die("Unable to instantiate Word");
} catch (Exception $e) {
echo $e->getMessage() . "\n";
}
Now I get:
Failed to create COM object `word.application': Invalid Syntax
I don't get what is wrong. According to this article http://www.php.net/manual/en/class.com.php there is no need for additional parameters, right?