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
- I copied all code and files to my github repo
- created
composer.json
file with below text
{
"require": {
"php": "^8.1",
"ext-pdo": "*",
"ext-pdo_sqlite": "*"
}
}
- Installed composer as described here and ran
composer update
which will generate vendor folder and composer.lock - Create
Procfile
file
web: heroku-php-apache2 ./
- push all to git
- 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:
Top comments (0)