Home >Backend Development >PHP Tutorial >How to deploy old php website to koyeb

How to deploy old php website to koyeb

Mary-Kate Olsen
Mary-Kate OlsenOriginal
2024-12-29 08:45:111002browse

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": "*"
 }  
}

  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 ./

  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:

  • PHP Example

The above is the detailed content of How to deploy old php website to koyeb. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn