Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

php 5.6 and opcache won't build #1286

Closed
jeff-h opened this issue Nov 30, 2017 · 5 comments
Closed

php 5.6 and opcache won't build #1286

jeff-h opened this issue Nov 30, 2017 · 5 comments
Labels

Comments

@jeff-h
Copy link
Contributor

jeff-h commented Nov 30, 2017

Info:

  • Docker version 17.09.0-ce, build afdb6d4
  • Laradock commit: e779bf9
  • System info (Mac, PC, Linux): Mac
  • System info disto/version: 10.13

Issue:

Can't build php-fpm successfully when:

  • PHP_FPM_INSTALL_OPCACHE=true and
  • PHP is set to 5.6 and
  • xdebug is enabled with xdebug.remote_autostart=1.

It works when I choose PHP 7.1.

The last lines of the build output are as follows:

Libraries have been installed in:
   /usr/src/php/ext/opcache/modules

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,--rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------

Build complete.
Don't forget to run 'make test'.

Installing shared extensions:     /usr/local/lib/php/extensions/no-debug-non-zts-20131226/
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20131226/aerospike.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20131226/aerospike.so: cannot open shared object file: No such file or directory in Unknown on line 0
zend_mm_heap corrupted
error: /usr/src/php/ext/opcache/opcache.so does not exist

usage: /usr/local/bin/docker-php-ext-enable [options] module-name [module-name ...]
   ie: /usr/local/bin/docker-php-ext-enable gd mysqli
       /usr/local/bin/docker-php-ext-enable pdo pdo_mysql
       /usr/local/bin/docker-php-ext-enable --ini-name 0-apc.ini apcu apc

Possible values for module-name:

ERROR: Service 'php-fpm' failed to build: The command '/bin/sh -c if [ ${INSTALL_OPCACHE} = true ]; then     docker-php-ext-install opcache ;fi' returned a non-zero code: 123

Reproduce:

Just set PHP_FPM_INSTALL_OPCACHE=true and run $ docker-compose build php-fpm and set PHP_VERSION=56

@jeff-h
Copy link
Contributor Author

jeff-h commented Nov 30, 2017

Very very weird. I traced it (by stepping back in my git repository history) to earlier today when I changed the xdebug.ini file, specifically the following line from 0 to 1:

xdebug.remote_autostart=1

The full contents of my xdebug.ini files is:

; NOTE: The actual debug.so extention is NOT SET HERE but rather (/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini)

xdebug.remote_autostart=1
xdebug.remote_enable=1
xdebug.remote_connect_back=0
xdebug.cli_color=0
xdebug.profiler_enable=0
xdebug.remote_handler=dbgp
xdebug.remote_mode=req

xdebug.remote_port=9000
xdebug.remote_host=docker.for.mac.localhost
xdebug.idekey=PHPSTORM

If i change xdebug.remote_autostart to 0, the php-fpm builds just fine.

@jeff-h
Copy link
Contributor Author

jeff-h commented Nov 30, 2017

In php-fpm/Dockerfile-56, I moved the 11 lines of Xdebug installer section ie

#####################################
# xDebug:
#####################################

ARG INSTALL_XDEBUG=false
RUN if [ ${INSTALL_XDEBUG} = true ]; then \
    # Install the xdebug extension
    # pecl install xdebug && docker-php-ext-enable xdebug \
    # workaround for https://github.com/docker-library/php/issues/133
    #     - Xdebug breaks on access to class static property
    apt-get install -y php5-xdebug && \
    echo "zend_extension=/usr/lib/php5/20131226/xdebug.so" > /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
;fi

# Copy xdebug configration for remote debugging
COPY ./xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini

from above the opcache installer section to below it, and suddenly php-fpm builds fine ie the problem goes away.

I would really like to know if anyone else has gotten php 5.6 + opcache + xdebug working without doing this code shuffle, or am I the only one who's ever tried it?

@bestlong
Copy link
Member

bestlong commented Mar 2, 2018

Hi @jeff-h right now TravisCI server test job build result is pass.
can you retry again?

@stale
Copy link

stale bot commented Feb 2, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Stale label Feb 2, 2020
@stale
Copy link

stale bot commented Feb 23, 2020

Hi again 👋 we would like to inform you that this issue has been automatically closed 🔒 because it had not recent activity during the stale period. We really really appreciate your contributions, and looking forward for more in the future 🎈.

@stale stale bot closed this as completed Feb 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants