You can have PHP logic directly in SvelteKit route directory like this: +page.server.php
<?php
function load($event) {
$name = ($event->params['name'] ?? 'unknownn');
return [
'message' => "Hello " . $name,
];
}
See https://github.com/basuke/vite-plugin-sveltekit-php-backend
MIT