Running newer PHP versions in Pages build environment

Does the build environment for Pages support PHP versions newer that 5.6? I’m trying to use PHP 8.0.

I’ve set the version to 8.0 via the environment variable PHP_VERSION but it fails saying “PHP version 8.0 does not exist”. I’ve try a number other PHP versions and they all fail in the same way.

Log:

21:50:25.935	Initializing build environment. This may take up to a few minutes to complete
21:52:25.557	Success: Finished initializing build environment
21:52:25.557	Cloning repository...
21:52:28.407	Success: Finished cloning repository files
21:52:29.303	Installing dependencies
21:52:29.305	Python version set to 2.7
21:52:30.135	v12.18.0 is already installed.
21:52:30.561	Now using node v12.18.0 (npm v6.14.4)
21:52:30.599	Started restoring cached build plugins
21:52:30.603	Finished restoring cached build plugins
21:52:30.718	Attempting ruby version 2.7.1, read from environment
21:52:31.648	Using ruby version 2.7.1
21:52:31.884	PHP version 8.0 does not exist
21:52:31.885	Failed: build command exited with code: 1

image

I’m quite sure Pages (and Workers) don’t support PHP. Did someone tell you it does?

1 Like

https://developers.cloudflare.com/pages/platform/build-configuration#language-support-and-tools

1 Like

Well, that’s pretty cool! I’m going to have to play with that a bit. Too bad it’s 5.6, though.

Maybe @WalshyMVP knows a way to find out which versions (of any of those languages) are available.

1 Like

Seems odd that PHP 5.6 appears to be the only supported version. 5.6 has been unsupported since December 2018. PHP: Unsupported Branches

PHP 8 is not currently supported sadly. The image really needs an update…

You could download yourself though and use it that way, I know others have taken this approach. Very much not ideal though.

Edit: just realised I didn’t mention the supported versions. You can use 5.6, 7.2 and 7.4. Hopefully this is expanded to 8 soon :slight_smile:

3 Likes

Ou wow! That’s something new

Have to try it despite it’s 5.6 :smiley:

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.