anjanesh I've not used frankenphp myself, nor have I dealt with any customers who are using it, so I don't have a personal perspective to offer.
If you'd like to try it yourself (maybe be the first on Opalstack!) then the following steps should work:
- Create a new Nginx Proxy Port app at https://my.opalstack.com/apps/ and make a note of the app's name and port assignment.
- Create a new site to serve your new app and make a note of the site domain.
- SSH to your app's shell user and run the following commands to install Frankenphp:
mkdir -p ~/bin
wget -O ~/bin/frankenphp https://github.com/php/frankenphp/releases/download/v1.10.1/frankenphp-linux-x86_64
chmod u+x ~/bin/frankenphp
- Create a file
~/apps/NAME_OF_APP/Caddyfile with the following contents, replacing YOUR_SHELL_USER with your shell user name, YOUR_APP_NAME with the name of your app, DOMAIN with your site domain, and NNNNN with your port assignment:
{
admin unix//home/YOUR_SHELL_USER/apps/YOUR_APP_NAME/caddy-admin.sock
auto_https off
http_port NNNNN
https_port NNNNN
}
DOMAIN:NNNNN {
php_server {
root /home/YOUR_SHELL_USER/apps/YOUR_APP_NAME/www/
}
- Run the following command to create a www subdirectory in the app directory:
mkdir ~/apps/YOUR_APP_NAME/www/
- Put your PHP files in
~/apps/YOUR_APP_NAME/www/ then start the app with the following command:
frankenphp start -c ~/apps/YOUR_APP_NAME/Caddyfile
At that point your new frankenphp app will be up and running on the site you created in step 2 above. To stop the app, run:
frankenphp stop -c ~/apps/YOUR_APP_NAME/Caddyfile
Note that this setup disables all of the auto-magical HTTPS stuff done by Caddy (the frankenphp web server). This is necessary because your shell user doesn't have permission to bind directly to port 443. It shouldn't matter in practice because our front-end stack will handle SSL the same way it does for your other apps.
If you want to run your own benchmarks on an existing PHP site, then:
- Make a note of the PHP app served by the existing site.
- Create a new app and site for Frankenphp as described above.
- Change the
root directive in the Caddyfile to point to the existing PHP app, eg: root /home/YOUR_SHELL_USER/apps/some_other_app
- Start frankenphp as described above.
You'll then be able to compare performance between the original site and the frankenphp site and use your own judgement to determine which works better for you.