33source /etc/apache-bootstrap.conf
44
55# Allow PHP settings to be varied by passing a parameter to php-wrapper
6- PHP_VERSION =${1}
6+ PHP_PACKAGE_NAME =${1}
77
88# Mode of opperation: production,development,debug.
99# Used to enable appropriate php options for requirements
@@ -27,35 +27,30 @@ export REDIRECT_STATUS=200
2727X_NICE=/bin/nice
2828NICENESS_PHP_CGI=15
2929
30- PHP54_INSTALLED=false
31- PHP54_X_CGI=/opt/rh/php54/root /usr/bin/php-cgi
30+ # Default to the default distribution version
31+ X_PHP_CGI= /usr/bin/php-cgi
3232
33- if [[ -f /opt/rh/php54/enable ]]; then
34- PHP54_INSTALLED=true
35- source /opt/rh/php54/enable
36- export X_SCLS=" $( scl enable php54 ' echo $X_SCLS' ) "
37- fi
38-
39- PHP55_INSTALLED=false
40- PHP55_X_CGI=/opt/rh/php55/root/usr/bin/php-cgi
33+ if [[ ${PHP_PACKAGE_NAME} == rh-php56 ]] \
34+ && [[ -f /opt/rh/rh-php56/enable ]] \
35+ && [[ -f /opt/rh/rh-php56/root/usr/bin/php-cgi ]]; then
36+ source /opt/rh/rh-php56/enable
37+ export X_SCLS=" $( scl enable rh-php56 ' echo $X_SCLS' ) "
4138
42- if [[ -f /opt/rh/php55/enable ]]; then
43- PHP55_INSTALLED=true
39+ X_PHP_CGI=/opt/rh/rh-php56/root/usr/bin/php-cgi
40+ elif [[ ${PHP_PACKAGE_NAME} == php55 ]] \
41+ && [[ -f /opt/rh/php55/enable ]] \
42+ && [[ -f /opt/rh/php55/root/usr/bin/php-cgi ]]; then
4443 source /opt/rh/php55/enable
4544 export X_SCLS=" $( scl enable php55 ' echo $X_SCLS' ) "
46- fi
4745
48- if [[ ${PHP_VERSION} == php55 ]] \
49- && [[ ${PHP55_INSTALLED} == true ]] \
50- && [[ -f ${PHP55_X_CGI} ]]; then
51- X_PHP_CGI=${PHP55_X_CGI}
52- elif [[ ${PHP_VERSION} == php54 ]] \
53- && [[ ${PHP54_INSTALLED} == true ]] \
54- && [[ -f ${PHP54_X_CGI} ]]; then
55- X_PHP_CGI=${PHP54_X_CGI}
56- else
57- # Default to the default distribution version
58- X_PHP_CGI=/usr/bin/php-cgi
46+ X_PHP_CGI=/opt/rh/php55/root/usr/bin/php-cgi
47+ elif [[ ${PHP_PACKAGE_NAME} == php54 ]] \
48+ && [[ -f /opt/rh/php54/enable ]] \
49+ && [[ -f /opt/rh/php54/root/usr/bin/php-cgi ]]; then
50+ source /opt/rh/php54/enable
51+ export X_SCLS=" $( scl enable php54 ' echo $X_SCLS' ) "
52+
53+ X_PHP_CGI=/opt/rh/php54/root/usr/bin/php-cgi
5954fi
6055
6156# Unset MySQL environment variables if they are not set in the vhost
0 commit comments