I wrote a function in PHP to convert doc to pdf, but it doesn’t work.
In the beginning, my function worked, although it didn’t close Winword.exe, I closed it by hand.
Now, when I open the site page with this function, Apache stops working.
$word = new COM('word.application');
$word->Visible = 0;
$word->Documents->Open('C:\Apache\smena3.krw.rzd\www\docnz\oblachnye.docx');
$word->Documents[1]->SaveAs(APPLICATION_DOCNZ_FOLDER.'\oblachnye.pdf',17);
$word->Quit('0','0','0');
$word = null;
$this->render('docnz');
If it was already working and the only problem is that apache stops working, you could consider adding to your script a command to restart apache.
I don’t know what kind of a system you are running, but this might work if you’re running linux:
The last echo would be just to make sure apache restarted correctly.