Solved

Does composer need to be upgraded when upgrading to PHP7

Posted on 2016-08-02
2
98 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Fine Tune your automatic Updates for Ubuntu / Debian
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
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.

634 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