https://github.com/arvl130/php-on-vercel
Repository for testing if PHP websites with traditional file-based routing can be hosted on Vercel ▴
https://github.com/arvl130/php-on-vercel
php runtime serverless vercel
Last synced: 7 months ago
JSON representation
Repository for testing if PHP websites with traditional file-based routing can be hosted on Vercel ▴
- Host: GitHub
- URL: https://github.com/arvl130/php-on-vercel
- Owner: arvl130
- Created: 2023-04-21T17:20:20.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2023-05-20T12:15:53.000Z (almost 3 years ago)
- Last Synced: 2025-02-13T12:54:06.755Z (about 1 year ago)
- Topics: php, runtime, serverless, vercel
- Language: PHP
- Homepage: https://php-on-vercel.ageulin.com
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PHP on Vercel ▴
This is a repository I've created to test if we can get traditional PHP file-based
routing working on the [community Vercel Functions PHP runtime](https://github.com/vercel-community/php).
See instructions below on how.
# Instructions
1. Create a directory `api` and place all your PHP files in there.
2. Create a file called `vercel.json` at the root of your project folder with the following content:
```json
{
"functions": {
"api/*.php": {
"runtime": "vercel-php@0.6.0"
}
},
"routes": [{ "src": "/(.*)", "dest": "/api/$1" }]
}
```
Note the example given here uses version 0.6.0 of the runtime which corresponds to PHP 8.2.x,
but other versions may also be used.
3. Push to GitHub and create your project on Vercel.