尝试 运行 OpenShift 上的 PhantomJS:无法修补 GhostDriver 以便它可以绑定到服务器 IP 地址

Trying to run PhantomJS on OpenShift: cannot patch GhostDriver so that it can bind on the server IP address

tl;dr

当我无法在 Linux 服务器上成为 root 时,如何解决 version 'GLIBCXX_3.4.15' not found


我想在 OpenShift 上使用 PhantomJS。如 this article, PhantomJS GhostDriver binds on localhost only, while on OpenShift, you cannot bind anything on localhost (you need to specify the machine IP address). Paolo Bernardi (the author of the article) shares a patch 中所述,修复了 PhantomJS,因此可以绑定 IP 地址。

问题是提供的补丁在我的 OpenShift 服务器上不起作用:当 运行 ./phantomjs -v 在我已打补丁的 PhantomJS 安装上时,我遇到了分段错误。所以我决定用 the fix by myself on a Debian server I have, thanks to PhantomJS documentation:

编译 PhantomJS
sudo apt-get install build-essential g++ flex bison gperf ruby perl libsqlite3-dev libfontconfig1-dev libicu-dev libfreetype6 libssl-dev libpng-dev libjpeg-dev python ttf-mscorefonts-installer
git clone git://github.com/ariya/phantomjs.git
cd phantomjs
git checkout 1.9
# apply the fix
./build.sh

当 运行 ./phantomjs -v 在已编译的二进制文件上时,我得到 1.9.8:它起作用了。

在 OpenShift 和 运行 ./phantomjs -v 上复制此二进制文件时,我发现错误:

./phantomjs: /usr/lib64/libstdc++.so.6: version 'GLIBCXX_3.4.15' not found (required by ./phantomjs)

知道如何解决这个问题吗?这个错误的原因是什么?请原谅我缺乏系统知识:)


更新(和解决方案):

感谢 moleculartear,我在 RHEL 上编译了一个补丁二进制文件 OS:没有错误了!

工作的 PhantomJS 二进制文件:https://github.com/jrestful/server/blob/master/seo/phantomjs-1.9.8-patched.tar.gz?raw=true


更多详情:

我无法在 OpenShift 上更新 GLIBC 版本,因为我不能成为 root(除非有一些解决方法)。

我无法直接在 OpenShift 上编译 PhantomJS,因为我没有足够的 space 用于该服务器上的 the sources

我的 OpenShift 卡带:Tomcat 7 (JBoss EWS 2.0) + MongoDB 2.4 + RockMongo 1.1.

在我的 Debian 服务器上:

$ uname -a
Linux servername 3.2.0-4-amd64 #1 SMP Debian 3.2.41-2 x86_64 GNU/Linux

$ strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBC
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
GLIBCXX_3.4.9
GLIBCXX_3.4.10
GLIBCXX_3.4.11
GLIBCXX_3.4.12
GLIBCXX_3.4.13
GLIBCXX_3.4.14
GLIBCXX_3.4.15
GLIBCXX_3.4.16
GLIBCXX_3.4.17
GLIBC_2.2.5
GLIBC_2.3
GLIBC_2.3.2
GLIBCXX_DEBUG_MESSAGE_LENGTH

在我的 OpenShift 服务器上:

$ uname -a
Linux servername 2.6.32-504.3.3.el6.x86_64 #1 SMP Fri Dec 12 16:05:43 EST 2014 x86_64 x86_64 x86_64 GNU/Linux

$ strings /usr/lib/libstdc++.so.6 | grep GLIBC
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
GLIBCXX_3.4.9
GLIBCXX_3.4.10
GLIBCXX_3.4.11
GLIBCXX_3.4.12
GLIBCXX_3.4.13
GLIBC_2.0
GLIBC_2.3
GLIBC_2.4
GLIBC_2.1
GLIBC_2.1.3
GLIBC_2.3.2
GLIBC_2.2
GLIBCXX_FORCE_NEW
GLIBCXX_DEBUG_MESSAGE_LENGTH

自从 OpenShift Online 运行s 在 RHEL 上,您应该能够将 CentOS 安装到本地计算机上的虚拟机中(或 运行 云中某处的虚拟机)并编译 PhantomJS 的一个版本使用补丁,然后将其上传到您的 OpenShift 服务器并使用它。

如果您不能这样做,请使用 help.openshift.com 上的联系我们表格并参考这个 Whosebug 问题。