Igor Garcia
Igor Garcia

Reputation: 39

How to downgrade the php version to 5.6 from 7.0 in a symfony project?

I'm working in a project with Symfony Framework, but i have problems with php 7.0. Can I downgrade the php version or I need rewrite the entire application?

Upvotes: 1

Views: 2349

Answers (1)

dbrumann
dbrumann

Reputation: 17166

Symfony 3 requires at least PHP 5.5.9, so generally speaking, you can downgrade if you want. Of course you might have other limitations, like additional bundles and libraries you have installed and you might have used PHP 7 features inside your own code.

If you want to downgrade you can run:

composer why-not php:5.6

This will tell you which libraries you installed will not work with PHP 5.6. You might be able to downgrade them, but obviously this is not guaranteed and might require changes to how you use those bundles and libraries. For this you will have to check their upgrade guides and "undo" those changes.

For checking your own code you can use tools like etsy's phan to check for compatibility with a specific target version of php: https://github.com/phan/phan#usage

Upvotes: 3

Related Questions