The easiest way to install this application is to use the OpenShift Instant Application. If you'd like to install it manually, follow these directions.
These are some special considerations you may need to keep in mind when running your application on OpenShift.
By default, your application is configured to use a MySQL database on OpenShift.
By default, CodeIgniter on OpenShift comes with the ENVIRONMENT
constant set to
'production'. At the top of php/index.php, you will see:
define('ENVIRONMENT', 'production');
In production mode, your application will:
- Disable all error output (for security reasons)
When you develop your CodeIgniter application locally, you can change the
environment by setting the ENVIRONMENT
variable in php/index.php to
'development':
define('ENVIRONMENT', 'development');
If you do so, CodeIgniter will run your application under 'development' mode. In development mode, your application will:
- Show more detailed errors in browser
- Load development-specific configuration files
We strong advise you to not run your application in this mode in production.
Visit the CodeIgniter User Guide for more details on using multiple CodeIgniter development environments.
File | Config Setting | Value |
---|---|---|
php/index.php | ENVIRONMENT | production |
php/application/config/config.php |
log_path cache_path encryption_key proxy_ips |
$_ENV['OPENSHIFT_LOG_DIR'] $_ENV['OPENSHIFT_TMP_DIR'] $_ENV['OPENSHIFT_SECRET_TOKEN'] $_ENV['OPENSHIFT_HAPROXY_IP'] |
php/application/config/database.php |
hostname port username password database |
$_ENV['OPENSHIFT_MYSQL_DB_HOST'] $_ENV['OPENSHIFT_MYSQL_DB_PORT'] $_ENV['OPENSHIFT_MYSQL_DB_USERNAME'] $_ENV['OPENSHIFT_MYSQL_DB_PASSWORD'] $_ENV['OPENSHIFT_APP_NAME'] |
-
Create an account at https://www.openshift.com/
-
Create a PHP/MySQL application
rhc app create codeigniterapp php-5.4 mysql-5.5 --from-code=https://github.com/openshift/CodeIgniterQuickStart.git
Note: This QuickStart was configured for MySQL
-
That's it! Enjoy your new CodeIgniter application!