मैं अपनी स्क्रिप्ट में एक शब्द दस्तावेज़ खोलने की कोशिश कर रहा हूं, लेकिन मुझे एक ही त्रुटि मिल रही है।कक्षा 'COM' नहीं मिला
Fatal error: Class 'COM' not found in /Applications/XAMPP/xamppfiles/htdocs/**/**.php on line 3
मेरे कोड:
<?php
$word = new COM("word.application") or die("Unable to instantiate Word");
$word->Visible = 1;
$word->Documents->Open("wordfile.docx");
$temp = $word->Dialogs->Item(228); // returns wdDialogToolsWordCount dialog object
$temp->Execute(); //updates the word count
$numwords = $temp->Words(); //gets the words out of it
echo 'Word count = '.$numwords;
$word->Quit();
?>
मैं php.ini
बदल सकते हैं और COM
अनुभाग से अर्धविराम दूर करने के लिए कोशिश की है।
[com]
path to a file containing GUIDs, IIDs or filenames of files with TypeLibs
com.typelib_file =
allow Distributed-COM calls
com.allow_dcom = true
autoregister constants of a components typlib on com_load()
com.autoregister_typelib = true
register constants casesensitive
com.autoregister_casesensitive = false
show warnings on duplicate constat registrations
com.autoregister_verbose = true
और अभी भी वही त्रुटि मिल रही है।
मै मैक पर XAMMP
और लिनक्स आधारित वेब होस्टिंग का उपयोग कर रहा हूं।
COM केवल विंडोज़ पर उपलब्ध है। –