简体   繁体   English

错误加载opcache.so失败:opcache.so:未定义符号:Compiler_globals-Apache 2.4 / PHP 5.5 / 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

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. 我对此并不熟悉,但是我的目标是启动Apache 2.4和PHP 5.5并在运行Ubuntu 12.10的非托管VPS上运行。 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. 我成功地使它们同时可以操作和提供html和PHP内容,但是我的设置在某些方面存在问题。 First with opcache.so which is a main reason I wanted to use PHP 5.5. 首先使用opcache.so,这是我要使用PHP 5.5的主要原因。 I have the module opcache.so in the conf files, but I receive this error from Apache: 我在conf文件中有模块opcache.so,但是我从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 Apache错误日志:2014年2月4日星期二15:19:00.624085] [mpm_event:notice] [pid 1853:tid 140683657721600] AH00489:配置了Apache / 2.4.8-dev(Unix)PHP / 5.5.11-dev-恢复正常操作无法加载/usr/lib/php5/20100525/opcache.so:/usr/lib/php5/20100525/opcache.so:未定义的符号:editor_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. 我发现以前的一些帖子建议PHP可能需要以不同的方式进行编译。 I do not know if it is related to my specific configuration, but this was the first time I compiled from a github source. 我不知道它是否与我的特定配置有关,但这是我第一次从github来源编译。 My php info shows "PHP Version 5.5.11-dev"... is that the latest I can compile? 我的php信息显示“ PHP Version 5.5.11-dev” ...是我可以编译的最新版本吗?

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 . 您正在使用Apache2 MPM So PHP builds an ZTS (Zend Threaded System) build. 因此,PHP构建了ZTS(Zend线程系统)构建。 See Apache Prefork vs Worker MPM for a discussion on this. 有关此方面的讨论,请参见Apache Prefork vs Worker MPM With MPM PHP stores its compiler globals in a thread array. 通过MPM,PHP将其编译器全局变量存储在线程数组中。 However, OPcache is looking for the non-threaded version of this structure compiler_globals . 然而,OPcache正在寻找非线程版本的结构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; IMO,如果您使用的是PHP,则使用MPM是一个错误,因为(i)PHP的运行速度降低了约25-50%,(ii)许多扩展都不起作用; (iii) OPcache isn't properly tested with ZTS builds. (iii)OPcache未与ZTS构建正确测试。 Stick to a Prefork worker configuration, and rebuild. 坚持Prefork worker配置,然后进行重建。

There are higher performance options using a reverse proxy such as Squid or nginx, etc, but configuring these these require more Sysadmin skills. 使用反向代理(例如Squid或nginx等)有更高的性能选项,但是配置这些选项需要更多的Sysadmin技能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM