Installing and Enabling PHP7.1 on AWS Elastic beanstalk - amazon-web-services

Most PHP vital libraries have been mandating PHP7.1 in their releases lately and I happen to have an API staged on AWS elastic beanstalk PHP7.0 platform that I'd like to make compliant with this recent change.
Seeing as Amazon has greatly delayed this shift since December 1, 2016 release of PHP7.1, I've tried so many things to make PHP7.1 available on this AWS Elastic beanstalk platform originally intended for PHP7.0
Below is my sample upgrade script:
sudo su
yum -y remove php70
wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
sudo rpm -Uvh remi-release-6*.rpm
yum-config-manager --enable remi-php71
wget ftp://195.220.108.108/linux/epel/6/x86_64/scl-utils-20120229-1.el6.x86_64.rpm
rpm -Uvh scl-utils-20120229-1.el6.x86_64.rpm
yum -y install php71
source /opt/remi/php71/enable
yum -y install php71-php-soap php71-php-bcmath php71-php-devel php-71-php-intl php71-php-mbstring php71-php-mcrypt php71-php-mysqlnd php71-php-opcache php71-php-pgsql php71-php-odbc php71-php-pecl-uuid php71-php-pecl-memcache php71-php-igbinary php71-php-oauth php71-php-xml php71-php-xmlrpc php71-php-process php71-php-apcu
But unless I run the source /opt/remi/php71/enable every time, I can't seem to get PHP71 by default as the PHP cli runtime.
In a bid to fix that, I did yum remove php70* to clean up the old PHP7.0 installation but that led to a problem with the AWS EBS deployment hook scripts.
Right now, I'm in a fix and it seems like I have to be forced to work with PHP7.0 and downgrade most of my PHP libraries. I just want to know if anyone can get me out of this messed up state.
Thank you.

Remi repository provides 2 way to install PHP 7.1
base packages (php-*) 1 repository by version, single version allowed, so you need remi-php71 repository enabled
SCL packages (php71-php-*) designed for parallel installation in remi-safe repository (which you have installed)
As explain in the FAQ.
Also see the Wizard instructions.

Amazon released a new version of Elastic beanstalk with PHP 7.1 support.
Upgrade your environment to use this configuration.

Related

How to add unavailable packages to EC2 instance?

This might be a really silly question, but I'm trying to train this model: https://github.com/Rayhane-mamah/Tacotron-2 on an AWS instance. I'm using an AWS educate account so I was unable to launch an EC2 instance with a Deep Learning AMI, instead I launched a regular Linux 2 AMI.
As per the repo's machine setup instructions, I installed python3 and pip and tensorflow onto the instance. However, I am unable to run the command:
sudo yum install -y libasound-dev portaudio19-dev libportaudio2 libportaudiocpp0 ffmpeg libav-tools
(the repo lists the command with apt-get instead of yum)
When I run that command, most of the packages are unavailable. The output I get is:
No package libasound-dev available.
No package portaudio19-dev available.
No package libportaudio2 available.
No package libportaudiocpp0 available.
No package ffmpeg available.
No package libav-tools available.
How can I install these packages onto my ec2 instance? Thanks
EDIT: I see now my issue is EC2's Linux 2 AMI is running on Centos. I would have to manually install each of these packages (I think). Might be easier to try and launch an Ubuntu server, or Linux 1 and use the docker file included in the repo.
You Can use Cloud Formation Template to install the pacakges inside EC2 .In that way whenever EC2 comes up , it will come up with all the packages.
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/deploying.applications.html

need help to install php 7.2 yum packages on aws ec2

I haven't seen any yum packages for php 7.2 on AWS EC2 and the release has been out over a month.
I have tried yum list | grep php7 and only able see php70 and php71 packages.
Has anyone installed php72 on AWS EC2?
Is there another yum repo to connect to?
Does AWS have a delivery scheduled?
Although the #amzn-main repo doesn't have PHP 7.2 yet (as far as I know), you can use remi-php72. According to his release blog you can install the EPEL and Remi repositories via:
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
wget http://rpms.remirepo.net/enterprise/remi-release-6.rpm
rpm -Uvh remi-release-6.rpm
rpm -Uvh epel-release-latest-6.noarch.rpm
And then enable remi-php72 using yum-config-manager:
yum install yum-utils
yum-config-manager --enable remi-php72
After that, you can simply search and install php and all the needed extensions like normal:
sudo yum install --disablerepo="*" --enablerepo="remi,remi-php72" php php-fpm php-cli ...
As #Typel says in a comment on the other answer - if you're using Amazon Linux 2 AMI then
sudo amazon-linux-extras install -y php7.2
Beats installing multiple external repos and has most of th basics, including mariadb and vim (everything I need to feel happy!).
See the list: sudo amazon-linux-extras list

php56-common conflicts with php-common-5.3.29-1.8.amzn1.x86_64 when installing phpmyadmin

I have successfully installed php70 and mysql. But when i am trying to install phpmyadmin by
$ sudo yum-config-manager --enable epel
And Then
$ sudo yum install -y phpMyAdmin
It gives me
--> Finished Dependency Resolution
Error: php70-common conflicts with php-common-5.3.29-1.8.amzn1.x86_64
Error: php56-common conflicts with php-common-5.3.29-1.8.amzn1.x86_64
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
Also after google sometimes i found a solution that try this
sudo yum install php70-mbstring
And i have tried this also, Still facing same error.
Any suggestion...?
I guess that you are following the Amazon tutorial to install phpMyAdmin ?
I had the same problem today and resolved it by uninstall PHP 7.0 with the yum command (the same given by Amazon with 'remove' instead of 'install' :
sudo yum remove httpd24 php70 mysql56-server php70-mysqlnd
and installed PHP 5.6 instead :
sudo yum install httpd24 php56 mysql56-server php56-mysqlnd
I don't know if this is a good solution, but it worked and I could install phpMyAdmin without dependencies problem. I hope it will help :)
In case you want to keep php7, I found a solution with AWS Amazon experts.
Just use :
sudo yum install -y php70-mbstring
I was having the same issue today. I had some success downloading phpmyadmin from phpmyadmin.net, and following their instructions. I did run into a different problem during the setup of phpmyadmin....
So, I punted on resolving this with the Amazon AMI for now, and chose to install the Bitnami LAMP AMI to get me going quicker. It comes with phpmyadmin configured.
NOTE: Bitnami's AMI is running PHP Version 5.6.29, so I would say it's valid to follow the previous post's advice and downgrade, unless your web application specifically needs PHP 7.0.

How to restore gsutil command?

I have updated Google Cloud SDK to the latest version 135.0.0 from
After the update , I got the following message.
WARNING: There are older versions of Google Cloud Platform tools on
your system PATH. Please remove the following to avoid accidentally
invoking these old tools:
/usr/bin/git-credential-gcloud.sh
/usr/bin/bq
/usr/bin/gcloud
/usr/bin/gsutil
So I have deleted all the above folders.
After that gsutil stopped working.
Please help me how can I resolve the issue.
The issue that it was installed via
sudo apt-get update && sudo apt-get install google-cloud-sdk
see
https://cloud.google.com/sdk/docs/#deb
and you should have used the same mechanism to upgrade.
gcloud is also kind of a package manager, and is able to upgrade itself and its depended packages. Unfortunately if you use gcloud itself to upgrade it installs it in different location. It likely does not work because new location needs to be added to your path.
You can try to reinstall googcle-cloud-sdk package via apt-get.

installing laravel on EC2 - mbstring issue

I have installed Laravel 5.2 successfully on my Mac machine. But now I am walking through the procedures to install Laravel on AWS.
Once I got the instance running, I installed apache, php and mysql with the following command:
sudo yum install -y httpd24 php56 mysql55-server php56-mysqlnd
The php version is 5.6.17
I then did the following:
composer global require "laravel/installer"
and updated the path: export PATH=$PATH:~/.composer/vendor/bin
when I navigate to /var/www/html and do "laravel new ", the project gets created but I receive an mbstring extension problem. Below is a text dump of what I saw:
laravel new hws3
Crafting application...
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for laravel/framework v5.2.29 -> satisfiable by laravel/framework[v5.2.29].
- laravel/framework v5.2.29 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
I've scoured the internet and only found a solution for Windows. I am using Amazon Linux. Any guidance would be most appreciated.
It seems you have php 5.6 installed.
You need to install mbstring for that particular version of php.
Run sudo yum install php56-mbstring
credits: Alex Andrei answered here
If you want to install Laravel with composer, This is the right answer!
sudo su //to be root
yum install php56-mbstring