{"id":26871266,"url":"https://github.com/codeadamca/heroku-deploy-php-mysql","last_synced_at":"2026-05-01T15:32:42.047Z","repository":{"id":190542822,"uuid":"615842900","full_name":"codeadamca/heroku-deploy-php-mysql","owner":"codeadamca","description":"A basic example of deploying a PHP and MySQL website to Heroku.","archived":false,"fork":false,"pushed_at":"2025-01-26T21:39:44.000Z","size":35,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-26T22:25:49.983Z","etag":null,"topics":["deployment","heroku","mysql","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codeadamca.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-18T20:49:02.000Z","updated_at":"2025-01-26T21:39:48.000Z","dependencies_parsed_at":"2025-01-26T22:22:31.784Z","dependency_job_id":"7ef41427-3a49-4d49-a43f-0b093e5ed6a0","html_url":"https://github.com/codeadamca/heroku-deploy-php-mysql","commit_stats":null,"previous_names":["codeadamca/heroku-deploy-php-mysql"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeadamca%2Fheroku-deploy-php-mysql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeadamca%2Fheroku-deploy-php-mysql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeadamca%2Fheroku-deploy-php-mysql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeadamca%2Fheroku-deploy-php-mysql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codeadamca","download_url":"https://codeload.github.com/codeadamca/heroku-deploy-php-mysql/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246429486,"owners_count":20775809,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deployment","heroku","mysql","php"],"created_at":"2025-03-31T07:18:57.120Z","updated_at":"2026-05-01T15:32:37.010Z","avatar_url":"https://github.com/codeadamca.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Deploying a PHP and MySQL Website to Heroku\n\nA basic example of deploying a PHP and MySQL website to Heroku.\n\n## Heroku\n\nFirst we need to setup our Heroku app and database.\n\n\u003e [!Note]  \n\u003e Thes steps assume you have a [Heroku account](https://signup.heroku.com/) and the [Heroku CLI](https://devcenter.heroku.com/articles/heroku-cli) installed.\n\n1. Using the Terminan, navigate to your project. This project should already be a Git repository. Type `git status` just to confirm. \n\n2. Using the Terminal log in to your Heroku account:\n    \n    ```sh\n    heroku login\n    ```\n\n3. Create a new Heroku app:\n    \n    ```sh \n    heroku create\n    ```\n    \n\u003e [!Note]  \n\u003e You can change the name of the app in your [Heroku dashboard](https://dashboard.heroku.com/apps/).\n    \n4. Change the orign if needed:\n\n    ```sh\n    git remote add heroku https://git.heroku.com/heroku-deploy-php-mysql.git\n    ```\n\n5. You can sue the browser to create a free ClearDB MySQL database:\n\n    Or you can use the Terminal:\n    \n    ```sh\n    heroku addons:create cleardb:ignite\n    ```\n\n6. Using your terminal retrieve your connection string:\n    \n    ```sh\n    heroku config | grep CLEARDB\n    ```\n    \n    This will return a string that contains your database name, username, passowrd, and host:\n    \n    ```sh\n    mysql://\u003cDB_USER\u003e:\u003cDB_USER_PASSWORD\u003e@\u003cDB_HOST\u003e/\u003cDB\u003e?reconnect=true\n    ```\n    \n    Extract these four values and use the Terminal to set them as environment variables:\n    \n    ```sh\n    heroku config:set DB_USER=\u003cDB_USER\u003e\n    heroku config:set DB_USER_PASSWORD=\u003cDB_USER_PASSWORD\u003e\n    heroku config:set DB_HOST=\u003cDB_HOST\u003e\n    heroku config:set DB=\u003cDB\u003e\n    ```\n    \n    Then you can confirm these have been set properly:\n    \n    ```sh\n    heroku config\n    ```\n\n\u003e This repository has been deplyed at:  \n\u003e https://heroku-deploy-php-mysql.herokuapp.com/.\n\n\u003e [!Note]  \n\u003e This app is often deactived to prevent unnecessary expenses.\n\nThis PHP has been take form the [php-mysql-images-embedded](https://github.com/codeadamca/php-mysql-images-embedded) repository.\n\n***\n\n## Repo Resources\n\n* [Heroku](https://heroku.com/)\n\n\u003cbr\u003e\n\u003ca href=\"https://codeadam.ca\"\u003e\n\u003cimg src=\"https://cdn.codeadam.ca/images@1.0.0/codeadam-logo-coloured-horizontal.png\" width=\"200\"\u003e\n\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeadamca%2Fheroku-deploy-php-mysql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodeadamca%2Fheroku-deploy-php-mysql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeadamca%2Fheroku-deploy-php-mysql/lists"}