错误无法载入opcache.so:opcache.so:未定义的符号:compiler_globals - 阿帕奇2.4 / 5.5 PHP / Ubuntu的12.10 VPS [英] Error Failed loading opcache.so: opcache.so: undefined symbol: compiler_globals - Apache 2.4 / PHP 5.5 / Ubuntu 12.10 VPS

查看:2247
本文介绍了错误无法载入opcache.so:opcache.so:未定义的符号:compiler_globals - 阿帕奇2.4 / 5.5 PHP / Ubuntu的12.10 VPS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有点不熟悉这样做,但我的目标是让2.4的Apache和PHP 5.5和运行上运行Ubuntu 12.10一个非托管VPS。我成功地让他们既要工作,服务HTML和PHP的内容,但我有在我的设置几个方面的问题。先用opcache.so这是我想使用PHP 5.5的一个主要原因。我在conf文件模块opcache.so,但我收到此错误来自Apache:

Apache的错误日志:
周二15年3月4日:19:00.624085 2014年] [mpm_event:声明] [1853年的PID:TID 140683657721600] AH00489:阿帕奇/ 2.4.8-dev的(UNIX)PHP / 5.5.11-dev的配置 - 恢复正常运作
无法载入/usr/lib/php5/20100525/opcache.so:/usr/lib/php5/20100525/opcache.so:未定义的符号:compiler_globals

研究性我还没有发现任何人谁解决了这个问题。我发现了一些previous帖子建议PHP可能需要不同的编译。我不知道是不是与我的具体配置,但是这是从GitHub的源代码编译我还是第一次。我的PHP信息显示PHP版本5.5.11-dev的...是最新的,我可以编译?

是我用下面正确的配置?

任何建议得到这个错误修复将是极大的AP preciated。

  CD的/ usr / local / src目录/
混帐克隆--branch PHP-5.5 https://github.com/php/php-src.git php55
CD的/ usr / local / src目录/ php55
室射频配置
./buildconf即可--force的./configure \\
--enable-opcache \\
--enable-bcmath \\
--enable-日历\\
--enable-DBA \\
--enable-EXIF \\
--enable-FTP \\
--enable-mbstring支持\\
--enable-shmop \\
--enable-SIGCHILD \\
--enable-肥皂\\
--enable-插座\\
--enable-sysvmsg \\
--enable-WDDX \\
--enable-ZIP \\
--with-apxs2 =的/ usr /本地/ Apache2的/ bin中/ APXS \\
--with-BZ2 \\
--with-配置文件路径=在/ usr /本地/的Apache2 / conf目录\\
--with卷曲\\
--with-GD \\
--with-JPEG-DIR = / usr / lib目录\\
--with-gettext的\\
--with-mcrypt的\\
--with-mysql的-袜子= /运行/ mysqld的/ mysqld.sock \\
--with-mysqli的\\
--with-的OpenSSL \\
--with-PDO MySQL的\\
--with-PDO-pgsql的\\
--with-XMLRPC \\
--with-zlib的让&功放;&安培; \\
使测试&放大器;&安培; \\
使安装


解决方案

您正在使用的的Apache2 MPM 。所以PHP构建一个ZTS(Zend的线程系统)版本。请参见阿帕奇prefork VS工人MPM 查找有关此的讨论。随着MPM PHP在一个线程阵列存储它的编译器全局变量。然而,OPcache正在寻找非线程版本的这种结构的 compiler_globals

海事组织,如果您使用的是PHP,然后使用MPM是一个错误,因为(i)本PHP运行慢〜25-50%;(二)扩展功能无法正常工作; (三)OPcache不正确测试与ZTS的基础之上。坚持一个prefork工人的配置,并重建。

有使用反向代理,如鱿鱼或nginx的,等等更高的性能的选择,但这些配置这些需要更多的系统管理员的技能。

I am a bit unfamiliar with doing this, but my goal was to get Apache 2.4 and PHP 5.5 up and running on a unmanaged VPS running Ubuntu 12.10. I was successful in getting them both to operate and serve html and PHP content, but I am having issues in a few areas with my setup. First with opcache.so which is a main reason I wanted to use PHP 5.5. I have the module opcache.so in the conf files, but I receive this error from Apache:

Apache Error Log: Tue Mar 04 15:19:00.624085 2014] [mpm_event:notice] [pid 1853:tid 140683657721600] AH00489: Apache/2.4.8-dev (Unix) PHP/5.5.11-dev configured -- resuming normal operations Failed loading /usr/lib/php5/20100525/opcache.so: /usr/lib/php5/20100525/opcache.so: undefined symbol: compiler_globals

Researching I have not found anyone who has solved this issue. Some previous posts I found suggested PHP may need to be compiled differently. I do not know if it is related to my specific configuration, but this was the first time I compiled from a github source. My php info shows "PHP Version 5.5.11-dev"... is that the latest I can compile?

Is the configuration I used below correct?

Any suggestions to get this error fixed would be greatly appreciated.

cd /usr/local/src/
git clone --branch PHP-5.5 https://github.com/php/php-src.git php55
cd /usr/local/src/php55
rm -rf configure
./buildconf --force

./configure \
--enable-opcache \
--enable-bcmath \
--enable-calendar \
--enable-dba \
--enable-exif \
--enable-ftp \
--enable-mbstring \
--enable-shmop \
--enable-sigchild \
--enable-soap \
--enable-sockets \
--enable-sysvmsg \
--enable-wddx \
--enable-zip \
--with-apxs2=/usr/local/apache2/bin/apxs \
--with-bz2 \
--with-config-file-path=/usr/local/apache2/conf \
--with-curl \
--with-gd \
-–with-jpeg-dir=/usr/lib \
--with-gettext \
--with-mcrypt \
--with-mysql-sock=/run/mysqld/mysqld.sock \
--with-mysqli \
--with-openssl \
--with-pdo-mysql \
--with-pdo-pgsql \
--with-xmlrpc \
--with-zlib

make && \
make test && \
make install

解决方案

You're using Apache2 MPM. So PHP builds an ZTS (Zend Threaded System) build. See Apache Prefork vs Worker MPM for a discussion on this. With MPM PHP stores its compiler globals in a thread array. However, OPcache is looking for the non-threaded version of this structure compiler_globals.

IMO, if you are using a PHP, then using MPM is a mistake as (i) the PHP runs ~25-50% slower, (ii) many extension don't work; (iii) OPcache isn't properly tested with ZTS builds. Stick to a Prefork worker configuration, and rebuild.

There are higher performance options using a reverse proxy such as Squid or nginx, etc, but configuring these these require more Sysadmin skills.

这篇关于错误无法载入opcache.so:opcache.so:未定义的符号:compiler_globals - 阿帕奇2.4 / 5.5 PHP / Ubuntu的12.10 VPS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆