Solved

Does composer need to be upgraded when upgrading to PHP7

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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

In my business, I use the LTS (Long Term Support) versions of Linux. My workstations do real work, and so I rarely have the patience to deal with silly problems caused by an upgraded kernel that had experimental software on it to begin with from a r…
You ever wonder how to backup Linux system files just like Windows System Restore?  Well you can use Timeshift in Linux to perform those similar action.  This tutorial will show you how to backup your system files and keep regular intervals. Note…
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

920 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

15 Experts available now in Live!

Get 1:1 Help Now