Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.