Skip to content

Commit

Permalink
[php-ngx] Update to PHP8 (#6282)
Browse files Browse the repository at this point in the history
  • Loading branch information
joanhey authored Jan 8, 2021
1 parent 39c47f7 commit eafe67f
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 32 deletions.
4 changes: 2 additions & 2 deletions frameworks/PHP/php-ngx/app-async.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function query()
$my = new php\ngx\mysql();
yield from $my->connect(DB_HOST, DB_PORT, DB_USER, DB_PASS, DB_NAME);
$query_count = 1;
$params = ngx::query_args()['q'];
$params = (int) ngx::query_args()['q'];
if ($params > 1) {
$query_count = min($params, 500);
}
Expand Down Expand Up @@ -68,7 +68,7 @@ function update()
$my = new php\ngx\mysql();
yield from $my->connect(DB_HOST, DB_PORT, DB_USER, DB_PASS, DB_NAME);
$query_count = 1;
$params = ngx::query_args()['q'];
$params = (int) ngx::query_args()['q'];
if ($params > 1) {
$query_count = min($params, 500);
}
Expand Down
4 changes: 2 additions & 2 deletions frameworks/PHP/php-ngx/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function query()
ngx_header_set('Content-Type', 'application/json');

$query_count = 1;
$params = ngx::query_args()['q'];
$params = (int) ngx::query_args()['q'];
if ($params > 1) {
$query_count = min($params, 500);
}
Expand All @@ -42,7 +42,7 @@ function update()
ngx_header_set('Content-Type', 'application/json');

$query_count = 1;
$params = ngx::query_args()['q'];
$params = (int) ngx::query_args()['q'];
if ($params > 1) {
$query_count = min($params, 500);
}
Expand Down
14 changes: 7 additions & 7 deletions frameworks/PHP/php-ngx/php-ngx-async.dockerfile
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
FROM ubuntu:20.04
FROM ubuntu:20.10

ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update -yqq && apt-get install -yqq software-properties-common > /dev/null
RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php > /dev/null
RUN apt-get update -yqq > /dev/null && \
apt-get install -yqq wget git unzip libxml2-dev cmake make systemtap-sdt-dev \
zlibc zlib1g zlib1g-dev libpcre3 libpcre3-dev libargon2-0-dev libsodium-dev \
php7.4 php7.4-common php7.4-dev libphp7.4-embed php7.4-mysql nginx > /dev/null
zlib1g-dev libpcre3-dev libargon2-0-dev libsodium-dev \
php8.0-cli php8.0-dev libphp8.0-embed php8.0-mysql nginx > /dev/null

ADD ./ ./

ENV NGINX_VERSION=1.19.2
ENV NGINX_VERSION=1.19.6

RUN git clone -b v0.0.24 --single-branch --depth 1 https://github.com/rryqszq4/ngx_php7.git > /dev/null
RUN git clone -b v0.0.25 --single-branch --depth 1 https://github.com/rryqszq4/ngx_php7.git > /dev/null

RUN wget -q http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz && \
tar -zxf nginx-${NGINX_VERSION}.tar.gz && \
cd nginx-${NGINX_VERSION} && \
export PHP_LIB=/usr/lib && \
./configure --user=www --group=www \
export PHP_LIB=/usr/lib && \
bash ./configure --user=www --group=www \
--prefix=/nginx \
--with-ld-opt="-Wl,-rpath,$PHP_LIB" \
--add-module=/ngx_php7/third_party/ngx_devel_kit \
Expand Down
14 changes: 7 additions & 7 deletions frameworks/PHP/php-ngx/php-ngx-mysql.dockerfile
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
FROM ubuntu:20.04
FROM ubuntu:20.10

ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update -yqq && apt-get install -yqq software-properties-common > /dev/null
RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php > /dev/null
RUN apt-get update -yqq > /dev/null && \
apt-get install -yqq wget git unzip libxml2-dev cmake make systemtap-sdt-dev \
zlibc zlib1g zlib1g-dev libpcre3 libpcre3-dev libargon2-0-dev libsodium-dev \
php7.4 php7.4-common php7.4-dev libphp7.4-embed php7.4-mysql nginx > /dev/null
zlib1g-dev libpcre3-dev libargon2-0-dev libsodium-dev \
php8.0-cli php8.0-dev libphp8.0-embed php8.0-mysql nginx > /dev/null

ADD ./ ./

ENV NGINX_VERSION=1.19.2
ENV NGINX_VERSION=1.19.6

RUN git clone -b v0.0.24 --single-branch --depth 1 https://github.com/rryqszq4/ngx_php7.git > /dev/null
RUN git clone -b v0.0.25 --single-branch --depth 1 https://github.com/rryqszq4/ngx_php7.git > /dev/null

RUN wget -q http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz && \
tar -zxf nginx-${NGINX_VERSION}.tar.gz && \
cd nginx-${NGINX_VERSION} && \
export PHP_LIB=/usr/lib && \
./configure --user=www --group=www \
export PHP_LIB=/usr/lib && \
bash ./configure --user=www --group=www \
--prefix=/nginx \
--with-ld-opt="-Wl,-rpath,$PHP_LIB" \
--add-module=/ngx_php7/third_party/ngx_devel_kit \
Expand Down
14 changes: 7 additions & 7 deletions frameworks/PHP/php-ngx/php-ngx-pgsql.dockerfile
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
FROM ubuntu:20.04
FROM ubuntu:20.10

ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update -yqq && apt-get install -yqq software-properties-common > /dev/null
RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php > /dev/null
RUN apt-get update -yqq > /dev/null && \
apt-get install -yqq wget git unzip libxml2-dev cmake make systemtap-sdt-dev \
zlibc zlib1g zlib1g-dev libpcre3 libpcre3-dev libargon2-0-dev libsodium-dev \
php7.4 php7.4-common php7.4-dev libphp7.4-embed php7.4-pgsql nginx > /dev/null
zlib1g-dev libpcre3-dev libargon2-0-dev libsodium-dev \
php8.0-cli php8.0-dev libphp8.0-embed php8.0-pgsql nginx > /dev/null

ADD ./ ./

ENV NGINX_VERSION=1.19.2
ENV NGINX_VERSION=1.19.6

RUN git clone -b v0.0.24 --single-branch --depth 1 https://github.com/rryqszq4/ngx_php7.git > /dev/null
RUN git clone -b v0.0.25 --single-branch --depth 1 https://github.com/rryqszq4/ngx_php7.git > /dev/null

RUN wget -q http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz && \
tar -zxf nginx-${NGINX_VERSION}.tar.gz && \
cd nginx-${NGINX_VERSION} && \
export PHP_LIB=/usr/lib && \
./configure --user=www --group=www \
export PHP_LIB=/usr/lib && \
bash ./configure --user=www --group=www \
--prefix=/nginx \
--with-ld-opt="-Wl,-rpath,$PHP_LIB" \
--add-module=/ngx_php7/third_party/ngx_devel_kit \
Expand Down
13 changes: 6 additions & 7 deletions frameworks/PHP/php-ngx/php-ngx.dockerfile
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
FROM ubuntu:20.04
FROM ubuntu:20.10

ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update -yqq && apt-get install -yqq software-properties-common > /dev/null
RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php > /dev/null
RUN apt-get update -yqq > /dev/null && \
apt-get install -yqq wget git unzip libxml2-dev cmake make systemtap-sdt-dev \
zlibc zlib1g zlib1g-dev libpcre3 libpcre3-dev libargon2-0-dev libsodium-dev \
php7.4 php7.4-common php7.4-dev libphp7.4-embed php7.4-mysql nginx > /dev/null

zlib1g-dev libpcre3-dev libargon2-0-dev libsodium-dev \
php8.0-cli php8.0-dev libphp8.0-embed php8.0-mysql nginx > /dev/null
ADD ./ ./

ENV NGINX_VERSION=1.19.2
ENV NGINX_VERSION=1.19.6

RUN git clone -b v0.0.24 --single-branch --depth 1 https://github.com/rryqszq4/ngx_php7.git > /dev/null
RUN git clone -b v0.0.25 --single-branch --depth 1 https://github.com/rryqszq4/ngx_php7.git > /dev/null

RUN wget -q http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz && \
tar -zxf nginx-${NGINX_VERSION}.tar.gz && \
cd nginx-${NGINX_VERSION} && \
export PHP_LIB=/usr/lib && \
./configure --user=www --group=www \
bash ./configure --user=www --group=www \
--prefix=/nginx \
--with-ld-opt="-Wl,-rpath,$PHP_LIB" \
--add-module=/ngx_php7/third_party/ngx_devel_kit \
Expand Down

0 comments on commit eafe67f

Please sign in to comment.