DEV Community

Cover image for How to deploy old php website to koyeb
özkan pakdil
özkan pakdil

Posted on • Originally published at ozkanpakdil.github.io on

How to deploy old php website to koyeb

I have this side project with me since 2007, it is an one file php website with sqlite db and some pictures and js and css. I am keeping it just to monitor sometime how are the things at php side.

Anyway when I first build up this site I was using shared hosting, and in time I moved to dedicated server and today I decided to move to koyeb.com which is a nice cloud provider.

How to move old php code to cloud, I followed these steps

  1. I copied all code and files to my github repo
  2. created composer.json file with below text
{
  "require": {
     "php": "^8.1",
     "ext-pdo": "*",
     "ext-pdo_sqlite": "*"
 }  
}

Enter fullscreen mode Exit fullscreen mode
  1. Installed composer as described here and ran composer update which will generate vendor folder and composer.lock
  2. Create Procfile file
web: heroku-php-apache2 ./

Enter fullscreen mode Exit fullscreen mode
  1. push all to git
  2. Go to koyeb console and deploy it to mini instance from github

I did not try to use Dockerfile but it can be configured with that too according to this page.

Reference:

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay