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

AMQP extension and PHP 8 #826

Closed
5 of 8 tasks
vpassapera opened this issue Jul 13, 2021 · 2 comments
Closed
5 of 8 tasks

AMQP extension and PHP 8 #826

vpassapera opened this issue Jul 13, 2021 · 2 comments
Labels

Comments

@vpassapera
Copy link

ISSUE TYPE

  • Bug Report

Checklist

OS / ENVIRONMENT

  1. Host operating system and version: Manjaro Linux (Rolling)
  2. (Windows only) Native Docker or Docker Toolbox:
  3. Docker version: 20.10.7
  4. Docker Compose version: 1.29.2
  5. (Linux) Is SELinux enabled?: No, Manjaro uses AppArmor.
  6. What git commit hash are you on?: f6bbdc7

SUMMARY

Enabling the AMQP extension in env file does nothing when using PHP 8. The lastest (master) version of this extension supports PHP 8, but it is not included in devilbox because it has to be built from scratch.

STEPS TO REPRODUCE

Using the following:

PHP_SERVER=8.0
PHP_MODULES_ENABLE=libxml,redis,iconv,ctype,igbinary,amqp,sqlite,pdo_sqlite

EXPECTED BEHAVIOUR

Inside of your devilbox:

$  php -m | grep -i amqp
amqp

ACTUAL BEHAVIOUR

No AMQP module enabled:

$  php -m | grep -i amqp

OTHER INFORMATION

https://gitlab.com/-/snippets/2124707 lists a way of using a custom Dockerfile to get this working. But you have to build the image yourself and reference it in the docker file.

Start command

$ docker-compose up...

Outputs

env file

DEBUG_COMPOSE_ENTRYPOINT=2
DOCKER_LOGS=0
DEVILBOX_PATH=.
LOCAL_LISTEN_ADDR=
TLD_SUFFIX=local
EXTRA_HOSTS=
NEW_UID=1000
NEW_GID=1000
TIMEZONE=UTC
DNS_CHECK_TIMEOUT=1
DEVILBOX_UI_SSL_CN=localhost,*.localhost,devilbox,*.devilbox,httpd
DEVILBOX_UI_PROTECT=0
DEVILBOX_UI_PASSWORD=password
DEVILBOX_UI_ENABLE=1
DEVILBOX_VENDOR_PHPMYADMIN_AUTOLOGIN=1
DEVILBOX_VENDOR_PHPPGADMIN_AUTOLOGIN=1
PHP_SERVER=8.0
HTTPD_SERVER=nginx-stable
MYSQL_SERVER=mariadb-10.5
PGSQL_SERVER=latest
REDIS_SERVER=6.0
MEMCD_SERVER=latest
MONGO_SERVER=latest
MOUNT_OPTIONS=
HOST_PATH_HTTPD_DATADIR=./data/www
HOST_PATH_BACKUPDIR=./backups
HOST_PATH_SSH_DIR=~/.ssh
PHP_MODULES_ENABLE=libxml,redis,iconv,ctype,igbinary,amqp,sqlite,pdo_sqlite
PHP_MODULES_DISABLE=oci8,PDO_OCI,pdo_sqlsrv,sqlsrv,rdkafka,swoole
PHP_MAIL_CATCH_ALL=2
HOST_PORT_HTTPD=80
HOST_PORT_HTTPD_SSL=443
HTTPD_VHOST_SSL_TYPE=both
HTTPD_DOCROOT_DIR=htdocs
HTTPD_TEMPLATE_DIR=.devilbox
HTTPD_TIMEOUT_TO_PHP_FPM=180
HTTPD_NGINX_WORKER_PROCESSES=auto
HTTPD_NGINX_WORKER_CONNECTIONS=1024
MYSQL_ROOT_PASSWORD=
HOST_PORT_MYSQL=3306
PGSQL_ROOT_USER=postgres
PGSQL_ROOT_PASSWORD=postgres
PGSQL_HOST_AUTH_METHOD=
HOST_PORT_PGSQL=5432
HOST_PORT_REDIS=6379
REDIS_ARGS=
#REDIS_ARGS=--loglevel verbose --requirepass my-redis-root-password
HOST_PORT_MEMCD=11211
HOST_PORT_MONGO=27017
HOST_PORT_BIND=1053
BIND_DNS_RESOLVER=8.8.8.8,8.8.4.4
BIND_DNSSEC_VALIDATE=no
BIND_TTL_TIME=
BIND_REFRESH_TIME=
BIND_RETRY_TIME=
BIND_EXPIRY_TIME=
BIND_MAX_CACHE_TIME=
BIND_LOG_DNS_QUERIES=0
PHP_IDE_CONFIG="serverName=tcgtop8-api.local"
RABBIT_SERVER=management
RABBIT_DEFAULT_USER=tcgtop8
RABBIT_DEFAULT_PASS=tcgtop8

This is after I started using my custom image:

$ ./check-config.sh

# ==============================================================================
# Checking .env file
# ==============================================================================
[SUCC]  .env file exists
[SUCC]  .env file is readable
[SUCC]  All variables are present in .env file
[SUCC]  No variables is duplicated in .env file

# ==============================================================================
# Checking .env file values
# ==============================================================================
[SUCC]  All .env file variables have correct values

# ==============================================================================
# Checking required Devilbox core directories exist
# ==============================================================================
[SUCC]  All PHP cfg/ sub directories are present
[SUCC]  All PHP log/ sub directories are present
[SUCC]  All PHP mod/ sub directories are present
[SUCC]  All HTTPD cfg/ sub directories are present
[SUCC]  All HTTPD log/ sub directories are present

# ==============================================================================                                                                                              
# Checking devilbox core directory permissions
# ==============================================================================
[SUCC]  All devilbox directories have correct permissions
[ERR]   Directory 'log/php-fpm-7.4' should have uid '1000' Has: '501'
[ERR]   Directory 'log/php-fpm-7.4' should have gid '1000' Has: '20'

# ==============================================================================
# Checking devilbox core file permissions
# ==============================================================================
[SUCC]  All devilbox files have correct permissions
[SUCC]  All devilbox files have correct uid 
[SUCC]  All devilbox files have correct gid 

# ==============================================================================
# Checking projects permissions
# ==============================================================================
[SUCC]  All project dirs have correct permissions
[SUCC]  All project dirs have correct uid
[SUCC]  All project dirs have correct gid

# ==============================================================================
# Checking projects settings
# ==============================================================================
[SUCC]  All projects have valid DNS records 
[SUCC]  All projects have valid HTTPD_DOCROOT_DIR

# ==============================================================================
# Checking customizations
# ==============================================================================
[NOTE]  [php.ini]    Custom config present in cfg/php-ini-8.0/

# ==============================================================================
# SUMMARY
# ==============================================================================
[ERR]   Found 3 error(s)
[ERR]   Devilbox might not work properly
[ERR]   Fix the issues before submitting a bug report
[NOTE]  1 custom configurations applied. If you encounter issues, reset them first.
@vpassapera vpassapera added the bug label Jul 13, 2021
@llaville
Copy link
Contributor

@vpassapera I suggest you to read the last lines of your (summary) report before submitting a new issue, even if it's not the origin of problem

Now to help all of Devilbox users that want to use amp extension with PHP 8

I found an interresting article that may help, even if now it's not really necessary since PECL restored in official PHP 8 Docker images

Alternatives are :

Read also NOTE: https://github.com/mlocati/docker-php-extension-installer/blob/master/MAINTAINERS.md#extensions-to-be-monitored

In real situation, if you're easy to rebuild docker-php-fpm images, you can apply these changes or wait for @cytopia that should do it later !

build/ansible/group_vars/all/mods.yml

 # -------------------------------------------------------------------------------------------------
 # Extension definition
@@ -145,7 +45,6 @@ extensions_enabled:
 #   command:     [required] Custom command to install and enable a module
 extensions_available:
   amqp:
-    disabled: [8.0, 8.1]
     5.2:
       run_dep: [librabbitmq1]
       type: pecl
@@ -164,7 +63,7 @@ extensions_available:
       run_dep: [librabbitmq1]
     all:
       type: pecl
-      command: echo "/usr" | pecl install amqp
+      command: pecl install amqp-beta
       build_dep: [librabbitmq-dev]
       run_dep: [librabbitmq4]
   apcu:

@cytopia I suggest also to add pickle as a new software in PHP containers, to simplify PHP extensions installation for all users
Changes to apply is :
build/ansible/group_vars/all/work.yml

@@ -87,28 +68,8 @@ software_enabled:
   - pip
   - nvm
   # Normal packages start here
-  # - linuxbrew
+  - pickle
   # Cleanup needs to be last
   - cleanup

@@ -826,6 +787,10 @@ software_available:
       command: |
         curl -sS -L --fail https://phar.phpunit.de/phpunit-7.phar > /usr/local/bin/phpunit 2>/dev/null \
         && chmod +x /usr/local/bin/phpunit \
+  pickle:
+    all:
+      command: curl -sSLf https://github.com/FriendsOfPHP/pickle/releases/latest/download/pickle.phar -o /usr/local/bin/pickle
+      post:  chmod +x /usr/local/bin/pickle
   symfony:

When entering new version of PHP container, you should have *amqp up and running

devilbox@php-8.0.8 in /shared/httpd $ php --re amqp | grep version
Extension [ <persistent> extension #33 amqp version 1.11.0beta ] {

This was referenced Jan 26, 2022
@cytopia
Copy link
Owner

cytopia commented Jan 28, 2022

@cytopia cytopia closed this as completed Jan 28, 2022
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

3 participants