markus antionus
markus antionus

Reputation: 23

Using Internet Explorer via php .com extension - why does it take so long?

I got this message everytime i try to run a .COM script.

Fatal error: Maximum execution time of 30 seconds exceeded in D:\wamp\www\php\page.php on line 3

.NET is installed on my computer

PHP CODE:

$Browser = new COM('InternetExplorer.Application');
$Browserhandle = $Browser->HWND;
$Browser->Visible = true;
$Browser->Fullscreen = true;
$Browser->Navigate('http://www.stackoverflow.com');

while($Browser->Busy){
com_message_pump(4000);
}

$img = imagegrabwindow($Browserhandle, 0);
$Browser->Quit();
imagepng($img, 'screenshot.png');

Fatal error: Maximum execution time of 30 seconds exceeded in D:\wamp\www\php\page.php on line 3

.NET is installed on my computer.

Upvotes: 1

Views: 242

Answers (1)

GWW
GWW

Reputation: 44131

Do you expect that the com program will run for longer than 30 seconds? If so use set_time_limit to increase the maximum execution time of your script. ie set_time_limit(0); for unlimited duration.

Upvotes: 3

Related Questions