Search code examples
phplaravelibm-cloudcloud-foundry

Error while trying to push app into Bluemix with LARAVEL Ver 5.3 and PHP 7.0


Hitting with this error while trying to push app into Bluemix with LARAVEL Ver 5.3 and PHP 7.0

Your requirements could not be resolved to an installable set of packages.

Problem 1
    - This package requires 
php
>=5.6.4 but your PHP version (5.5.38) does not satisfy that requirement.

Problem 2
    - laravel/framework v5.3.23 requires php >=5.6.4 -> your PHP version (5.5.38) does not satisfy that requirement.
    - laravel/framework v5.3.23 requires php >=5.6.4 -> your PHP version (5.5.38) does not satisfy that requirement.

Attaching the full output of staging:

   Updated app with guid 99128c49-c374-407b-940d-c8842d8419f9 ({"buildpack"=>"https://github.com/cloudfoundry/php-buildpack", "name"=>"*****", "command"=>"PRIVATE DATA HIDDEN", "instances"=>1, "memory"=>512, "environment_json"=>"PRIVATE DATA HIDDEN"})

    Updated app with guid 99128c49-c374-407b-940d-c8842d8419f9 ({"route"=>"d5d0cb3b-d428-4297-823d-8bfebd318b98"})

    Updated app with guid 99128c49-c374-407b-940d-c8842d8419f9 ({"console"=>true, "state"=>"STOPPED"})

    Got staging request for app with id 99128c49-c374-407b-940d-c8842d8419f9
    Updated app with guid 99128c49-c374-407b-940d-c8842d8419f9 ({"console"=>true, "state"=>"STARTED"})

    -----> Downloaded app package (132M)
    Cloning into '/tmp/buildpacks/php-buildpack'...
    Cloning into 'compile-extensions'...
    Submodule path 'compile-extensions': checked out '6fc96370a0c95fb3ac22d47a4436152a38bed540'
    -------> Buildpack version 4.3.24
    Installing HTTPD
    HTTPD 2.4.23
    Downloaded [https://buildpacks.cloudfoundry.org/dependencies/manual-binaries/httpd/httpd-2.4.23-linux-x64.tgz] to [/tmp]
    Installing PHP
    PHP 5.5.38
    Downloaded [https://buildpacks.cloudfoundry.org/dependencies/php/php-5.5.38-linux-x64-1479852231.tgz] to [/tmp]
    The extension 'tokenizer' is not provided by this buildpack.
    The extension 'dom' is not provided by this 
    buildpack
    .
    The extension '
    json
    ' is not provided by this 
    buildpack
    .
    The extension '
    libxml
    ' is not provided by this 
    buildpack
    .
    The extension '
    xml
    ' is not provided by this 
    buildpack
    .
    Downloaded [https://buildpacks.cloudfoundry.org/dependencies/php/php-5.5.38-linux-x64-1479852231.tgz] to [/tmp]
    Downloaded [https://buildpacks.cloudfoundry.org/dependencies/php/binaries/trusty/composer/1.2.4/composer.phar] to [/tmp]
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed

      0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
      0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
    100   283  100   283    0     0    215      0  0:00:01  0:00:01 --:--:--   215
    Loading composer repositories with package information
    Installing dependencies from lock file

    Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them.

    Your requirements could not be resolved to an installable set of packages.

    Problem 1
        - This package requires 
    php
    >=5.6.4 but your PHP version (5.5.38) does not satisfy that requirement.

    Problem 2
        - laravel/framework v5.3.23 requires php >=5.6.4 -> your PHP version (5.5.38) does not satisfy that requirement.
        - laravel/framework v5.3.23 requires php >=5.6.4 -> your PHP version (5.5.38) does not satisfy that requirement.
        - Installation request for laravel/framework v5.3.23 -> satisfiable by laravel/framework[v5.3.23].
    Traceback (most recent call last):
    -----> Composer command failed


        File "/tmp/buildpacks/php-buildpack/scripts/compile.py", line 50, in <module>
            .from_build_pack('lib/additional_commands')
          File "/tmp/buildpacks/php-buildpack/lib/build_pack_utils/builder.py", line 208, in extensions
            process_extension(path, ctx, 'compile', process, args=[self])
          File "/tmp/buildpacks/php-buildpack/lib/build_pack_utils/utils.py", line 69, in process_extension
            success(getattr(extn, to_call)(*args))
          File "/tmp/buildpacks/php-buildpack/extensions/composer/extension.py", line 425, in compile
            return composer.compile(install)
          File "/tmp/buildpacks/php-buildpack/lib/extension_helpers.py", line 154, in compile
            self._compile(install)
          File "/tmp/buildpacks/php-buildpack/extensions/composer/extension.py", line 192, in _compile
            self.run()
          File "/tmp/buildpacks/php-buildpack/extensions/composer/extension.py", line 327, in run
            *self._ctx['COMPOSER_INSTALL_OPTIONS'])
          File "/tmp/buildpacks/php-buildpack/extensions/composer/extension.py", line 371, in run
            shell=True)
          File "/tmp/buildpacks/php-buildpack/lib/build_pack_utils/runner.py", line 109, in stream_output
            raise CalledProcessError(retcode, cmd)
        build_pack_utils.runner.CalledProcessError: Command '<open file '<fdopen>', mode 'w' at 0x7f53abf406f0>' returned non-zero exit status 2
        Staging failed: Buildpack compilation step failed
        encountered error: App staging failed in the buildpack compile phase

In options.json,tried with latest version of PHP 7.0, still it was picking up version 5.5.38.

Also, tried running composer update locally as well.

Is it buildpack level issue?

Any workaround?


Solution

  • Did you forget to include the curly brackets {} when declaring use of the PHP 7.0 Latest version within the options.json file?

    "PHP_VERSION": "{PHP_70_LATEST}"

    Debugging Guidance

    • Buildpack: Set a Cloud Foundry ENV VAR BP_DEBUG: true and restage
    • Laravel PHP App: Set a Cloud Foundry ENV VAR APP_DEBUG: true and restage. When you hit the app's url, you will get stacktrace info.

    Skeleton Laravel Bluemix App

    You can find a skeleton repo with a Laravel 5.3 code base that is Bluemix friendly and deploys using PHP 7.x here.

    To deploy, simply

    git clone https://github.com/ibmjstart/Bluemix-Laravel-Demo
    cd Bluemix-Laravel-Demo
    cf push

    Hopefully, this should help illustrate the mechanics to get you started.