如何在OpenShift上更新磁带?

如何在OpenShift上更新磁带?

问题描述:

Hey guys its a very general question, but I need your help. I already have an application at [Edited - Removed my site's link] which uses php 5.3 & now OpenShift has a new catridge called php 5.4..so how can I update the catridge without deleting my app?

嘿伙计们这是一个非常普遍的问题,但我需要你的帮助。 我已经在[编辑 - 申请了 删除了我的网站链接],使用的是php 5.3 & 现在OpenShift有一个名为php 5.4的新catridge。那怎么能在不删除我的app的情况下更新catridge呢? p> div>

You would need to create a new application with the 5.4 cartridge and migrate your application to the new gears. You currently can not remove and add a new version of a web cartridge. (you can try doing the migration with the rhc snapshot command)

Hack for fast switching from PHP 5.3 to 5.4 and back.
This is not completely updates the cartridge and may works incorrect.

# Create backup configuration
mv ~/php/configuration ~/php/configuration-orig
cp -r ~/php/configuration-orig ~/php/configuration


# Switch PHP 5.3 -> PHP 5.4
sed -i 's|libphp5.so|libphp54-php5.so|' ~/php/configuration/etc/conf.d/php.conf
gear restart --cart php


# Switch PHP 5.4 -> PHP 5.3
sed -i 's|libphp54-php5.so|libphp5.so|' ~/php/configuration/etc/conf.d/php.conf
gear restart --cart php