astro-php-ssr
Version:
Run .php routes inside Astro SSR via php-cgi (or php fallback).
37 lines (24 loc) • 963 B
Markdown
[](https://www.npmjs.com/package/astro-php-ssr)
# astro-php-ssr
Serve PHP under a mount path and allow the PHP dir in Astro
# How astro-php-ssr works
Run `.php` routes **inside Astro SSR** via `php-cgi` (preferred) or `php` fallback.
- ✅ Works with `astro dev`/SSR
- ✅ GET/POST supported (basic CGI env)
- ✅ Configurable `phpBinary` and `phpDir`
- ⚠️ Requires `php-cgi` _or_ `php` on the host
## Install
```bash
npm i astro-php-ssr
# or: yarn add astro-php-ssr
# or: pnpm add astro-php-ssr
```
## Demo - Try/Test it Live
Click the badge below to see a working demo:
[](https://replit.com/@developer92/AstroPHPNode)
Or fork it to experiment:
[Fork Demo on Replit](https://replit.com/@developer92/AstroPHPNode?v=1)
The demo shows:
- Basic PHP route integration
- GET/POST request handling
- PHP file serving