Solved

Does composer need to be upgraded when upgrading to PHP7

Posted on 2016-08-02
2
59 Views
Last Modified: 2016-08-03
I have an mvc app which uses composer on a Centos7 web server which was upgraded to php70w.
Does this mean composer and its modules should also be upgraded and if so, how?

# composer install --dry-run
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
    - This package requires php ~5.4 but your PHP version (7.0.9) does not satisfy that requirement.
0
Comment
Question by:projects
2 Comments
 
LVL 108

Accepted Solution

by:
Ray Paseur earned 500 total points
ID: 41740381
Please see these links:
https://getcomposer.org/doc/01-basic-usage.md#package-versions
https://getcomposer.org/doc/articles/versions.md

It looks like a requirement for ~5.4 would allow PHP5.4, PHP5.4.x, PHP5.5 but not PHP7.x.  Using the tilde tells composer to restrict the major version number to 5, and to set the minimum to 5.4.

I can't tell what your specific PHP requirements are from where I sit.  There are known breaking changes between 5.4.x and 7.0.  These can be found by walking through the changelog (see also).  If you determine that PHP7 is OK for your application, your expression might look something like this:

>=7.0-stable
0
 

Author Comment

by:projects
ID: 41741072
Thanks, we'll have a closer look at this.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now