Solved

Does composer need to be upgraded when upgrading to PHP7

Posted on 2016-08-02
2
84 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 110

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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

679 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