0

Unfortunately I wasn't the one to set up this infrastructure so I'm lacking on some really basic concepts here.

We're using AWS Launch Configurations to manage EC2 instances, and I'd like to upgrade the PHP from 5.5.9 to 5.6 (or even better to PHP 7).

We're running Laravel projects on these instances. The composer.json file does have a "php" require (at 5.5.9) but changing this value doesn't seem to inherently change the PHP version of the instances at hand. This package requires php >=5.6.0 but your PHP version (5.5.9) does not satisfy that requirement.

If I upgrade other packages dependent on a higher PHP version I receive this error: phpunit/phpunit 5.7.9 requires php ^5.6 || ^7.0 -> your PHP version (5.5.9-1ubuntu4.14) or "config.platform.php" value does not satisfy that requirement.

The line 5.5.9-1ubuntu4.14 seems to tell me that the Linux image being used to launch these EC2 instances is locked in at PHP 5.5.9.

I hope I'm explaining enough about the architecture to get an idea on how I can modify my launch configuration to launch instances using a higher version of PHP.

I strongly believe I shouldn't need to log into each instance and modify the PHP version independently - if the launch configuration were to launch new instances, they'd be back at the old version.

Rail24
  • 111
  • 1
  • 3
  • I hope you mean what you say when you say you're using launch configs and not user-data script. If it's user-data script answer would be different. – Shailesh Sutar Jan 23 '18 at 18:16

1 Answers1

0

You need to pull one instance out from your autoscaling group and update the PHP version to your desired version on it. You should create an ami from this instance and note down the ami-id. And update the launch configs with this newly created ami-id. Once you do that all you need is make changes in autoscaling group to use newly created launch config.

Shailesh Sutar
  • 1,517
  • 5
  • 23
  • 41