Jump to content

exec() question


T0Rtur3

Recommended Posts

Ok, I'm relatively new to php, but I'm having a real problem executing a program using php.

 

server info:

Windows Server 2003

IIS 6

PHP 5.2.6

 

Now, the confusing part. I've put the exe that I wish to run in the System32 directory, so I am able to run it in command line by just typing: pdftk

This works fine when I run all the variables through it in command line. When I try to run it in php using:

$ex1 = exec('pdftk 1.pdf 2.pdf 3.pdf cat output 4.pdf', $data, $dt);

It doesn't work.

 

I am able to run ping using php, ie:

$ping_ex = exec("ping google.com", $ping_result, $pr);
if (count($ping_result) > 1){ 
echo 'ping online - response'; 
} else { 
echo 'ping offline - response'; 
}

This code works fine, I get a "ping online - response" returned.

 

Permissions on the pdftk.exe file are set to allow iusr and the domain I am running the script from on IIS has scripts and executables allowed.

 

Anyone have any ideas?

Link to comment
https://forums.phpfreaks.com/topic/161401-exec-question/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.