Skip to content

[php] Workerman update to PHP 8.2 #7704

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 4 commits into from
Nov 16, 2022
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
24 changes: 7 additions & 17 deletions frameworks/PHP/workerman/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,13 @@ NGINX is removed in this test, and substituted by [Workerman, An asynchronous ev

https://github.com/walkor/Workerman

This test doesn't use the standard PHP (fw_require) because it needs PCNTL / Process Control extension. Adding PCNTL in the PHP compilation (--enable-pcntl) will fail other PHP framework test.

```
Database config
HOST: DBHOST (from ENV) , or 127.0.0.1 if DBHOST is not available
User : benchmarkdbuser
Password : benchmarkdbpass
DBNAME : hello_world
```
MySQL Connection is using PHP PDO::Persistent Connection.

The number of threads count in PHP is (number of cores)*2.

## Infrastructure Software Versions
The tests were run with:
* [PHP 7](http://www.php.net/)
* [MySQL 5.5.54](https://dev.mysql.com/)
* [PHP 8](http://www.php.net/)


Pre-test:
* [Composer](https://getcomposer.org/)
Expand All @@ -32,15 +22,15 @@ Using the PHP standard [JSON encoder](http://www.php.net/manual/en/function.json
## Test URLs

### JSON Encoding Test
http://localhost:8080/json.php
http://localhost:8080/json

### Data-Store/Database Mapping Test
http://localhost:8080/dbraw.php
http://localhost:8080/db

http://localhost:8080/updateraw.php
http://localhost:8080/update

### Variable Query Test
http://localhost:8080/dbraw.php?queries=5
http://localhost:8080/query

### Fortune Test
http://localhost:8080/fortune.php
http://localhost:8080/fortunes
6 changes: 3 additions & 3 deletions frameworks/PHP/workerman/benchmark_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"database": "MySQL",
"framework": "workerman",
"language": "PHP",
"flavor": "PHP8.1",
"flavor": "PHP8",
"orm": "Raw",
"platform": "workerman",
"webserver": "None",
Expand All @@ -35,7 +35,7 @@
"database": "Postgres",
"framework": "workerman",
"language": "PHP",
"flavor": "PHP8.1",
"flavor": "PHP8",
"orm": "Raw",
"platform": "workerman",
"webserver": "None",
Expand Down Expand Up @@ -80,7 +80,7 @@
"database": "Postgres",
"framework": "workerman",
"language": "PHP",
"flavor": "PHP8.1",
"flavor": "PHP8",
"orm": "Raw",
"platform": "workerman",
"webserver": "None",
Expand Down
7 changes: 4 additions & 3 deletions frameworks/PHP/workerman/workerman-async.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ FROM ubuntu:22.04
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
RUN apt-get update -yqq > /dev/null && \
apt-get install -yqq php7.4-cli php7.4-mysql > /dev/null
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 php7.4-cli php7.4-mysql > /dev/null

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

Expand Down
13 changes: 7 additions & 6 deletions frameworks/PHP/workerman/workerman-pgsql.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@ FROM ubuntu:22.04
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
RUN apt-get update -yqq > /dev/null && \
apt-get install -yqq php8.1-cli php8.1-pgsql php8.1-xml > /dev/null
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 php8.2-cli php8.2-pgsql php8.2-xml > /dev/null

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

RUN apt-get install -y php-pear php8.1-dev libevent-dev git > /dev/null
RUN pecl install event-3.0.8 > /dev/null && echo "extension=event.so" > /etc/php/8.1/cli/conf.d/event.ini
RUN apt-get install -y php-pear php8.2-dev libevent-dev git > /dev/null
RUN pecl install event-3.0.8 > /dev/null && echo "extension=event.so" > /etc/php/8.2/cli/conf.d/event.ini

COPY php.ini /etc/php/8.1/cli/php.ini
COPY php.ini /etc/php/8.2/cli/php.ini

ADD ./ /workerman
WORKDIR /workerman
Expand Down
13 changes: 7 additions & 6 deletions frameworks/PHP/workerman/workerman-php8-jit.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@ FROM ubuntu:22.04
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
RUN apt-get update -yqq > /dev/null && \
apt-get install -yqq php8.1-cli php8.1-pgsql php8.1-xml > /dev/null
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 php8.2-cli php8.2-pgsql php8.2-xml > /dev/null

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

RUN apt-get install -y php-pear php8.1-dev libevent-dev git > /dev/null
RUN pecl install event-3.0.8 > /dev/null && echo "extension=event.so" > /etc/php/8.1/cli/conf.d/event.ini
RUN apt-get install -y php-pear php8.2-dev libevent-dev git > /dev/null
RUN pecl install event-3.0.8 > /dev/null && echo "extension=event.so" > /etc/php/8.2/cli/conf.d/event.ini

COPY php-jit.ini /etc/php/8.1/cli/php.ini
COPY php-jit.ini /etc/php/8.2/cli/php.ini

ADD ./ /workerman
WORKDIR /workerman
Expand Down
13 changes: 7 additions & 6 deletions frameworks/PHP/workerman/workerman.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@ FROM ubuntu:22.04
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
RUN apt-get update -yqq > /dev/null && \
apt-get install -yqq php8.1-cli php8.1-mysql php8.1-xml > /dev/null
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 php8.2-cli php8.2-mysql php8.2-xml > /dev/null

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

RUN apt-get install -y php-pear php8.1-dev libevent-dev git > /dev/null
RUN pecl install event-3.0.8 > /dev/null && echo "extension=event.so" > /etc/php/8.1/cli/conf.d/event.ini
RUN apt-get install -y php-pear php8.2-dev libevent-dev git > /dev/null
RUN pecl install event-3.0.8 > /dev/null && echo "extension=event.so" > /etc/php/8.2/cli/conf.d/event.ini

COPY php-jit.ini /etc/php/8.1/cli/php.ini
COPY php-jit.ini /etc/php/8.2/cli/php.ini

ADD ./ /workerman
WORKDIR /workerman
Expand Down