T0Rtur3 Posted June 8, 2009 Share Posted June 8, 2009 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? Quote Link to comment https://forums.phpfreaks.com/topic/161401-exec-question/ Share on other sites More sharing options...
Daniel0 Posted June 8, 2009 Share Posted June 8, 2009 Define "doesn't work". Quote Link to comment https://forums.phpfreaks.com/topic/161401-exec-question/#findComment-851751 Share on other sites More sharing options...
T0Rtur3 Posted June 8, 2009 Author Share Posted June 8, 2009 It doesn't generate the pdf. Running the same parameters on the server through command line it works fine. Oh, and for the path to the pdfs I've tried both absolute and relative paths.. Neither work with php, both work fine with command line. Quote Link to comment https://forums.phpfreaks.com/topic/161401-exec-question/#findComment-851759 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.