Requirement
- Heroku account
- Git installed on your machine
PHP Code Deploy
- Download Heroku application and install https://devcenter.heroku.com/articles/getting-started-with-php#set-up
- Open command prompt
- command: heroku login
- Enter email and password login account
- command git clone https://github.com/heroku/php-getting-started.git
- command: Open new project directory: cd htdoc/php-getting-started
- command: heroku create
- Move your project to codeigniter-project folder
- command: git push heroku master
MySQL Deploy
- command : heroku config | grep CLEARDB_DATABASE_URL
- save return URL from above command
-
123456789101112<?php$cleardb_url = parse_url(getenv("CLEARDB_DATABASE_URL"));$cleardb_server = $cleardb_url["host"];$cleardb_username = $cleardb_url["user"];$cleardb_password = $cleardb_url["pass"];$cleardb_db = substr($cleardb_url["path"],1);?>
You can import sql file via https://www.mysql.com/products/workbench/
More Stories
How to set EC2 Ubuntu default password
CPU & Memory usage in PHP
Install PHP mcrypt extension on Ubuntu