1

I have installed Lampp-x64-5.6.3 in my OpenSuse 13.2 OS. I have built a program which require the execution of qpdf which I have installed from the OpenSuse Repo itself.

Well when I run the commands (given below) I get no response & nothing works at all whereas I am able to execute other binary files within the /usr/bin/ directory.

   $execQuery =  "/usr/bin/qpdf --decrypt --stream-data=uncompress --force-version=1.4 ".escapeshellarg('/opt/lampp/htdocs/test/test.pdf')." ". escapeshellarg('/opt/lampp/htdocs/test/temptest.pdf');
   shell_exec($execQuery);
#OR
   $execQuery =  "/usr/bin/qpdf '/opt/lampp/htdocs/test/test.pdf' '/opt/lampp/htdocs/test/temptest.pdf'";
   shell_exec($execQuery);

PHP safe_mode is off, shell_exec, exec, system etc are enabled. Still I am unable to run this particular binary (/usr/bin/qpdf).

I am getting output when I run the commands echo or ls -l or dir or even skype in the php shell_execute functions. The permission for the file is: -rwxr-xr-x 1 root root 85248 Jun 18 10:31 /usr/bin/qpdf

But however I am able to execute qpdf command via Terminal of the OS. and it creates the file perfectly.

The directory /opt/lampp/htdocs/test/ is writable by both qpdf and apache/lampp

I have tried almost all methods mentioned in various forums but still can't get this executable run the file.

Thanks in advance.

UPDATE:

As suggested tried out this one:

$command =  "/usr/bin/qpdf --decrypt --stream-data=uncompress --force-version=1.4 ".escapeshellarg('/opt/lampp/htdocs/test/test.pdf')." ". escapeshellarg('/opt/lampp/htdocs/test/temptest.pdf');
shell_exec($command. " > /opt/lampp/htdocs/debug.log 2>&1");

The errors are logged!

......    
/opt/lampp/lib/libstdc++.so.6: version `GLIBCXX_3.4.9' not found
...... 

SOLUTION:

I simply had to delete the /usr/lib/libstdc++.so.6 file or rename it.

RUN in terminals:

sudo mv /usr/lib/libstdc++.so.6 /usr/lib/libstdc++.so.6___
Ganesh Rathinavel
  • 1,243
  • 4
  • 17
  • 38
  • As i mentioned i have tested all the methods found online which includes the question you have marked duplicate. Nothing worked. – Ganesh Rathinavel Jul 11 '15 at 19:12
  • @mario Here is what i did: $command = "/usr/bin/qpdf --decrypt --stream-data=uncompress --force-version=1.4 ".escapeshellarg('/opt/lampp/htdocs/test/test.pdf')." ". escapeshellarg('/opt/lampp/htdocs/test/temptest.pdf'); shell_exec($command. " > /home/username/debug.log 2>&1"); nothing happens. no log file is created. But the log is generated when i use the Terminal – Ganesh Rathinavel Jul 11 '15 at 19:37
  • 1
    If *you* can't uncover an error message, then nobody here will be able to help. (You're not going to receive anything but guessed answers with nothing concrete to investigate. The most common guess for SuSE distros being: SELinux of course, check the syslogs as well.) – mario Jul 11 '15 at 19:40
  • Mr. @mario you have saved my life. all what I did was remove libstdc++.so.6 from /opt/lampp/lib/ . this file was creating the trouble. I am sure someone else will look for the solution for this problem one day. i am just leaving the solution here. :) thanks again – Ganesh Rathinavel Jul 11 '15 at 19:49
  • 1
    This question is still a bit too vague. Hardly anyone is going to google it by accident. However, if you have a concrete error message now, then update the question. And summarize the solution as self-answer tomorrow. If you can list your debugging steps and the final fix, then it's definitely useful to future users. – mario Jul 11 '15 at 19:53
  • @mario I have done it! – Ganesh Rathinavel Jul 11 '15 at 19:55

1 Answers1

0

I simply had to delete the /usr/lib/libstdc++.so.6 file or rename it.

RUN in terminals:

sudo mv /usr/lib/libstdc++.so.6 /usr/lib/libstdc++.so.6___

Ganesh Rathinavel
  • 1,243
  • 4
  • 17
  • 38