Skip to content
This repository has been archived by the owner on Oct 19, 2023. It is now read-only.

Support for PHP 7.4 and 8.0 #530

Open
frost-byte opened this issue Mar 22, 2021 · 18 comments
Open

Support for PHP 7.4 and 8.0 #530

frost-byte opened this issue Mar 22, 2021 · 18 comments

Comments

@frost-byte
Copy link
Contributor

There doesn't seem to be any activity with this project. Is there any kind of timeline or roadmap for 7.4? How about 8?

@timothyasp
Copy link

Seconding this - a 7.4 branch was merged in back in December, but no word since. Is there any updates on this?

@jaakkom
Copy link

jaakkom commented Mar 25, 2021

Me too. Trying to investigate how to test/dev/contribute, but there is no any documentation how to test current version for fixing.

@jaakkom
Copy link

jaakkom commented Mar 25, 2021

There is no gcp-php74* packages available i think...

@flavazelli
Copy link

any news on this?

@frost-byte
Copy link
Contributor Author

frost-byte commented Apr 5, 2021

I've not seen any response, so I've been trying to build a package for php8.0. The build takes several hours and I'm still trying to figure out a few things. I've got it to the point that it starts building extensions, but there have been some changes since 7.3, and I'm in the process of figuring out how to specify some preprocessor/configure options, i.e. where do I add that for each extension.
For example, ampq requires a preprocesser flag of PHP_MAJOR_VERSION to be greater than 8 to redefine some other preprocessor defines. (It caused a build failure because it wasn't set)

@jaakkom
Copy link

jaakkom commented Apr 8, 2021

@frost-byte Any news, Cant wait to hear when it could be available :) What is the current problem?

@frost-byte
Copy link
Contributor Author

@frost-byte Any news, Cant wait to hear when it could be available :) What is the current problem?

@jaakkom I've made some progress, but had to take a break to do some work.
I feel like I'm making a lot of changes that don't fit how the build has been managed previously, simply because I'm trying to get it to work, so at some point once all the extensions are building, then I'll do the same steps with 7.4, and then I'll have to refactor to match how things were done previously.

Instead of using Cloud Build and a container to run the build (which takes an eternity), I set up docker in one of my droplets.
This allows me to continue a build without having to rebuild v8 and some of the other libraries that are compiled before php and the php extensions are built. (It saves the built artifacts in a directory in the host os)

So far it's building php8.0.3, the v8 libraries, and some of the php extensions. There was a lot that changed between 7.3 and 8.0 and some of the extensions need updates from their own codebases before they'll work. For example, the following extensions will not build without further configuration changes: amqp, apcu_bc, eio, hprose, imagick, lua and open census. I'm trying to just go through them and see which ones build and which ones need changes.
The build process was set up to compile debian packages on an ubuntu xenial image.

Another challenge is I don't know what the usual practice is for removing deprecated/unsupported versions of php.
For example, 7.1 and 7.2 are currently part of the build, but no longer supported outside of App Engine. Should I be removing references to those? The current testing build fails because it cannot locate the latest versions on the php.net/downloads page.
(Test Script)

@frost-byte
Copy link
Contributor Author

I've been able to make some more progress with this for php 8.0.3. I had to disable the build for a handful of extensions: hprose, lua, opencensus, stackdriver_debugger and tcpwrap.

I'm not sure if I have my configuration correct, I'm running a build right now and I'm hoping the packages are saved to the bucket I've created. Building the docker image locally is far easier for testing purposes than using cloud build, which takes an eternity to build the v8 library, but now that my local build is completing, I'm hoping I can reproduce it using cloud build.

@andreladocruz
Copy link

bump

1 similar comment
@andreladocruz
Copy link

bump

@andreladocruz
Copy link

@frost-byte, @donmccasland

Do you know how can I create my own php7.4/8 image using this code?

I tried to build using an alpine image, but it's not working.

https://hub.docker.com/r/digitalmanagerguru/appengine-php-webserver

You can see the docker settings here:

https://bitbucket.org/digitalmanagerguru/appengine-webserver/src/dev/

This image is MUCH smaller than google's one. :P

@frost-byte
Copy link
Contributor Author

This image is MUCH smaller than google's one. :P

Keep in mind that there are a lot of extensions that have to be included, even if you’re not using them others might need/want them.

I am not a maintainer of this project, I was simply offering a contribution in the hopes it might lead to newer versions for the flexible environment that would still integrate with the other services of google cloud.

So in short, if you only need a subset of libraries and extensions, then I’m sure it would be a smaller image, than if you were to build and compose one yourself.

all of the extensions had to be built, including other supporting libraries (there’s a lot going on under the hood to validate and configure the images for multiple versions)

@andreladocruz
Copy link

@frost-byte ,

Thanks for the reply. =)

I know there are lots of things going under the hood that makes the official image bigger. =)

There is no "DIY" step-by-step tutorial on how to build your own image.

This try-and-error method is not good for everybody.

I think my image is not working because I need to install the cloud SQL proxy.

Besides this, I can't ssh into the instance after deploying it and got a healthy check timeout error.

@frost-byte
Copy link
Contributor Author

There is no "DIY" step-by-step tutorial on how to build your own image.

I agree with you, this took a lot of trial and error on my part. (Not to mention familiarizing myself with a variety of things I didn't already know)

Check out the NOTES.md readme. It is in no way complete, but the biggest challenge initially was the build time using cloud build. You have to create a GC project along with several buckets in Google Cloud Storage. There are other steps you have to take, installing the gcloud and gsutil cli utilities, authorize them, etc. It's by no means straightforward.

I had to install Docker as well, but if you want to build images locally, then that's what you have to do. It can be very tedious, but building some of the larger dependencies locally and syncing them to a gcs bucket was the best way for me to progress through fixing/troubleshooting the builds.

When it's all finished, you'll end up with a set of docker images within the gcr.io registry under your GC project and each of the gcs buckets will have artifacts from the build process.

@andreladocruz
Copy link

@frost-byte ,

I already have a base image (nginx & PHP) almost working.

Now I'm testing the MySQL connection through the private network instead of UNIX sockets. (errors)

Then I'll need to solve the health check and ssh problems.

This is quite annoying. =(

Thanks again for your help and patient. =)

@andreladocruz
Copy link

@frost-byte,

Just made it to work. =)

Google Image:
886Mb
deploy time: 11m

Our Image:
152Mb
deploy time: 6m

@jaakkom
Copy link

jaakkom commented Mar 2, 2022

check this: https://dockerfile.readthedocs.io/en/latest/content/DockerImages/dockerfiles/php-nginx.html

Havent test in flex environment but works fine in our use case. Very well maintained.

@frost-byte
Copy link
Contributor Author

That's fine, but I still need to integrate with everything provided by Google, things that are included in their images.

I'd rather that Goggle just be more open about the status of this framework and provide the basics

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants