Old Laravel and new PHP have different formats of errors, and because of that I can't properly launch my Laravel 4.2 application, because I get:
Argument 1 passed to Illuminate\Exception\WhoopsDisplayer::display()
must be an instance of Exception, instance of Error given
I've searched for solution but was not able to find anything. How can be this situation solved? Should I try installing PHP 5 alongside with PHP 7? Or a Virtual Machine with PHP 5, and run my app in it? Or change something in bootstrap/compiled.php, where these errors get caught?
Related
a few weeks back I setup PHP 8 but hit some issues in projects so reverted back to 7.4.
However, a few of my projects are broken and the errors I'm getting all seem linked to PHP 8.
An example is "Fatal error: Uncaught ArgumentCountError: array_merge()"
This is on a WordPress project that even with default theme and database from production is still throwing this issue when it wasn't before.
Running which php and php -v are both stating 7.4 as the PHP version.
Just checked and the phpinfo() page is still PHP 8.
Anything else I need to that might be causing this drama? I'm using Laravel Valet...
Might be useful to someone...
Turns out that Laravel Valet was caching it's .sock file...
rm ~/.config/valet/valet.sock
valet start
Did the job for me.
I am working on the application which is built on the laravel 5.4 framework. I have installed the latest version of PHP. which is
PHP Version 7.4.5
Actually I would like to know does PHP 7.4.5 supports laravel 5.4 app if no then why? and how can I downgrade the PHP version?
Also I am getting the error in php logs files ( [2020-05-15 12:37:08] local.ERROR:
ErrorException: Trying to access array offset on value of type null in
C:\xampp\htdocs\carehalo_mini\app\Helpers.php:392 )
Also, you can check out the code in the given screenshot Helpers.php:392 lines
app\Helpers.php this sounds like something part of the app you have and not related to Laravel. My best guess is that Laravel won't have any problems running on 7.4, but the same does not apply for the code written in the app. And of course, best thing to do would be to upgrade your Laravel version to at least 6 regardless of working or not.
You can fix your Error by changing line 392 to:
if(empty($admin) || ($admin->token != Session::get('token'))
I was trying to setup a Laravel project in a server which I don't have ssh access, just cPanel access, so I came in with the problem that it seems that the server is not recognizing the right PHP version, Laravel's version I was trying to setup is 5.5. phpinfo() outputs version 7.0.22.
Inside cPanel there's a module called "PHP configuration" and it is set to version 7.
How can I solve this problem, I really want to use Laravel 5.5 or above, it is worth mentioning that I don't have contact with the server owner, I'm limited just to cPanel.
It is throwing the following error:
Parse error: syntax error, unexpected '?', expecting variable in /vendor/symfony/translation/Translator.php line 79
which is
public function __construct(?string $locale, ...
That is how I know it is not recognizing the right php version.
EDIT:
Just to clear out, I just thought that was the problem because I have had already that issue sometime in the past and read similar posts, but if that's not the case, I would appreciate that to be pointed out and not just silly jokes like "a bird flew", maybe other people are in the same problem and think of the same reason and this question could be useful to them.
So it turned out that the server's PHP version had nothing to do with the problem, the thing was, since I had no access to SSH, I had to install Laravel in my local computer, then copy all the files and put them inside the server, but my computer had PHP 7.1 and although Laravel's version was really version 5.5, some features of PHP 7.1 were applied on that Laravel installation.
So the solution was just to install Laravel 5.5 within a PHP 7.0.* installation in order to make it work in a server with PHP 7.0.22
Related GitHub issue ~ https://github.com/laravel/framework/issues/23559
Using Laradock (basically a set og Docker images for Laravel development), I keep getting Class 'MongoId' not found FatalThrowableError errors when calling new \MongoId( $id ) in PHP.
This post Class 'MongoId' not found (Zend Framework with MongoDB Doctrine) suggests that the reason for given error is that the PHP Mongo extension isn't enabled.
However, if I look at the phpinfo() output, I can see mongodb section. Doesn't that mean it's enabled?
What else could possibly cause this error?
I assume that you are using php 7 version.
In php 7 version a new MongoDB extension is used.
So instead of legacy MongoId you should use MongoDB\BSON\ObjectID
i deploy a symfony 1.4 project on a RHEL 6 Server with PHP 5.3.3.
On a irregular basis I get entries in the php error log complaining that sfProjectConfiguration could not be found and the request fails. The same request then runs smoothly the next time.
There is no memcache or apc installed.
On other machines it works flawless.
Any ideas how to solve or investigate the problem?
Sometimes i have an fimiliar error in frontend/backend_dev. Does the error occur when you use on of them? It happens to me when I "hammer" the F5-Button. Could be a cache-rebuilding problem.