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

pecl install not working on php 8.2 fpm image #36056

Open
cdayjr opened this issue Mar 5, 2024 · 4 comments
Open

pecl install not working on php 8.2 fpm image #36056

cdayjr opened this issue Mar 5, 2024 · 4 comments

Comments

@cdayjr
Copy link

cdayjr commented Mar 5, 2024

What version of gRPC and what language are you using?

grpc: 1.62.0
language: php

What operating system (Linux, Windows,...) and version?

Linux Debian 12

What runtime / compiler are you using (e.g. python version or version of gcc)

PHP 8.2

What did you do?

docker run --platform linux/amd64 php:8.2-fpm bash -c "apt-get update && apt-get install libz-dev && pecl install grpc"

What did you expect to see?

grpc pecl package installed successfully

What did you see instead?

...
/bin/bash /tmp/pear/temp/pear-build-defaultuserghphXu/grpc-1.62.0/libtool --tag=CC --mode=compile cc -I. -I/tmp/pear/temp/grpc -I/tmp/pear/temp/pear-build-defaultuserghphXu/grpc-1.62.0/include -I/tmp/pear/temp/pear-build-defaultuserghphXu/grpc-1.62.0/main -I/tmp/pear/temp/grpc -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/tmp/pear/temp/grpc/include -I/tmp/pear/temp/grpc/src/core/ext/upb-gen -I/tmp/pear/temp/grpc/src/core/ext/upbdefs-gen -I/tmp/pear/temp/grpc/src/php/ext/grpc -I/tmp/pear/temp/grpc/third_party/abseil-cpp -I/tmp/pear/temp/grpc/third_party/address_sorting/include -I/tmp/pear/temp/grpc/third_party/boringssl-with-bazel/src/include -I/tmp/pear/temp/grpc/third_party/re2 -I/tmp/pear/temp/grpc/third_party/upb -I/tmp/pear/temp/grpc/third_party/utf8_range -I/tmp/pear/temp/grpc/third_party/xxhash  -DHAVE_CONFIG_H  -std=c11 -g -O2 -D_GNU_SOURCE   -fvisibility=hidden
  -DOPENSSL_NO_ASM -D_GNU_SOURCE -DWIN32_LEAN_AND_MEAN     -D_HAS_EXCEPTIONS=0 -DNOMINMAX -DGRPC_ARES=0     -DGRPC_POSIX_FORK_ALLOW_PTHREAD_ATFORK=1     -DGRPC_XDS_USER_AGENT_NAME_SUFFIX='"PHP"'     -DGRPC_XDS_USER_AGENT_VERSION_SUFFIX='"1.62.0"' -DZEND_COMPILE_DL_EXT=1 -c /tmp/pear/temp/grpc/src/core/ext/upb-gen/google/api/expr/v1alpha1/checked.upb_minitable.c -o src/core/ext/upb-gen/google/api/expr/v1alpha1/checked.lo  -MMD -MF src/core/ext/upb-gen/google/api/expr/v1alpha1/checked.dep -MT src/core/ext/upb-gen/google/api/expr/v1alpha1/checked.lo
/tmp/pear/temp/pear-build-defaultuserghphXu/grpc-1.62.0/libtool: line 1290: src/core/ext/upb-gen/google/api/expr/v1alpha1/checked.loT: No such file or directory
mkdir src/core/ext/upb-gen/google/api/expr/v1alpha1/.libs
mkdir: cannot create directory 'src/core/ext/upb-gen/google/api/expr/v1alpha1/.libs': No such file or directory
make: *** [Makefile:780: src/core/ext/upb-gen/google/api/expr/v1alpha1/checked.lo] Error 1
ERROR: `make' failed

although different runs have ended on different lines

Anything else we should know about your project / environment?

I'm running on an Apple Silicon mac but I'm not sure how much it matters in docker. Feel free to ask any other details.

@cdayjr
Copy link
Author

cdayjr commented Mar 7, 2024

Was able to get an amd64 laptop up and running and grpc installs fine, still wondering what's going on with the apple silicon mac not working.

@tangix
Copy link

tangix commented Mar 14, 2024

What's your Docker config and version? I'm building your command line just find on macOS 14.4 running Docker 4.28.0 (139021).
Some time ago (+18 months) I had problems building another php extension (coolprop) causing issues. I then enabled the (then experimental) VirtioFS and Rosetta support (also disabled):

image
Build process completed successfully
Installing '/usr/local/lib/php/extensions/no-debug-non-zts-20220829/grpc.so'
install ok: channel://pecl.php.net/grpc-1.62.0
configuration option "php_ini" is not set to php.ini location
You should add "extension=grpc.so" to php.ini

@cdayjr
Copy link
Author

cdayjr commented Mar 18, 2024

I don't think I've messed around with these settings but let me know if anything stands out, at least what I have matches your screenshot.

Screenshot 2024-03-18 at 7 37 49 AM
Screenshot 2024-03-18 at 7 38 07 AM

@vasilestefirta
Copy link

vasilestefirta commented Apr 3, 2024

I have a similar issue on an Apple M3 Pro Macbook:

  • macOS Sonoma 14.4.1
  • docker desktop 4.28.0
  • grpc 1.62.0
  • Dockerfile FROM php:7.4-apache-buster

However, I can build the same docker image successfully on another Apple M2 Pro Macbook machine:

  • macOS Ventura 13.6.2
  • docker desktop 4.28.0
  • grpc 1.62.0
  • Dockerfile FROM php:7.4-apache-buster

It's been 2 days trying to figure out a solution and no success yet. I tried:

  • using other official PHP docker images like php:8.2-apache-buster
  • downgrading to lower versions of grpc (example: pecl install grpc-1.59.1)
  • installing rosetta as suggested here

and nothing helped.

My Dockerfile contents (removed many lines to keep it shorter):

FROM php:7.4-apache-buster
COPY .msmtprc /.msmtprc
RUN mkdir -p /usr/share/man/man1
RUN apt-get update && apt-get install -y \
	libfreetype6-dev \
	libjpeg62-turbo-dev \
	libmcrypt-dev \
	libpng-dev \
	libzip-dev \
	net-tools \
	msmtp \
	vim \
	zip \
        npm \
        git \
        ncat \
        psmisc \
        && pecl install mcrypt \
        && pecl install grpc \
        && pecl install redis \
        && docker-php-ext-enable grpc \
        && docker-php-ext-install -j$(nproc) iconv \
        && docker-php-ext-install pdo_mysql \
        && docker-php-ext-install sockets \
        && docker-php-ext-install zip \
        && docker-php-ext-configure gd --with-freetype --with-jpeg \
        && docker-php-ext-install -j$(nproc) gd \
        && docker-php-ext-enable redis

# some more stuff here...

WORKDIR /var/www/html/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants