=======
This project is based on laobubu's php installation script: https://github.com/laobubu/openshift-php5.5-cgi-apache
The new Dreamfactory2.0 is just out of beta (as in yesterday to when this file was written). The new 2.0 added OAuth services which are very useful. I had been trying to install 2.0 beta to OpenShift. However, it requires PHP 5.5, which is not in the list of OpenShift pre-made Cartridges. So, I decided to DIY. The process isn't smooth at all, took me a week or two to find solutions to all issues. Many errors had occured and dependency missing during the process. Hope you find this DIY cartridge useful.
OpenShift account, goto http://openshift.redhat.com
SSH to your app, the SSH command can be found at your ( OpenShift Web Console ) >
Setup Dreamfactory by running the following commands, during which it will ask for github token and admin credentials, just follow the promoted instructions:
export PATH=${OPENSHIFT_HOMEDIR}/app-root/runtime/bin:$PATH
alias php='~/app-root/runtime/bin/php'
cd ${OPENSHIFT_HOMEDIR}/app-root/runtime/repo/dreamfactory
php $OPENSHIFT_DATA_DIR/bin/composer install --no-dev
php artisan dreamfactory:setup
Restart the Openshift Application [at OpenShift Online Portal]
10, Your Dreamfactory2.0 is up and running, goto your app's url to use it.
A1. Sometimes the SQL DB parameters are not set in the /dreamfactory/.env configuration file, despite the installation script has the instructions. In this case, you will need to run the following commands manually through SSH:
cd ${OPENSHIFT_HOMEDIR}/app-root/runtime/repo/dreamfactory
chmod -R 2777 .env-dist
sed -i '/DB_DRIVER=/ c\DB_DRIVER=mysql' .env-dist
sed -i '/DB_HOST=/ c\DB_HOST='$OPENSHIFT_MYSQL_DB_HOST'' .env-dist
sed -i '/DB_PORT=/ c\DB_PORT='$OPENSHIFT_MYSQL_DB_PORT'' .env-dist
sed -i '/DB_USERNAME=/ c\DB_USERNAME='$OPENSHIFT_MYSQL_DB_USERNAME'' .env-dist
sed -i '/DB_PASSWORD=/ c\DB_PASSWORD='$OPENSHIFT_MYSQL_DB_PASSWORD'' .env-dist
sed -i '/DB_DATABASE=/ c\DB_DATABASE='$OPENSHIFT_APP_NAME'' .env-dist
cp .env-dist .env
chmod -R 0600 .env-dist
chmod -R 0600 .env
A2. Currently Dreamfactory looks for the php driver: mongo.so. It is a depeciated driver, the newer version is mongodb.so. The installation script included both drivers. Simplily modify the conf/php.ini to switch between the two at wish.