c-griffin
c-griffin

Reputation: 3026

installing php.5.5 with mcrypt on AWS Linux

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

Im setting up an Amazon Linux instance on EC2 and can't seem to get php 5.5 with mcrypt installed. yum seems to throw php 5.3 at me each time i try to do a group install or just as a dependency of mcrypt.

Any suggestions? This is for a Laravel 4.1 application.

Thanks!

Upvotes: 1

Views: 4188

Answers (2)

alex t
alex t

Reputation: 861

Since start configuring an EC2 instance can be tricky and indeed there is not much available support or documentation at the date I'm writting this answer, I'll post the steps I followed that worked for me. So I hope it will be useful to someone else:

  1. Start an EC2 instance as described on the AWS documentation. Do not use elastic beanstalk for deploying your php app.
  2. Start you PuTTY session, it is well described on the AWS documentation.
  3. When PuTTY session is on, install 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 
    
  4. Check your server properly working sudo service httpd start. If succesfully installed, you'll see 'OK' and you should be able to see a sample page in the public DNS.

  5. Add a group in order to allow "ec2-user" modifying and writing files inside var/www/html

    sudo groupadd www
    sudo usermod -a -G www ec2-user
    
  6. Exit PuTTY and reenter again (so changes will be applied) exit

  7. Reconnect and check membership

    groups
    
  8. Modify permissions on writing and editing files

    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 {} +
    
  9. Test your server

    echo "<?php phpinfo(); ?>" > /var/www/html/phpinfo.php
    sudo service httpd restart
    
  10. visit http://publicdomain/phpinfo.php. If properly working (it should) it will display the php info page.

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

Upvotes: 1

datasage
datasage

Reputation: 19563

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

Older packages are kept for compatability.

Upvotes: 1

Related Questions