S
SDelroen
Hi,
I am interfacing PHP and Excel to build a web-based reporting tool. I am
running IIS6.0 with PHP 5.2.5 on Windows Server 2003, with Office 2003
installed.
For testing purpose, I wrote a script that just connects to Excel, opens a
workbook, saves it under another name and closes Excel:
$if_path = 'C:\if_test.xls';
$of_path = 'C:\of_test.xls';
echo date('H:i:s') . " Launch Excel application \n";
$excelApp = new COM("Excel.Application") or die("Cannot create an Excel
object");
echo date('H:i:s') . " Loaded Excel, version {$excelApp->Version}\n";
echo date('H:i:s') . " Open workbook at path $if_path\n";
$excelApp->Workbooks->Open($if_path, 2);
echo date('H:i:s') . " Save changes to $of_path\n";
$excelApp->Workbooks[1]->SaveAs($of_path);
echo date('H:i:s') . " Close Excel\n";
$excelApp->Quit();
When I open the page in Internet Explorer, if I put
"http://localhost/test.php", everything works fine, but if I put
"http://my_server_name.domain.int/test.php", the script is blocked when
trying to open the file, which means I can't access the script elsewhere than
on the server.
My guess is that Excel is run with different permissions in the second case,
so it cannot access the file, but I might be completely wrong.
Does someone have any experience in that matter ?
Thank you very much !
I am interfacing PHP and Excel to build a web-based reporting tool. I am
running IIS6.0 with PHP 5.2.5 on Windows Server 2003, with Office 2003
installed.
For testing purpose, I wrote a script that just connects to Excel, opens a
workbook, saves it under another name and closes Excel:
$if_path = 'C:\if_test.xls';
$of_path = 'C:\of_test.xls';
echo date('H:i:s') . " Launch Excel application \n";
$excelApp = new COM("Excel.Application") or die("Cannot create an Excel
object");
echo date('H:i:s') . " Loaded Excel, version {$excelApp->Version}\n";
echo date('H:i:s') . " Open workbook at path $if_path\n";
$excelApp->Workbooks->Open($if_path, 2);
echo date('H:i:s') . " Save changes to $of_path\n";
$excelApp->Workbooks[1]->SaveAs($of_path);
echo date('H:i:s') . " Close Excel\n";
$excelApp->Quit();
When I open the page in Internet Explorer, if I put
"http://localhost/test.php", everything works fine, but if I put
"http://my_server_name.domain.int/test.php", the script is blocked when
trying to open the file, which means I can't access the script elsewhere than
on the server.
My guess is that Excel is run with different permissions in the second case,
so it cannot access the file, but I might be completely wrong.
Does someone have any experience in that matter ?
Thank you very much !