installing laravel on EC2 - mbstring issue - amazon-web-services

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

Related

How to Enable PHP 7.0 Zip module on Amazon Linux AMI

Using the command line, I have installed PHP 7.0 on the Amazon Linux AMI.
However, I am unable to install the PHP Zip Module using the command
sudo yum install php7.0-zip
I get the response
No package php7.0.zip available.
I am excited to start using PHP7 on all my PHP websites, but am a little confused why I am unable to install this particular module. Any help would be much appreciated!
Welp,
After trying several variations of the same command...
sudo yum install php7.0-zip
sudo yum install php7-zip
THIS ONE WORKS
sudo yum install php70-zip

Laravel-dusk does not work

On working project, after installation of updates, I get errors with all dusk tests
1) Tests\Browser\ExampleTest::testBasicExample
Facebook\WebDriver\Exception\SessionNotCreatedException: session not created exception: Chrome version must be >= 60.0.3112.0
(Driver info: chromedriver=2.33.506092 (733a02544d189eeb751fe0d7ddca79a0ee28cce4),platform=Linux 4.4.0-81-generic x86_64)
I have already reinstalled dusk, updated composer and vagrant... And I have no any ideas how to update that dirver.
I am using macOS Sierra 10.12.1 and vagrant box on localhost. Chrome doesn't installed on the system.
Thanks for any advice..
Well...
After couple hours of dancing and googling, I installed update on the virtual Ubuntu
sudo apt-get update # Fetches the list of available updates
sudo apt-get upgrade # Strictly upgrades the current packages
sudo apt-get dist-upgrade # Installs updates (new ones)
It changed the version of Chrome.
After, I changed in my domain name .dev to .test, because Chrome >63+ forces .dev domains to HTTPS via preloaded HSTS.
Try to install chrome driver for a different version, I had the same issue and this fixed:
php artisan dusk:chrome-driver 74

Installing and Enabling PHP7.1 on AWS Elastic beanstalk

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.

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.

yum update from wrong repository i

I am running a AWS Linux AMI in AWS, it seems to be RHEL under the covers and uses yum (kernel 3.4.62-53.42.amzn1.x86_64) . The amazon repo includes nginx 1.4.2 which is out of date so I removed it and re-installed using the repo given at nginx website. I did this as such:
sudo yum remove nginx*
sudo yum --disablerepo="*" --enablerepo="nginx" install nginx
Note that yum priorities are disabled. I tried messing around with setting priority= in the repo files but decided disabling priorities made sense after reading up on it.
/etc/yum.repos.d files :
amzn-main.repo contains:
[amzn-main]
name=amzn-main-Base
mirrorlist=http://repo.us-east-1.amazonaws.com/$releasever/main/mirror.list
mirror_expire=300
metadata_expire=300
priority=10
failovermethod=priority
fastestmirror_enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-amazon-ga
enabled=1
retries=5
timeout=10
report_instanceid=yes
[amzn-main-debuginfo]
name=amzn-main-debuginfo
mirrorlist=http://repo.us-east-1.amazonaws.com/$releasever/main/debuginfo/mirror.list
mirror_expire=300
metadata_expire=300
priority=10
failovermethod=priority
fastestmirror_enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-amazon-ga
enabled=0
retries=5
timeout=10
report_instanceid=yes
nginx.repo contains:
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/rhel/6/$basearch/
gpgcheck=0
enabled=1
priority=1
Now doing the update once nginx 1.4.3 is installed, it tries to install the old version from the amazon main repo:
$ sudo yum update
Loaded plugins: update-motd, upgrade-helper
Resolving Dependencies
--> Running transaction check
---> Package nginx.x86_64 0:1.4.3-1.el6.ngx will be updated
---> Package nginx.x86_64 1:1.4.2-1.12.amzn1 will be an update
--> Finished Dependency Resolution
Dependencies Resolved
So not sure why its picking up the older version. Is there a way to configure yum to only update if the version is newer than currently installed? If there is no way, is there a way to skip nginx package when I do a general update and then update nginx using another command as described above that disables all repos and uses only nginx repo, here it is again:
sudo yum --disablerepo="*" --enablerepo="nginx" install nginx
To ignore any specific package in a single yum repository, one may add the following line to their /etc/yum.repos.d/${amazonreponame}.repo configuration file:
exclude=package_name*
Example:
[amzn-main]
name=amzn-main-Base
mirrorlist=http://repo.us-east-1.amazonaws.com/$releasever/main/mirror.list
mirror_expire=300
metadata_expire=300
priority=10
failovermethod=priority
fastestmirror_enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-amazon-ga
enabled=1
retries=5
timeout=10
report_instanceid=yes
exclude=nginx*
The exclude=* option may also be added globally (i.e., all repos) to /etc/yum.conf