Solved

Does composer need to be upgraded when upgrading to PHP7

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

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Securing Azure Oracle instance of Linux VM 4 56
windows 7 starter missing password 21 74
PHP AJAX Wordpress 9 19
how to configure linux OS using Ubuntu 7 35
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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 find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
The viewer will learn how to dynamically set the form action using jQuery.

815 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

11 Experts available now in Live!

Get 1:1 Help Now