-
Notifications
You must be signed in to change notification settings - Fork 1.5k
-
- Laravel-mongodb Version: 3.7
- PHP Version: 7.4
- Database Driver & Version: mongodb 1.8.1
Description:
After a correct installation of the mongodb driver for php I installed using composer in a laravel project this library.
Steps to reproduce
- in php:7.4-fpm-alpine container I run
apk add --update --no-cache --virtual .docker-php-mongodb-dependancies \
heimdal-dev && \
pecl install mongodb && \
docker-php-ext-enable mongodb && \
apk del .docker-php-mongodb-dependancies && \
php -m;
- I have another container to use composer
composer:
image: composer:latest
container_name: composer
volumes:
- ./src:/var/www/html
working_dir: /var/www/html
depends_on:
- php
networks:
- laravel
- composer require jenssegers/mongodb
- Installation request for mongodb/mongodb (locked at 1.7.1, required as ^1.7) -> satisfiable by mongodb/mongodb[1.7.1].
To enable extensions, verify that they are enabled in your .ini files:
- /usr/local/etc/php/php-cli.ini
-
the module in the php container is correctly installed and I am able to connect to the mongo server using a php driver
-
I bypassed the composer error usign --ignore-platform-reqs
-
Laravel mongo db authentication works, but when i try to execute query i have the following errors
php | [22-Oct-2020 15:15:40] WARNING: [pool www] child 8 exited on signal 11 (SIGSEGV) after 35.431576 seconds from start
php | [22-Oct-2020 15:15:40] NOTICE: [pool www] child 9 started
nginx | 2020年10月22日 15:15:40 [error] 6#6: *1 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 172.29.0.1, server: localhost, request: "GET /test HTTP/1.1", upstream: "fastcgi://172.29.0.4:9000", host:
Expected behaviour
I tried editing permission and some configuration file in order to execute correctly the request but nothing
Actual behaviour
I recieved a 502 Bad gateway error due to php-fpm SIGSEGV
my nginx config file
Schermata 2020年10月23日 alle 08 47 49
Beta Was this translation helpful? Give feedback.
All reactions
Hello,
I don't see how your error related to this library at all. As it has been already said you've misconfigured your docker/php installation and still you didn't provide actual php errors.
That's really sad.
Thanks!
Replies: 5 comments 1 reply
-
Hello,
I don't see how your error related to this library at all. As it has been already said you've misconfigured your docker/php installation and still you didn't provide actual php errors.
That's really sad.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions
-
- Laravel-mongodb Version: 3.7
- PHP Version: 7.4
- Database Driver & Version: mongodb 1.8.1
Description:
After a correct installation of the mongodb driver for php I installed using composer in a laravel project this library.
Steps to reproduce
- in php:7.4-fpm-alpine container I run
apk add --update --no-cache --virtual .docker-php-mongodb-dependancies \ heimdal-dev && \ pecl install mongodb && \ docker-php-ext-enable mongodb && \ apk del .docker-php-mongodb-dependancies && \ php -m;
- I have another container to use composer
composer: image: composer:latest container_name: composer volumes: - ./src:/var/www/html working_dir: /var/www/html depends_on: - php networks: - laravel
- composer require jenssegers/mongodb
- Installation request for mongodb/mongodb (locked at 1.7.1, required as ^1.7) -> satisfiable by mongodb/mongodb[1.7.1].
To enable extensions, verify that they are enabled in your .ini files:
- /usr/local/etc/php/php-cli.ini
- the module in the php container is correctly installed and I am able to connect to the mongo server using a php driver
- I bypassed the composer error usign --ignore-platform-reqs
- Laravel mongo db authentication works, but when i try to execute query i have the following errors
php | [22-Oct-2020 15:15:40] WARNING: [pool www] child 8 exited on signal 11 (SIGSEGV) after 35.431576 seconds from start
php | [22-Oct-2020 15:15:40] NOTICE: [pool www] child 9 started
nginx | 2020年10月22日 15:15:40 [error] 6#6: *1 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 172.29.0.1, server: localhost, request: "GET /test HTTP/1.1", upstream: "fastcgi://172.29.0.4:9000", host:Expected behaviour
I tried editing permission and some configuration file in order to execute correctly the request but nothing
Actual behaviour
I recieved a 502 Bad gateway error due to php-fpm SIGSEGV
my nginx config file
Schermata 2020年10月23日 alle 08 47 49
You can see on this configuration https://github.com/Smolevich/demo-mongo-application/blob/master/docker-compose.yml for example
Beta Was this translation helpful? Give feedback.
All reactions
-
@divine I haven't other php logs, i tried to setup a log folder, but nothing has been created.
@Smolevich I copied your php/nginx docker config and I have the same result.
My running machine is a Mac with OSx v. 10.15.7
I tried to had more resources to my docker instance but nothing.
Consider to install correctly this library in my php container i used php -m 'memory_limit=-1' composer require jenssegers/mongodb .
this belowe is my php info config file
Beta Was this translation helpful? Give feedback.
All reactions
-
$manager = new \MongoDB\Driver\Manager("mongodb://user:user123@mongo:27017/homestead");
$stats = new \MongoDB\Driver\Command(["dbstats" => 1]);
$res = $manager->executeCommand("homestead", $stats);
$stats = current($res->toArray());
print_r($stats);
this code is in my laravel route without the library i can be able to execute the commands
Beta Was this translation helpful? Give feedback.
All reactions
-
@divine @Smolevich I did some debug on the service and in the connection string $config the password was not taken, the library doesn't show to me a connection error but the 502 php fpm error. I cleared the laravel config:cache and it works unexpectedly
Beta Was this translation helpful? Give feedback.
All reactions
-
Php-fpm process web requests, you don't show code that received http request
Show steps for reproduce or you can create PR here with demonstration problem
Now looks like error of configuration
Beta Was this translation helpful? Give feedback.