Install php.5.5 using mcrypt on AWS Linux

This is a n00b question, but I'm a much better developer than the sys admin.

Im setting up an Amazon Linux instance on EC2 and it seems like it cannot get php 5.5 with mcrypt installed. yum seems to throw php 5.3 on me every time I try to do a batch installation or just as a mcrypt dependency.

Any suggestions? This is for Laravel 4.1 application.

Thanks!

+1
source share
2 answers

If you are using amazon linux, you will need to install php packages starting with php55 .

Old packages are kept for compatibility.

+1
source

Since starting an EC2 instance setup can be tricky, and indeed, on the date I write this answer, there is not much support or documentation available, I will post the steps that I followed, which worked for me. Therefore, I hope this will be useful to someone else:

  • Start the EC2 instance as described in the AWS documentation. Do not use elastic beanstalk to deploy your php application.
  • Start a PuTTY session, it is well described in the AWS documentation.
  • When the PuTTY session is enabled, install it in the following order: apache server (v 2.4), php55, php55-mcrypt, php55-pdo and mysql55

     sudo yum install httpd24 sudo yum install php55 sudo yum install php55-mcrypt sudo yum install php55-pdo sudo yum install mysql55 
  • Verify that your sudo service httpd start server is working properly. If you have successfully installed, you will see "OK", and you will be able to see a sample page in the public DNS.

  • Add a group to allow "ec2-user" to modify and write files inside var / www / html

     sudo groupadd www sudo usermod -a -G www ec2-user 
  • Exit PuTTY and run again (so the changes will be applied) exit

  • Connect and verify membership

     groups 
  • Change write and edit permissions

     sudo chown -R root:www /var/www sudo chmod 2775 /var/www find /var/www -type d -exec sudo chmod 2775 {} + find /var/www -type f -exec sudo chmod 0664 {} + 
  • Check your server

     echo "<?php phpinfo(); ?>" > /var/www/html/phpinfo.php sudo service httpd restart 
  • visit http: //publicdomain/phpinfo.php . If it works correctly (it should), it will display a page with php information.

All these steps worked well for me after hours of working with php versions that are not compatible with laravel 4.1> =

+1
source

Source: https://habr.com/ru/post/973075/


All Articles