Error Failed loading opcache.so: opcache.so: undefined symbol: compiler_globals - Apache 2.4 / PHP 5.5 / Ubuntu 12.10 VPS

喜你入骨 提交于 2019-12-13 02:27:16

问题


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

回答1:


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.



来源:https://stackoverflow.com/questions/22201013/error-failed-loading-opcache-so-opcache-so-undefined-symbol-compiler-globals

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!