Pushing a PHP app to Bluemix results in BuildpackCompileFailed - php

I am trying to push my PHP app to Bluemix with cf push phpinfo-jbs2 -b https://github.com/cloudfoundry/php-buildpack.git and I am getting a message that says BuildpackCompileFailed (full error below).
Any ideas on how to fix this?
[08:49 AM] jsloyer#Jeffs-MacBook-Pro-2 [php]>cf push phpinfo-jbs2 -b https://github.com/cloudfoundry/php-buildpack.git
Creating app phpinfo-jbs2 in org jbsloyer#us.ibm.com / space dev as jbsloyer#us.ibm.com...
OK
Creating route phpinfo-jbs2.mybluemix.net...
OK
Binding phpinfo-jbs2.mybluemix.net to phpinfo-jbs2...
OK
Uploading phpinfo-jbs2...
Uploading app files from: /Users/jsloyer/Downloads/php
Uploading 717, 3 files
Done uploading
OK
Starting app phpinfo-jbs2 in org jbsloyer#us.ibm.com / space dev as jbsloyer#us.ibm.com...
-----> Downloaded app package (4.0K)
Cloning into '/tmp/buildpacks/php-buildpack'...
Submodule 'compile-extensions' (https://github.com/cloudfoundry-incubator/compile-extensions) registered for path 'compile-extensions'
Cloning into 'compile-extensions'...
Submodule path 'compile-extensions': checked out 'ce9345a9a6e7b00266194cadd18dbef37e791a7b'
It looks like you're deploying on a stack (currently set to *lucid64*) that's not supported by this buildpack.
That could be because you're using a recent buildpack release on a deprecated stack.
If you're using the buildpack installed by your CF admin, please let your admin know you saw this error message.
If you at one point specified a buildpack that's at git URL, please make sure you're pointed at a version that supports this stack.
Staging failed: Buildpack compilation step failed
FAILED
BuildpackCompileFailed
TIP: use 'cf logs phpinfo-jbs2 --recent' for more information

Recently the company that owns development for Ubuntu (Cannonical) just announced it is dropping support for lucid 64 which is Ubuntu 10.04 LTS.  What does this mean for Cloud Foundry and the PHP buildpack?
Well nothing really but there is a couple gotcha's you should know about.
If you are pushing an app to Cloud Foundry and getting an error message like the following there is a workaround you need to do to get the PHP buildpack to work.
[08:49 AM] jsloyer#Jeffs-MacBook-Pro-2 [php]>cf push phpinfo-jbs2 -b https://github.com/cloudfoundry/php-buildpack.git
.....
It looks like you're deploying on a stack (currently set to *lucid64*) that's not supported by this buildpack.
That could be because you're using a recent buildpack release on a deprecated stack.
If you're using the buildpack installed by your CF admin, please let your admin know you saw this error message.
If you at one point specified a buildpack that's at git URL, please make sure you're pointed at a version that supports this stack.
Staging failed: Buildpack compilation step failed
FAILED
BuildpackCompileFailed
What this is saying is the instance of Cloud Foundry that you are running on the default stack is an old version of Ubuntu. The PHP buildpack expects the newer version of linux. This stack is called cflinuxfs2, also known as Ubuntu 14.04.
To work around this you just need to specify the stack you want to use.
cf push phpinfo-jbs2 -b https://github.com/cloudfoundry/php-buildpack.git -s cflinuxfs2
More information on this issue can be found at Github.

To avoid these type of issues, you can use the compatible buildpack that has been pre-installed into Bluemix.
cf push <appname> -b php_buildpack
To see all pre-installed buildpacks:
cf buildpacks

Related

Issue with deploying PHP Application to Elastic Beanstalk

I have a customized PHP application I am trying to deploy using Elastic Beanstalk. To deploy using ELB, I have zipped up the code and uploaded. I'm having trouble getting it to deploy correctly. Is there a correct way to zip and deploy?
Following errors showing up:
[Instance: i-1z123x1111a1z9999] Command failed on instance. An unexpected error has occurred [ErrorCode: 0000000001].
Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].
Unsuccessful command execution on instance id(s) 'i-1z123x1111a1z9999'. Aborting the operation.
Failed to deploy application.
During an aborted deployment, some instances may have deployed the new application version. To ensure all instances are running the same version, re-deploy the appropriate application version.
Please guide in any way possible.
Thanks
From the other conversation, the error
Yum does not have mod24_ssl available for installation
is due to fact that PHP 7.4 running on 64bit Amazon Linux 2/3.0.3 is used. mod24_ssl is only avaiablie on Amazon Linux 1, not Amazon Linux 2.
On Amazon Linux 2, the package is called mod_ssl. Thus to install it the following command can be used
sudo yum install -y mod_ssl

Twig_Error_Runtime ; the "core" extension is not enabled ; symfony

I've inherited a Symfony/PHP web app codebase with zero documentation. I'm a nodejs dev so you can image the fun...! Anyway I'm getting there, my focus atm is to be able to run the project locally.
Here's the Symfony version:
Symfony version 2.7.16 - app/dev/debug
I've installed packages via composer install.
I can start the web app locally via CLI:
php app/console server:run
Server running on http://127.0.0.1:8000
Quit the server with CONTROL-C.
However when I try to access this URL I'm seeing the following error in browser. Have google'd around but couldn't work it out so am hoping someone here can point me in the right direction.
I think this is due to trying to run a new version of twig on an old version of Symfony
as you can see here: https://github.com/symfony/symfony/issues/20284
They mention something similar, perhaps try to include an older version of twig in composer?
composer require twig/twig 1.23

Deploy multiple platforms to Elastic Beanstalk (PHP/Python)

Is it possible to deploy multiple platforms to AWS?
I have a PHP application that I would also like to run a small python script.
I see the PHP platform installs Python by default, but using eb deploy AWS does not pick up requirements.txt and install the dependencies.
I have tried installing requirements.txt manually which hangs when trying to install lxml.
I also tried adding a config file:
option_settings:
aws:elasticbeanstalk:container:python:
WSGIPath: application.py
NumProcesses: 3
NumThreads: 20
But now eb deploy complains about:
ERROR: "option_settings" in one of the configuration files failed validation. More details to follow.
ERROR: Unknown or duplicate parameter: WSGIPath
ERROR: Unknown or duplicate parameter: NumThreads
ERROR: Unknown or duplicate parameter: NumProcesses
Which I believe is because eb thinks this is only a PHP app.
What is the proper way to run multiple platforms side-by-side?
Solved by using .ebextentions to run pre-install commands in the container during deployment, which required setting the system path during eb deploy

Appengine glcoud command not found after install

After running the php GoogleAppEngineLauncher launching it and then restarting the command line gives as follows
gcloud auth login
-bash: gcloud: command not found.
Two weeks ago there was another step that is now missing in the docs along with components update. Please advise if this is still necessary.
Note I have the following in the /usr/local folder.
google_appengine
google_appengine.old
Currently installing 1.9.23 on a Mac OS 10.10
This is an issue caused by relying on GoogleAppLauncher instead of installing and using gcloud. (You should be able to do both).
Installing gcloud
Start here to make sure you have gcloud installed.
I doubt gcloud is packaged with GoogleAppLauncher, but I have not confirmed.
Why isn't it already like this?
https://cloud.google.com/appengine/downloads explains that symlinks may be created when installing the MAC version. If you skip this, you won't have access to appcfg.py or the appengine specific includes.
gcloud is a larger SDK package which manages all google cloud components. It has always been best practice for us at Loudr to use gcloud across the board.

Heroku Buildpack with Apache, PHP and Grunt

I use this Heroku Buildpack to compile my recent project on Heroku https://github.com/gcpantazis/heroku-buildpack-php-gruntjs
It works great with Node version 0.8.x. However, when I change to Node version 0.10.x and push code to heroku, it shows me this error "Failed to install -g grunt-cli --silent dependencies with npm".
Any help would be appreciated.
You can combine the regular PHP and Node.js buildpacks using heroku-buildpack-multi. Example: http://heroku-multipack-nodejs-php-ex.herokuapp.com
We use two buildpacks to enable us to compile frontend assets with Grunt
$ heroku buildpacks:set heroku/nodejs
Buildpack set. Next release on your-application will use heroku/nodejs.
Run git push heroku master to create a new release using this buildpack.
$ heroku buildpacks:set heroku/php --index 2
Buildpack set. Next release on your-application will use:
1. heroku/nodejs
2. heroku/php
Run git push heroku master to create a new release using these buildpacks.

Categories