-2

Hello friends i am getting output of this command This code works perfectly

<?php
  echo exec('whoami');
?>

but problem in

<?php
  echo exec('C:\\Users\\user\\Desktop\\abc\\xpdfbin-win-3.04\\bin64>pdfinfo -f 1 test.pdf');
?>

can you please give me your expert advice?

5
  • Can you check same command using command line? Commented Feb 18, 2015 at 11:38
  • yes its working using command line Commented Feb 18, 2015 at 11:39
  • Try using " instead of '. Commented Feb 18, 2015 at 11:42
  • I tried with "" still no output Commented Feb 18, 2015 at 11:43
  • 1
    For out put you need to echo exec('C:\\Users\\user\\Desktop\\abc\\xpdfbin-win-3.04\\bin64>pdfinfo -f 1 test.pdf 2>&1',$output); you get output in $output Commented Feb 18, 2015 at 11:58

1 Answer 1

1

using ' for the string will disable escape sequences, so either use " or change each \\ to \

also, this might be related: PHP: Why isn't exec() returning output?

Sign up to request clarification or add additional context in comments.

1 Comment

Stil no output my friend. :(

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.