-1

I am running Ubuntu 16.04 LTS Desktop and the lampp stack (apache2, php7.0, mysql). I am attempting to execute phantomjs -v from PhP and it says that it can not find `GLIBCXX_3.4.9', yet when I execute via console it runs and outputs the version (2.1.1) just fine.

The factors I have ruled out:

Permissions

Info:

PHP: Version 7.1.10
OS: 16.04.1-Ubuntu

Error:

/phantomjs-2.1.1-linux-x86_64/bin/phantomjs: /opt/lampp/lib/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by phantomjs-2.1.1-linux-x86_64/bin/phantomjs)

PhP Exec:

$cmd = "/phantomjs-2.1.1-linux-x86_64/bin/phantomjs -v";
$my_output = shell_exec($cmd.' 2>&1; echo $?');
echo $my_output."<br><br>".get_current_user()."<br><br>".$cmd;

Edit: This is not a libstdc++ error. As I've said I can run it in console fine, it is only when I try to run it in PhP that I have an error.

libstdc++6 is already the newest version (5.4.0-6ubuntu1~16.04.5).

contempt@contempt-MacBookPro:/opt/lampp/lib$ strings libstdc++.so.6 | grep GLIB
    GLIBCXX_3.4
    GLIBCXX_3.4.1
    GLIBCXX_3.4.2
    GLIBCXX_3.4.3
    GLIBCXX_3.4.4
    GLIBCXX_3.4.5
    GLIBCXX_3.4.6
    GLIBCXX_3.4.7
    GLIBCXX_3.4.8
    GLIBC_2.3
    GLIBC_2.4
    GLIBC_2.2.5
halfer
  • 19,824
  • 17
  • 99
  • 186
Exsanity
  • 33
  • 4
  • Possible duplicate of [Where can I get a copy of the file libstdc++.so.6.0.15](https://stackoverflow.com/questions/16605623/where-can-i-get-a-copy-of-the-file-libstdc-so-6-0-15) – TIGER Dec 17 '17 at 03:16
  • I already have all needed GLIBCs installed (for phantom JS that is GLIBCXX_3.4.9 and GLIBC_2.7.) the issue is PhP is not finding them. – Exsanity Dec 17 '17 at 03:20

1 Answers1

1

Obviously I posted my question with a minute or two less research than I should of had. The shell_exec command is trying to use the /lib/ from /opt/lampp/ meanwhile console in Ubuntu uses it from /usr/lib/ Removing the libstdc++ from /opt/lampp and copying it from my user files fixed my issue.

contempt@contempt-MacBookPro:/opt/lampp/lib$ cp -a /usr/lib/x86_64-linux-gnu/libstdc++.so.6 .
Exsanity
  • 33
  • 4
  • When you get a moment, please click the tick icon to the left of this answer, to mark the question as resolved. Thanks! – halfer Dec 22 '17 at 19:49