This error is driving me crazy.
I had Laravel 5.2, then I upgraded to 5.3 and then 5.4 then this error started to appear.
I have searched everywhere on Google and here in SO but none of the solutions is working on my case. Any idea what to do?
I did have a look that the package you provided. Their last commit was in October 2016. So I can say, this does not support Laravel 5.4 yet.
The latest version you can use this package in is Laravel 5.3. Open an issue for the package manager to add support for Laravel 5.4.
I installed it in a clean Laravel 5.4 project and it didnt work as well, though I received a different error. You said it works in 5.3, so I think it's just a matter of version support.
Related
I have a Laravel application that has been running since mid 2018. PHP is currently version 7.2.5 and Laravel is 5.6.22. I need to upgrade PHP to either 7.4 or 8.0, and Laravel to either 6 LTS, or 8.
As far as I can see, I have two options:
Upgrade PHP to the new version, then incrementally upgrade Laravel from 5.6.22 to 6 LTS (or 8), testing each version as I go; or
Upgrade both PHP and Laravel to their new versions, and do one round of testing
My initial thought was to use method 1, reading the Laravel notes for each release and tailoring my testing efforts as I go. But upon upgrading PHP to 7.4, Laravel started to fail somewhere deep in the library, so I guess V 5.6.22 does not work with PHP 7.4
Is there a standard approach to this problem? (Note that, sadly, I don't have automated unit tests).
This happened to me when I started working with Laravel, I started with Laravel 5.3 and my team had to upgrade it to 5.4, 5.5, 5.6 and 5.7 (then I left haha).
What we ended up doing was:
First upgrade PHP, as it is the mostly certain that it will not cause any issue. I recommend you to upgrade to 8.0
What we had done to upgrade was having tests. Previously we did not have, so we learn how to test and we reach a coverage of 90%, so we were extremely good at it and advancing fast on it.
Once you have the tests, you can start migrating version by version. Because you are on 5.6, you could directly upgrade to 6 or 8, so you can follow the guide to upgrade from 5.8 to 6 or 7 to 8. It is easy to upgrade, the important stuff is related to packages mostly.
These are the tips and personal experience I can share with you. It is 100% important to have tests, else it will be a pain for you as you will not be 100% sure if something broke.
I inherited a Laravel app that works fine but it's really old version (5.2.45).
What's the best way to upgrade this to something supportable? This Laravel version is incompatible with PHP 7.3 so I am stuck using an old PHP 7.0 version that is deprecated and a security risk.
Is Laravel 7.0 my best bet or should I upgrade to a different version?
PS: I'm noob on PHP, so please be as detailed as possible.
To answer my own question, I have to upgrade gradually from 5.2 > 5.3 > ... > 7 and fix all incompatibilities manually. Laravel shift can help but it won't fix everything and on every iteration there is work involved.
I am facing a problem with my hosting server where php 5.6 has been installed which can't be upgrade to php 7. But my project has been completed in laravel 5.5 which need php 7 to run. Is there any solution to switch laravel 5.5 to laravel 5.4
In fact there is no easy way to do that. If application is using Laravel 5.5 features some parts of it won't work and you might waste a lot of time to finding and fixing those issues.
In my opinion much cheaper way would be changing hosting and in fact it would me more reasonable to use PHP 7.x than 5.6 in 2017/2018. If you look at PHP versions you will see, that for 5.6 only security fixes are applied at the moment
good day! Just a quick question about laravel since we are planning to use laravel on our new project, the problem is the client is using php 5.3.3 on their server. I know that laravel works on php 7 but the question is will it still work on php 5.3.3? Thank you in advance.
Looking at the oldest version available in the documentation located at https://laravel.com/docs/4.2/#server-requirements
It states
PHP >= 5.4
So I would say No.
This is due to found security risks in various versions of PHP so Laravel has a baseline for PHP.
If you can use Docker, you can use a PHP7 Docker container with the latest stable version of Laravel, and then you will not touch the PHP 5.3 version
Can I run CakePHP 1.3 with PHP7? I have to do a migration to PHP7, but in the hosting there is a project in CakePHP 1.3 and need to know if there is any risk if I run this project in this version of PHP.
Unfortunately CakePHP 1.3 is not really compatible with PHP7 out of the box. I work on a old project in CakePHP 1.3 and my system upgraded to PHP7. There are a lot of these in the core of CakePHP 1.3
After changing these, I ran into the next batch of errors, after which I rolled back and postponed the upgrade.
So to answer the question, it would be rather risky upgrading to PHP7 if there is a CakePHP 1.3 project.
If you are still looking for a CakePHP 1.3 port to PHP7, you are in luck!
I've ported CakePHP 1.3.21 to PHP 7.3, you can check it out on GitHub.
Please pay attention to the readme, as it naturally requires changes to your own code as well!
I had to migrate a CakePHP 1.3 project to PHP7 and the only thing I did was find the "String" class and using PhpStorm's rename all occurrences feature I renamed it to "String_Renamed" that fixed the errors and everything worked afterwards. I've had no issues since.