It will work. Why wouldn't it work?
Laravel 4.2 and PHP 7
Does anyone know if version 4.2 works on PHP 7 or not Thanks.
@Ruffles so the new PHP error and exception handling is fine in ver 4.2?
It shouldn't break anything because errors can be caught in PHP 7, compared to them being fatal errors in 5.6!
PHP 7 and Laravel 4.2 doesn't work perfectly as Laravel enforces Exception classes being passed around and PHP 7 now uses Throwable as the base exception. The biggest problems with this is that when an error happens it won't be reported properly.
Is this something that's fixable?
Bump! Anyone know a nice way to get proper error handling in 4.2 running on PHP7?
Let's move you to top, can anyone help here, I have one project in 4.2 I would would love to keep there.
@jlrdw can you bring up a VM with php7 and try it? Looks like other people are trying and indeed hitting the Exception/Throwable issues : https://github.com/laravel/framework/issues/11329 . At a guess they're focused on finishing up 5.2 just now - maybe 4.2 will get some attention after that, though given the policy is only to support for a year it might not :-/ I've got some stuff using 4.1 so I'm not upgrading it to 7.
I don't think there's going to be any further 4.2 support.
As a dirty, dirty workaround, I've pushed a fork of the 4.2.17 release tag up to my own repository.
This forked master branch changes the \Exception requirement to be \Throwable.
My fork: https://github.com/jadz/laravel-framework-4.2.18-php7
composer.json updates:
"repositories": [
{
"type": "git",
"url": "https://github.com/jadz/laravel-framework-4.2.18-php7"
}
],
"require": {
"laravel/framework": "dev-master"
}
You might need to remove your bootstrap/compiled.php version before running a composer update.
Feel free to submit any pull requests.
Note - I'm certain there is a more elegant way of achieving this, but for my purposes this quick and dirty fix will get me over the line while I work on upgrading our codebase to make a 5.2 transition easier.
4.2 works fine for me on php7.0.1
@jadz0r is spot-on. If you throw exceptions in your app you're likely to run into Error in exception handler.
@bashy above @jadz0r said If you throw exceptions in your app you're likely to run into Error in exception handler.
Has anyone figuried an easy fix to run laravel 4.2 on php 7, like some settings tweak? But also work in php 6.
Also @jadz0r or anyone does the fork https://github.com/jadz/laravel-framework-4.2.18-php7 work with both php 6 and php 7, or does those changes only work on php 7?
@jlrdw The fork will only work with PHP7.
I've been running it stable for over 2 months now.
We've used the following fork instead https://github.com/legierski/laravel-framework-4.2-php7.
Solving Laravel + Whoops PHP7 compatibility issues.
...
"require": {
...
"laravel/framework": "dev-4.2.19-php7"
...
}
...
"repositories": [
{
"type": "git",
"url": "https://github.com/legierski/laravel-framework-4.2-php7"
}
],
...
An update check out http://novaframework.com/php-framework It is very similar to laravel 4.2. Version 3 is stable, version 4 is in development.
Your app written on Laravel 4.2 may NOT be 100% compatible with PHP 7.0. We have an app that interfaces with a mobile device and authenticates using HMAC. I think it may have something to do with the differing key sizes and some negative(?) changes related to PHP packages related to encryption. Please note that I'm NOT saying that L4.2 by itself lacks full compatibility.
@jadz0r how do I handle dependencies by using your fork? I've tried switching to it, but when I run composer update I get this:
- Conclusion: don't install laravel/framework dev-master
- aws/aws-sdk-php-laravel 1.0.0 requires laravel/framework 4.0.* -> satisfiable by laravel/framework[4.0.x-dev].```
@brayanrastelli as of now there is actually a updated ver of laravel 4.2 out, 4.2.20 php 5.6 through php 7 compatible.
Nice, thanks!
article on Medium.com: Making Laravel 4.2 work with PHP 7.2
https://medium.com/@tomgrohl/making-laravel-4-2-work-with-php-7-2-e9149a9428c3
Please or to participate in this conversation.