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

Dockerfile won't build; Fails with PHP Warning #20

Closed
mitchnemirov opened this issue Mar 3, 2020 · 4 comments
Closed

Dockerfile won't build; Fails with PHP Warning #20

mitchnemirov opened this issue Mar 3, 2020 · 4 comments

Comments

@mitchnemirov
Copy link

When running the provided docker build command, I get the following error when it gets to the pecl commands:
Step 6/16 : RUN pecl install apcu && pecl install yaml-2.0.4 && docker-php-ext-enable apcu yaml ---> Running in e2bede677c0a PHP Warning: Module 'intl' already loaded in Unknown on line 0

I honestly don't know much about PHP, and as it's all building within a Docker container, there's not much scrounging around my local system I can do. I don't have PHP installed locally, if that helps at all.

Many thanks in advance for the help!

@mitchnemirov
Copy link
Author

I just poked around the Dockerfile and found that the issue was actually just the pecl installation. The PHP warning made the build hang, then fail after pecl couldn't find any installation candidates.

For some reason, commenting out this line fixed it:
echo 'extension=intl.so'; \

That's in this previous RUN step:
RUN { \ echo 'opcache.memory_consumption=128'; \ echo 'opcache.interned_strings_buffer=8'; \ echo 'opcache.max_accelerated_files=4000'; \ echo 'opcache.revalidate_freq=2'; \ echo 'opcache.fast_shutdown=1'; \ echo 'opcache.enable_cli=1'; \ echo 'upload_max_filesize=128M'; \ echo 'post_max_size=128M'; \ **# echo 'extension=intl.so'; \** } > /usr/local/etc/php/conf.d/php-recommended.ini

Again, still not sure what's truly going on here, but after commenting that line, the Dockerfile built successfully, albeit with a few non-destructive warnings. My scrollback limited itself so I can't find those specific errors, but I believe 1 or 2 of them had to do with adding similar 'extension=intl.so' lines to the php config.

Will report back whether the webserver spins up!

@mitchnemirov
Copy link
Author

Ok, the webserver spun up successfully after running the provided docker run command:
docker run -p 8000:80 grav:latest

All seems well with my build now, but I'll leave the issue open for now in case that line I commented out is needed, and/or the initial setup needs to be fixed in the master branch.

@fbnlsr
Copy link

fbnlsr commented Mar 3, 2020

I got the same problem as well today. Removing that line fixed the issue for me too.

I'm pretty sure the problem comes from the fact that intl is enabled by default in PHP 7.2, 7.3 and 7.4. So this line might be useless now?

@rhukster
Copy link
Member

rhukster commented Mar 4, 2020

Fixed

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

No branches or pull requests

3 participants