We had another scenario, where the mentioned combination was needed to be installed. It was a bit cumbersome, but the final solution turned out to be:
### METHOD 1: using Docker ###
If you want to use ubuntu (instead of debian), the I reckon Ubuntu (phusion image) as the champion image for docker and so, to build your PHP8 on top of that, you can Download official php8-docker folder and modify Dockerfile with the changes shown in this DIFF and build it. (or you can also use ready-made LAMP image)
To install wordpress on top of the above image, download https://github.com/docker-library/wordpress and modify Dockerfile with changes as shown in this DIFF and build it. (if you want to connect to outside MYSQL server, you might need this tip)
### METHOD 2 : using PhpBrew ###
After following “requirements” part of phpbrew, then install PHP with phpbrew. at first check if
echo $PKG_CONFIG_PATH variable returns result, if not, set it:
sudo apt-get install apache2-dev sudo apt-get install libonig-dev
phpbrew --debug install 8.0 +default +mysql +sqlite +mb +debug +fpm +zip +intl +openssl=/usr/local/opt/openssl +bz2=/usr/local/opt/bzip2 +zlib=/usr/local/opt/zlib +apxs2=/usr/bin/apxs2
+zts-- --enable-zts #for php7 (instead of
+zts) in the end needs -- --enable-maintainer-zts, for older php8/phpbrew too, but word "-maintainer" is not needed phpbrew --debug ext install swoole phpbrew --debug ext install parallel #or follow instructions from github readme. If the command doesn't success, use: phpbrew ext install parallel -- --enable-parallel-coverage --enable-parallel-dev #p.s. you might need also these extensions in addition to above ones (for wordpress): +xmlrpc +gd +soap
and this will help to tell apache to use phpbrew.
* Other components: some people might want to compile php with different components, like
--with-gmp or etc. However, in such case, the needed module bases should be installed before php-module, so, in dockerfile you might need to put
RUN apt-get update && apt-get install -y libgmp-dev before the php-build line.