Deploying php web app to Cloudflare pages

im trying to deploy php to Cloudflare pages and this says it is supported.

but i follow the instructions and it isnt deploying. i have everything on github repository and deploy to CF Pages.

it retunes this after deployment
This ************ page can’t be found

thanks for any help in advance!

Might you want to share the log of the build?
If you trigger a build, you will see a log, just copy it here.

Also please notice that PHP is just available at build-time, not at runtime. So you can’t serve PHP files, but you can use PHP to generate a static page, and serve the static page.

The category of this thread should be #cloudflare-pages

1 Like

ive been trying different things so idk what to out at this point but this is the current log for what i just did.

2022-09-30T15:07:37.465126Z Cloning repository…
2022-09-30T15:07:38.638125Z From******************************************
2022-09-30T15:07:38.638647Z * branch ******2f3d0f0b9d36995ce7a3c6f3eeb22f694cfc → FETCH_HEAD
2022-09-30T15:07:38.684111Z HEAD is now at c56e2f3 Update Variables.php
2022-09-30T15:07:38.823579Z Success: Finished cloning repository files
2022-09-30T15:07:39.416726Z Installing dependencies
2022-09-30T15:07:39.425408Z Python version set to 2.7
2022-09-30T15:07:41.99125Z v12.18.0 is already installed.
2022-09-30T15:07:42.950938Z Now using node v12.18.0 (npm v6.14.4)
2022-09-30T15:07:43.121287Z Started restoring cached build plugins
2022-09-30T15:07:43.133393Z Finished restoring cached build plugins
2022-09-30T15:07:43.502105Z Attempting ruby version 2.7.1, read from environment
2022-09-30T15:07:46.283586Z Using ruby version 2.7.1
2022-09-30T15:07:46.58061Z Using PHP version 7.4
2022-09-30T15:07:46.702965Z 5.2 is already installed.
2022-09-30T15:07:46.723439Z Using Swift version 5.2
2022-09-30T15:07:46.7237Z Installing Hugo 0.54.0
2022-09-30T15:07:47.328404Z Hugo Static Site Generator v0.54.0-B1A82C61A/extended linux/amd64 BuildDate: 2019-02-01T10:04:38Z
2022-09-30T15:07:47.331143Z Started restoring cached go cache
2022-09-30T15:07:47.345396Z Finished restoring cached go cache
2022-09-30T15:07:47.454957Z go version go1.14.4 linux/amd64
2022-09-30T15:07:47.466592Z go version go1.14.4 linux/amd64
2022-09-30T15:07:47.469274Z Installing missing commands
2022-09-30T15:07:47.469655Z Verify run directory
2022-09-30T15:07:47.469956Z Executing user command: php
2022-09-30T15:07:47.631442Z Finished
2022-09-30T15:07:47.631931Z Note: No functions dir at /functions found. Skipping.
2022-09-30T15:07:47.632135Z Validating asset output directory
2022-09-30T15:07:48.154177Z Deploying your site to Cloudflare’s global network…
2022-09-30T15:07:52.779826Z Success: Assets published!
2022-09-30T15:07:53.390704Z Success: Your site was deployed!

I guess that is not how to use PHP, you need to run PHP with some parameters, like:

php index.php

I have the strong feeling, that you want to host a non-static website on Cloudflare Pages - to verify that, can you tell us your GitHub repo, if it is public?
And also the * domain.

1 Like

i think it is dynamic also. also it is not public repo. is there any way to deploy dynamic site on Cloudflare

Not for PHP based ones.
If you can transform all functionality into JS, it might run on workers on the edge. But for PHP no chance. Please get a server and host it there. Or dockerize it and run it somewhere in the cloud. Then PHP is possible as well, but this AFAIK is not possible with Cloudflare (yet).

1 Like

This post was flagged by the community and is temporarily hidden.