Skip to content

[php] Symfony and Laravel update to PHP8.4 #9507

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

Merged
merged 3 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion frameworks/PHP/laravel/benchmark_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@
"database_os": "Linux",
"display_name": "laravel-ripple",
"notes": "",
"versus": "php"
"versus": "php",
"tags": ["broken"]
}
}]
}
2 changes: 1 addition & 1 deletion frameworks/PHP/laravel/deploy/conf/cli-php.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ memory_limit = 512M
opcache.jit_buffer_size = 128M
opcache.jit = tracing

disable_functions=header,header_remove,headers_sent,http_response_code,setcookie,session_create_id,session_id,session_name,session_save_path,session_status,session_start,session_write_close,session_regenerate_id,set_time_limit
disable_functions=header,header_remove,headers_sent,headers_list,http_response_code,setcookie,session_create_id,session_id,session_name,session_save_path,session_status,session_start,session_write_close,session_regenerate_id,session_unset,session_get_cookie_params,session_set_cookie_params,set_time_limit
2 changes: 1 addition & 1 deletion frameworks/PHP/laravel/laravel-laravel-s.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM phpswoole/swoole:5.1.3-php8.3
FROM phpswoole/swoole:php8.4

RUN docker-php-ext-install pcntl opcache curl > /dev/null

Expand Down
2 changes: 1 addition & 1 deletion frameworks/PHP/laravel/laravel-swoole.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM phpswoole/swoole:5.1.3-php8.3
FROM phpswoole/swoole:php8.4

RUN docker-php-ext-install pcntl opcache curl > /dev/null

Expand Down
8 changes: 4 additions & 4 deletions frameworks/PHP/laravel/laravel-workerman.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php > /dev/null && \
apt-get update -yqq > /dev/null && apt-get upgrade -yqq > /dev/null

RUN apt-get install -yqq git unzip \
php8.3-cli php8.3-mysql php8.3-mbstring php8.3-xml php8.3-curl > /dev/null
php8.4-cli php8.4-mysql php8.4-mbstring php8.4-xml php8.4-curl > /dev/null

COPY --from=composer --link /usr/bin/composer /usr/local/bin/composer

RUN apt-get install -y php-pear php8.3-dev libevent-dev > /dev/null
RUN pecl install event-3.1.3 > /dev/null && echo "extension=event.so" > /etc/php/8.3/cli/conf.d/event.ini
RUN apt-get install -y php-pear php8.4-dev libevent-dev > /dev/null
RUN pecl install event-3.1.4 > /dev/null && echo "extension=event.so" > /etc/php/8.4/cli/conf.d/event.ini

WORKDIR /laravel
COPY --link . .
Expand All @@ -26,7 +26,7 @@ RUN mkdir -p bootstrap/cache \
RUN composer require joanhey/adapterman --update-no-dev --no-scripts --quiet
RUN php artisan optimize

COPY --link deploy/conf/cli-php.ini /etc/php/8.3/cli/php.ini
COPY --link deploy/conf/cli-php.ini /etc/php/8.4/cli/php.ini

EXPOSE 8080

Expand Down
10 changes: 5 additions & 5 deletions frameworks/PHP/laravel/laravel.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php > /dev/null && \
apt-get update -yqq > /dev/null && apt-get upgrade -yqq > /dev/null

RUN apt-get install -yqq nginx git unzip \
php8.3-cli php8.3-fpm php8.3-mysql php8.3-mbstring php8.3-xml php8.3-curl > /dev/null
php8.4-cli php8.4-fpm php8.4-mysql php8.4-mbstring php8.4-xml php8.4-curl > /dev/null

COPY --from=composer --link /usr/bin/composer /usr/local/bin/composer

COPY --link deploy/conf/* /etc/php/8.3/fpm/
COPY --link deploy/conf/* /etc/php/8.4/fpm/
WORKDIR /laravel
COPY --link . .

RUN if [ $(nproc) = 2 ]; then sed -i "s|pm.max_children = 1024|pm.max_children = 512|g" /etc/php/8.3/fpm/php-fpm.conf ; fi;
RUN if [ $(nproc) = 2 ]; then sed -i "s|pm.max_children = 1024|pm.max_children = 512|g" /etc/php/8.4/fpm/php-fpm.conf ; fi;

RUN mkdir -p bootstrap/cache \
storage/logs \
Expand All @@ -29,7 +29,7 @@ RUN php artisan optimize
EXPOSE 8080

# Uncomment next line for Laravel console error logging to be viewable in docker logs
# RUN echo "catch_workers_output = yes" >> /etc/php/8.3/fpm/php-fpm.conf
# RUN echo "catch_workers_output = yes" >> /etc/php/8.4/fpm/php-fpm.conf

CMD service php8.3-fpm start && \
CMD service php8.4-fpm start && \
nginx -c /laravel/deploy/nginx.conf
7 changes: 5 additions & 2 deletions frameworks/PHP/symfony/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"symfony/orm-pack": "^2",
"symfony/twig-bundle": "^7",
"symfony/yaml": "^7",
"joanhey/adapterman": "^0.6"
"joanhey/adapterman": "^0.7"
},
"minimum-stability": "dev",
"prefer-stable": true,
Expand Down Expand Up @@ -45,7 +45,10 @@
"symfony/polyfill-php73": "*",
"symfony/polyfill-php74": "*",
"symfony/polyfill-php80": "*",
"symfony/polyfill-php81": "*"
"symfony/polyfill-php81": "*",
"symfony/polyfill-php82": "*",
"symfony/polyfill-php83": "*",
"symfony/polyfill-php84": "*"
},
"scripts": {
"auto-scripts": {
Expand Down
2 changes: 1 addition & 1 deletion frameworks/PHP/symfony/deploy/conf/cli-php.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ memory_limit = 512M
opcache.jit_buffer_size = 128M
opcache.jit = tracing

disable_functions=header,header_remove,headers_sent,http_response_code,setcookie,session_create_id,session_id,session_name,session_save_path,session_status,session_start,session_write_close,session_regenerate_id,set_time_limit
disable_functions=header,header_remove,headers_sent,headers_list,http_response_code,setcookie,session_create_id,session_id,session_name,session_save_path,session_status,session_start,session_write_close,session_regenerate_id,session_unset,session_get_cookie_params,session_set_cookie_params,set_time_limit
16 changes: 8 additions & 8 deletions frameworks/PHP/symfony/symfony-mysql.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:22.04
FROM ubuntu:24.04

ARG DEBIAN_FRONTEND=noninteractive

Expand All @@ -7,27 +7,27 @@ RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php > /dev/null && \
apt-get update -yqq > /dev/null && apt-get upgrade -yqq > /dev/null

RUN apt-get install -yqq nginx git unzip curl \
php8.3-cli php8.3-fpm php8.3-mysql \
php8.3-mbstring php8.3-xml php8.3-curl php8.3-dev > /dev/null
php8.4-cli php8.4-fpm php8.4-mysql \
php8.4-mbstring php8.4-xml php8.4-curl php8.4-dev > /dev/null

COPY --from=composer/composer:latest-bin --link /composer /usr/local/bin/composer

COPY --link deploy/conf/* /etc/php/8.3/fpm/
COPY --link deploy/conf/* /etc/php/8.4/fpm/
WORKDIR /symfony
COPY --link . .

RUN if [ $(nproc) = 2 ]; then sed -i "s|pm.max_children = 1024|pm.max_children = 512|g" /etc/php/8.3/fpm/php-fpm.conf ; fi;
RUN if [ $(nproc) = 2 ]; then sed -i "s|pm.max_children = 1024|pm.max_children = 512|g" /etc/php/8.4/fpm/php-fpm.conf ; fi;

RUN composer install --optimize-autoloader --classmap-authoritative --no-dev --no-scripts --quiet
RUN cp deploy/mysql/.env . && composer dump-env prod && bin/console cache:clear

RUN echo "opcache.preload=/symfony/var/cache/prod/App_KernelProdContainer.preload.php" >> /etc/php/8.3/fpm/php.ini
RUN echo "opcache.preload=/symfony/var/cache/prod/App_KernelProdContainer.preload.php" >> /etc/php/8.4/fpm/php.ini

EXPOSE 8080

# Uncomment next line for Laravel console error logging to be viewable in docker logs
# RUN echo "catch_workers_output = yes" >> /etc/php/8.3/fpm/php-fpm.conf
# RUN echo "catch_workers_output = yes" >> /etc/php/8.4/fpm/php-fpm.conf

RUN mkdir -p /run/php
CMD service php8.3-fpm start && \
CMD service php8.4-fpm start && \
nginx -c /symfony/deploy/nginx.conf
16 changes: 8 additions & 8 deletions frameworks/PHP/symfony/symfony-raw.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:22.04
FROM ubuntu:24.04

ARG DEBIAN_FRONTEND=noninteractive

Expand All @@ -7,27 +7,27 @@ RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php > /dev/null && \
apt-get update -yqq > /dev/null && apt-get upgrade -yqq > /dev/null

RUN apt-get install -yqq nginx git unzip curl \
php8.3-cli php8.3-fpm php8.3-pgsql \
php8.3-mbstring php8.3-xml php8.3-curl > /dev/null
php8.4-cli php8.4-fpm php8.4-pgsql \
php8.4-mbstring php8.4-xml php8.4-curl > /dev/null

COPY --from=composer/composer:latest-bin --link /composer /usr/local/bin/composer

COPY --link deploy/conf/* /etc/php/8.3/fpm/
COPY --link deploy/conf/* /etc/php/8.4/fpm/
WORKDIR /symfony
COPY --link . .

RUN if [ $(nproc) = 2 ]; then sed -i "s|pm.max_children = 1024|pm.max_children = 512|g" /etc/php/8.3/fpm/php-fpm.conf ; fi;
RUN if [ $(nproc) = 2 ]; then sed -i "s|pm.max_children = 1024|pm.max_children = 512|g" /etc/php/8.4/fpm/php-fpm.conf ; fi;

RUN composer install --optimize-autoloader --classmap-authoritative --no-dev --no-scripts --quiet
RUN cp deploy/postgresql/.env . && composer dump-env prod && bin/console cache:clear

RUN echo "opcache.preload=/symfony/var/cache/prod/App_KernelProdContainer.preload.php" >> /etc/php/8.3/fpm/php.ini
RUN echo "opcache.preload=/symfony/var/cache/prod/App_KernelProdContainer.preload.php" >> /etc/php/8.4/fpm/php.ini

EXPOSE 8080

# Uncomment next line for Laravel console error logging to be viewable in docker logs
# RUN echo "catch_workers_output = yes" >> /etc/php/8.3/fpm/php-fpm.conf
# RUN echo "catch_workers_output = yes" >> /etc/php/8.4/fpm/php-fpm.conf

RUN mkdir -p /run/php
CMD service php8.3-fpm start && \
CMD service php8.4-fpm start && \
nginx -c /symfony/deploy/nginx.conf
2 changes: 1 addition & 1 deletion frameworks/PHP/symfony/symfony-swoole.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM phpswoole/swoole:5.1.3-php8.3
FROM phpswoole/swoole:php8.4

RUN apt-get update -yqq && \
apt-get install -yqq libpq-dev libicu-dev > /dev/null && \
Expand Down
10 changes: 5 additions & 5 deletions frameworks/PHP/symfony/symfony-workerman.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:22.04
FROM ubuntu:24.04

ARG DEBIAN_FRONTEND=noninteractive

Expand All @@ -7,20 +7,20 @@ RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php > /dev/null && \
apt-get update -yqq > /dev/null && apt-get upgrade -yqq > /dev/null

RUN apt-get install -yqq unzip \
php8.3-cli php8.3-pgsql php8.3-mbstring php8.3-xml php8.3-curl > /dev/null
php8.4-cli php8.4-pgsql php8.4-mbstring php8.4-xml php8.4-curl > /dev/null

COPY --from=composer/composer:latest-bin --link /composer /usr/local/bin/composer

RUN apt-get install -y php-pear php8.3-dev libevent-dev > /dev/null && \
pecl install event-3.1.3 > /dev/null && echo "extension=event.so" > /etc/php/8.3/cli/conf.d/event.ini
RUN apt-get install -y php-pear php8.4-dev libevent-dev > /dev/null && \
pecl install event-3.1.4 > /dev/null && echo "extension=event.so" > /etc/php/8.4/cli/conf.d/event.ini

WORKDIR /symfony
COPY --link . .

RUN composer install --optimize-autoloader --classmap-authoritative --no-dev --no-scripts --quiet
RUN cp deploy/postgresql/.env . && composer dump-env prod && bin/console cache:clear

COPY --link deploy/conf/cli-php.ini /etc/php/8.3/cli/php.ini
COPY --link deploy/conf/cli-php.ini /etc/php/8.4/cli/php.ini

EXPOSE 8080

Expand Down
16 changes: 8 additions & 8 deletions frameworks/PHP/symfony/symfony.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:22.04
FROM ubuntu:24.04

ARG DEBIAN_FRONTEND=noninteractive

Expand All @@ -7,28 +7,28 @@ RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php > /dev/null && \
apt-get update -yqq > /dev/null && apt-get upgrade -yqq > /dev/null

RUN apt-get install -yqq nginx git unzip curl \
php8.3-cli php8.3-fpm php8.3-pgsql \
php8.3-mbstring php8.3-xml php8.3-curl php8.3-dev > /dev/null
php8.4-cli php8.4-fpm php8.4-pgsql \
php8.4-mbstring php8.4-xml php8.4-curl php8.4-dev > /dev/null

COPY --from=composer/composer:latest-bin --link /composer /usr/local/bin/composer

COPY --link deploy/conf/* /etc/php/8.3/fpm/
COPY --link deploy/conf/* /etc/php/8.4/fpm/

WORKDIR /symfony
COPY --link . .

RUN if [ $(nproc) = 2 ]; then sed -i "s|pm.max_children = 1024|pm.max_children = 512|g" /etc/php/8.3/fpm/php-fpm.conf ; fi;
RUN if [ $(nproc) = 2 ]; then sed -i "s|pm.max_children = 1024|pm.max_children = 512|g" /etc/php/8.4/fpm/php-fpm.conf ; fi;

RUN composer install --optimize-autoloader --classmap-authoritative --no-dev --no-scripts --quiet
RUN cp deploy/postgresql/.env . && composer dump-env prod && bin/console cache:clear

RUN echo "opcache.preload=/symfony/var/cache/prod/App_KernelProdContainer.preload.php" >> /etc/php/8.3/fpm/php.ini
RUN echo "opcache.preload=/symfony/var/cache/prod/App_KernelProdContainer.preload.php" >> /etc/php/8.4/fpm/php.ini

EXPOSE 8080

# Uncomment next line for Laravel console error logging to be viewable in docker logs
# RUN echo "catch_workers_output = yes" >> /etc/php/8.3/fpm/php-fpm.conf
# RUN echo "catch_workers_output = yes" >> /etc/php/8.4/fpm/php-fpm.conf

RUN mkdir -p /run/php
CMD service php8.3-fpm start && \
CMD service php8.4-fpm start && \
nginx -c /symfony/deploy/nginx.conf
Loading