0

I have some pdf file in folder C:\wamp\www\PhpProject1\uploads\1\AllFiles and pdftk exists in the same folder.In case of merging by commandline C:\wamp\www\PhpProject1\uploads\1\AllFiles\pdftk *.pdf output 123.pdf works. but in php i am using

$command = '/uploads/1/AllFiles/pdftk *.pdf output 123.pdf';    
exec($command);

it doesn't work and also in case of full path. how to solve this.thanks in advance.

user3789344
  • 81
  • 1
  • 3
  • 14
  • does $command work in the commandline? It doesn't matter if a different command works in the command line, only if the command you are using from php works in the command line. Your $command has an absolute path so does it work absolutely .. lol .. if that doesn't work in the command line, then why would it work in php using exec()? – ArtisticPhoenix Nov 07 '14 at 06:34
  • no $command doesnt works on commandline.but with 'pdftk *.pdf output 123.pdf' thats i said. – user3789344 Nov 07 '14 at 06:40
  • What is the error, when you use the full path? – Antoan Milkov Nov 07 '14 at 08:48
  • You may wish to use the full absolute path? Seems you are missing "C:\wamp\www\PhpProject1\" from $command. I think your confusion is you think php is running inside PhpProject1? I am not sure where the "working dir" is right off hand for exec but just use the full path in this case. – ArtisticPhoenix Nov 07 '14 at 17:51

0 Answers0