title: exec command not working in php but works in terminal/putty
body: <p>I am trying to run convert 'sample_(2).pdf[1]' 'sample.jpg' through php exec like below</p>
  
  <pre><code>&gt; exec(" convert 'sample_(2).pdf[1]' 'sample.jpg' ");
  </code></pre>
  
  <p>But it is not working in php but works great in terminal. I tried below codes also to check wethee exec is working with php.</p>
  
  <p><code>echo exec('whoami');</code>   //It is working and giving me result</p>
  
  <blockquote>
    <p>exec("cp 'sample_(2).pdf' sample2.pdf");</p>
  </blockquote>
  
  <p>//It is not working.</p>
  
  <p>But all the commands are running in terminal. Any idea would help me. I am scratching my head for the last two days.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I got it working. There were mistakes with my file path.</p>