PHP, MySQL, and phpMyAdmin

PHP, MySQL, and phpMyAdmin OpenShift Team PHP

Deploy

This QuickStart template allows you to instantly deploy a PHP 5.4 application backed by MySQL 5.5 with phpMyAdmin.

Once deployed, you can connect to your MySQL database with MySQLi:

// procedural style
$mysqli = mysqli_connect(
    getenv('OPENSHIFT_MYSQL_DB_HOST'), 
    getenv('OPENSHIFT_MYSQL_DB_USERNAME'), 
    getenv('OPENSHIFT_MYSQL_DB_HOST'), 
    getenv('OPENSHIFT_MYSQL_DB_PASSWORD'),
    getenv('OPENSHIFT_MYSQL_DB_PORT')
);

or:

// object-oriented style
$mysqli = new mysqli(
    getenv('OPENSHIFT_MYSQL_DB_HOST'), 
    getenv('OPENSHIFT_MYSQL_DB_USERNAME'), 
    getenv('OPENSHIFT_MYSQL_DB_HOST'), 
    getenv('OPENSHIFT_MYSQL_DB_PASSWORD'),
    getenv('OPENSHIFT_MYSQL_DB_PORT')
);
Author
openshift
Documentation
https://developers.openshift.com/en/php-overview.html
Cartridges
php-5.4, mysql-5.5, phpmyadmin
Tags