Incorrect version of PHP returned to Openshift

I created a PHP application (from scratch) using the available instructions here . The /mish/make.shphp version is 5.5.18. After the assembly, the information on the php page confirms the version: 5.5.18.

However, when I register my Openshift application with SSH, it php --versionreturns 5.3.3 with the wrong build date:

enter image description here

I discovered this problem when I tried installing Composer on Openshift . I got an error message when git clicking on Openshift:

enter image description here

I do not know if the problem is with the DYI cartridge or with Openshift. Somebody knows?

Update

, PATH build script (. question)

#!/bin/bash

export PATH=${OPENSHIFT_HOMEDIR}/app-root/runtime/bin/:${PATH}

export COMPOSER_HOME="$OPENSHIFT_DATA_DIR/.composer"

if [ ! -f "$OPENSHIFT_DATA_DIR/composer.phar" ]; then
    curl -s https://getcomposer.org/installer | php -- --install-dir=$OPENSHIFT_DATA_DIR
else
    php $OPENSHIFT_DATA_DIR/composer.phar self-update
fi

( unset GIT_DIR ; cd $OPENSHIFT_REPO_DIR ; php $OPENSHIFT_DATA_DIR/composer.phar install )
0
3

, :

script (.openshift/action_hooks/build)? laobubu .


bugzilla: PHP $OPENSHIFT_HOMEDIR/app-root/runtime/bin/php

, , :

  • # rhc app-create p55test diy-0.1 --from-code'https://github.com/laobubu/openshift-php5.5-cgi-apache.git'

    Application Options
    -------------------
    Domain:      jltest
    Cartridges:  diy-0.1
    Source Code: https://github.com/laobubu/openshift-php5.5-cgi-apache.git
    Gear Size:   default
    Scaling:     no
    
    Creating application 'p55test' ... done
    
      Disclaimer: This is an experimental cartridge that provides a way to try unsupported languages, frameworks, and middleware on OpenShift.
    
    Your application 'p55test' is now available.
    
      URL:        http://p55test-jltest.dev.rhcloud.com/
      SSH to:     xxxxxxxxxxxxxxxxxxxxxxxx@p55test-jltest.dev.rhcloud.com
    
      Git remote: ssh://xxxxxxxxxxxxxxxxxxxxxxxx@p55test-jltest.dev.rhcloud.com/~/git/p55test.git/
    
    Run 'rhc show-app p55test' for more details about your app.
    
  • # curl 'http://p55test-jltest.dev.rhcloud.com/'

    <html>
    <head>
    <title>Installed</title>
    </head>
    <body>
    <h1>Installed</h1>
    <p>You just created one amazing PHP5.5+Apache app.</p>
    <h2>Next...</h2>
    <p>
    <p>Follow the instruction on <a href=https://github.com/laobubu/openshift-php5.5-cgi-apache>https://github.com/laobubu/openshift-php5.5-cgi-apache</a>.
    <p>You can refresh this page to check if the world is ready.
    <p><a href=?doitnow>Come on, robot, you can do it automatically...</a><p>
    </p></body></html>
    
  • # curl 'http://p55test-jltest.dev.rhcloud.com/?doitnow'

    <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
    <html><head>
    <title>302 Found</title>
    </head><body>
    <h1>Found</h1>
    <p>The document has moved <a href="./?working">here</a>.</p>
    <hr>
    <address>Apache/2.2.15 (Red Hat) Server at p55test-jltest.dev.rhcloud.com Port 80</address>
    </body></html>
    
  • # rhc ssh p55test

    [p55test-jltest.dev.rhcloud.com xxxxxxxxxxxxxxxxxxxxxxxx]\> top
    
  • make.sh

  • [p55test-jltest.dev.rhcloud.com xxxxxxxxxxxxxxxxxxxxxxxx]\> $OPENSHIFT_HOMEDIR/app-root/runtime/bin/php --version

    PHP 5.5.18 (cli) (built: Jul 22 2015 10:33:49)
    Copyright (c) 1997-2014 The PHP Group
    Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
    

, , , PHP , , :

  • # curl 'http://p55test-jltest.dev.rhcloud.com/?phpinfo'

    <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
    <html><head>
    <title>302 Found</title>
    </head><body>
    <h1>Found</h1>
    <p>The document has moved <a href="./15541_PHPINFO_TEMP.php">here</a>.</p>
    <hr>
    <address>Apache/2.2.15 (Red Hat) Server at p55test-jltest.dev.rhcloud.com Port 80</address>
    </body></html>
    
  • # curl 'http://p55test-jltest.dev.rhcloud.com/15541_PHPINFO_TEMP.php' | grep -i 'php version'

    ...snip...
    <h1 class="p">PHP Version 5.5.18</h1>
    <tr><td class="e">PHP Version </td><td class="v">5.5.18 </td></tr>
    
+1

PHP /.

, PHP, . , PHP misc . .

PHP , . ${OPENSHIFT_HOMEDIR}/app-root/runtime/php5/bin/php.


:

  • export OPENSHIFT_RUNTIME_DIR=${OPENSHIFT_HOMEDIR}/app-root/runtime /misc/common.sh.
  • , PHP ( ?)
  • PHP, . alias php='${OPENSHIFT_RUNTIME_DIR}/php5/bin/php'.
+1

which php /usr/bin/php, , PHP 5.3.3 , .

PHP, :

export PATH=${OPENSHIFT_HOMEDIR}/app-root/runtime/bin/:${PATH}

hookhifts ( .openshift/action_hooks), .

+1

Source: https://habr.com/ru/post/1598360/


All Articles