MyBB Community Forums
How to build PHP 8.0.0-dev on RHEL 8 - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Resources (https://community.mybb.com/forum-8.html)
+--- Forum: Tutorials (https://community.mybb.com/forum-38.html)
+--- Thread: How to build PHP 8.0.0-dev on RHEL 8 (/thread-224523.html)



How to build PHP 8.0.0-dev on RHEL 8 - KimChoJapFan - 09-05-2019

If you don't have access to a RHEL license, then you can get RHEL 8 through Fedora 28 or newer. There's no stable build of CentOS 8 right now, but that might change in the near future.

Okay let's get started with the necessary packages needed to build a MyBB-friendly copy of PHP 8:
sudo yum -y install \
	bison			\
	re2c			\
	systemd-devel	\
	libacl-devel	\
	libxml2-devel	\
	openssl-devel	\
	sqlite-devel	\
	bzip2-devel		\
	libcurl-devel	\
	libpng-devel	\
	libicu-devel	\
	oniguruma-devel	\
	libpq-devel		\
	libsodium-devel	\
	libargon2-devel	\
	libtidy-devel	\
	git

Now that we have our required libraries and the git program, we can clone ourselves a copy of the PHP sources:
git clone https://github.com/php/php-src.git

From there we want to enter the php source folder and create a new shell script named "phpconf.sh" with the following contents:
#!/bin/bash
./configure						\
	--enable-fpm				\
	--with-fpm-systemd			\
	--with-fpm-acl				\
	--enable-fd-setsize=2048	\
	--with-openssl				\
	--with-zlib					\
	--enable-bcmath				\
	--with-bz2					\
	--with-curl					\
	--enable-exif				\
	--enable-gd					\
	--enable-intl				\
	--enable-mbstring			\
	--with-mysqli				\
	--with-pdo-mysql			\
	--with-pdo-pgsql			\
	--enable-soap				\
	--with-sodium				\
	--with-password-argon2		\
	--with-tidy					\
	--with-xmlrpc				\
	--enable-zts				\
	--enable-shared

Now we need to run the following commands:
sudo chmod +x phpconf.sh
./buildconf
./phpconf.sh

If everything went well, you should be greeted with a "thank you" screen from the Zend team. Now you can start the build process.
sudo make
sudo make install

And voila, you should be running a thread-safe x86_64 variant of PHP 8.0.0-dev:
[Image: i6sbEXQ.png]

To verify that the modules you enabled in the build configuration are functioning:
php -r "echo '<pre>'; print_r(get_loaded_extensions()); echo '</pre>';"

This should be the expected output:
[Image: 5zioI1o.png]


RE: How to build PHP 8.0.0-dev on RHEL 8 - vbgamer45 - 09-09-2019

These would make good blog posts. It would be interesting to test with MyBB to see if anything wil break.


RE: How to build PHP 8.0.0-dev on RHEL 8 - KimChoJapFan - 09-09-2019

(09-09-2019, 07:35 PM)vbgamer45 Wrote: These would make good blog posts.  It would be interesting to test with MyBB to see if anything wil break.

Yep, and after this thread I made three gists that covers the process of building Nginx, PHP, and MariaDB.

I'll reread over this thread to see if I missed any important details, the gists will also contain the shell script I use to configure the software. I even added a couple of files and lines to modify in order to have Nginx return a custom server header (that ought to deal with the scrapers and those using Netsparker and Acunetix scanners).


RE: How to build PHP 8.0.0-dev on RHEL 8 - damiendidi - 09-12-2019

Hi, thanks for this tutorial I find it really interesting

UC Browser SHAREit MX Player


RE: How to build PHP 8.0.0-dev on RHEL 8 - KimChoJapFan - 09-12-2019

If you are going to test out a fresh installation of MyBB with the 8.0.0-dev version of PHP, then you might want to read up on this thread to know what to look out for: https://community.mybb.com/thread-224522.html