2

I'm a student and pretty new to web development so forgive me if I'm missing something obvious. I recently attended a hackathon and was on a team with experienced developers who were building an app for deployment on AWS using the the Silex framework. Everyone else was using a Mac, while I have a PC running Windows 10. When they integrated AWS PHP SDK v3 from packagist I was unable to run the composer update function from the command line - I kept getting the following message:

Loading composer repositories with package information Updating dependencies (including require-dev) Your requirements could not be resolved to an installable set of packages. Problem 1 - aws/aws-sdk-php 3.3.5 requires php >=5.5 -> your PHP version (5.4.24) or " config.platform.php" value does not satisfy that requirement.

Because I was unable to run the composer update function, I wasn't able to update my app code and I couldn't continue to work on the project. This was frustrating, but I'm also just very confused about how to update PHP on my computer... I downloaded the zip file for PHP 5.6.13-nts and followed all the instructions I could find online for placing it in a folder structure, I also updated IIS so I can run phpinfo() on localhost and see that I have version 5.6.13 - yet when I try to run the composer update it still says I have PHP 5.4.24.

If anyone has any advice on this issue I'd appreciate it. Here's the version of the AWS SDK that's referenced above:

https://packagist.org/packages/aws/aws-sdk-php-silex

1 Answer 1

1

Welcome to StackOverflow, Blake!

It seems that you have multiple PHP versions installed and the CLI command php composer.phar ... uses php.exe from the old version. My guess is that the old version is still on the env path.

I suggest to check your environment path to find out, if the path to the old version of PHP is still added there. If so, simply replace it by the path to the new PHP version. And then execute a simple php -v on the CLI to see, if the new version is used. After that Composer should run fine.

You reach the dialog to change the environment variables by pressing WinBreak, then select "Advanced system settings", then "Environment Variables", then "Path".

(Sidenote and shameless plug: there are pre-configured web development stacks for Windows out there: WPN-XM or XAMPP, just to name a few. They are made to save developers some time, instead of doing software installation and configuration. Some of them ship Composer and other tools relevant for development with PHP right out of the box.)

3
  • Thanks Jens! This put me on the right track - I had already found out about the path settings but didn't realize the old path might be listed there. I was able to track down the culprit file and remove it from the path - and then the CLI recognized the proper version! Unfortunately I got another error related to enabling open ssl so Composer could update packages, which took me a while to track down... on stack overflow also. Gotta love it! Oh and thanks for the stack suggestions - both look good. Commented Sep 13, 2015 at 4:06
  • Hi @BlakeSchwartz, if Jens solved your problem you should accept his answer as valid by clicking the thick you'll find on the top left of the answer. This is how StackOverflow is meant to operate :-)
    – mTorres
    Commented Sep 13, 2015 at 8:36
  • 1
    Ah, I didn't know that. Thanks! Commented Sep 15, 2015 at 15:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.