Issue with deploying PHP Application to Elastic Beanstalk - php

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

Related

Docker image DNS issues

I am trying to build a Docker container for my new project and seem to be getting odd GitHub DNS resolution issues while attempting to run the docker build command.
I can't run the composer install command on my local machine because I have an outdated version of PHP which is why I am attempting to use a container.
Multiple other project on my personal machine don't have an issue installing composer dependences, but when I try and build the Docker Image I get several (but not all) errors for packages that are as follows
- Syncing phar-io/version (3.1.0) into cache
Failed to download slim/psr7 from dist: curl error 6 while downloading https://api.github.com/repos/slimphp/Slim-Psr7/zipball/0dca983ca32a26f4a91fb11173b7b9eaee29e9d6: Could not resolve host: api.github.com
Now trying to download from source
- Syncing slim/psr7 (1.4) into cache
120/120 [============================] 100%The following exception probably indicates you have misconfigured DNS resolver(s)
[Composer\Downloader\TransportException]
curl error 6 while downloading https://api.github.com/repos/phingofficial/phing-composer-configurator/zipball/a151e1804dd4c946969cfb78bed1a0e12f52ad34: Could not resolve host: api.github.com
Is this something I have misconfigured in Docker, the DockerFile, or my Composer JSON?
It appears that this is an issue with my specific version of Docker Desktop for Mac.
DNS resolution fails in Docker for Mac in versions prior to 3.1.0 periodically due to a buggy MacOS API They are using to pass DNS resolution to the guest. The solution is to update to a new version of Docker For Mac.
I've provided a summary of the issue should anyone need resolution in the future. More information can be found here
https://github.com/docker/for-mac/issues/5020

AWS EC2 : service file keep deleting while using composer update in AWS terminal

I am using AWS EC2 LAMP server, when update or install any vendor library(require packages), my service.php file getting deleted, It's in Project\bootstrap\catch\service.php and getting error for all API calls.
Some Time - AWS Public IP changed while enter composer update in terminal once.

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.

Pushing a PHP app to Bluemix results in BuildpackCompileFailed

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

Categories