Hi, I am trying to learn using PHP with Access and MS SQL. I found an example and tried to run it, using COM, but get an error. I am not sure if I need to set something up before being able to use COM in PHP:
<?php
// starting word
$word = new COM("word.application") or die("Unable to instantiate Word");
echo "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 = null;
?>
I get:
Fatal error: Cannot instantiate non-existent class: com in www.demo.com/testWord.php on line 3
Also, will I be able to use PHP/Access in a linux-based web server, or do I need a MS based web server with support for PHP?
Thanks.