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'))
Related
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
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
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?
I'm trying to install zend-escaper but I'm getting this error:
This is strange as my PHP version (from phpinfo()) is 5.5.19, the message claims it is 5.3.5(!) which should satisfy the requirement anyway.
My ZF version is 1.12.13
I'm using PHP Storm
Can anyone help please?
Thanks
Tomasz
The PHP version on the command line can be a different executable than the PHP running inside the web server. It also can use a different pho.ini configuration file.
So if Composer states the PHP it is using is 5.3.5, this is correct because Composer is directly asking the PHP it is running on for its version. The problem is when this PHP version on the command line is way older then the PHP version in the web server.
Try to update your command line PHP.
Some more things to say: the version 5.3.5 is lower than the required 5.3.23, because the last number in the version is 5 compared with 23, and 5 is less than 23. So the version you are using is below the minimum requirement for zend escaper - at least in the version 2.5.1 you try to use. Such an old PHP was last supported in the 2.2 framework versions, so you might as well try to depend on ~2.2. However this will simply be a workaround for the old cli version.
One other note: You are in the process of installing a zend framework 2 component - don't expect your installed zend framework 1 to support any fancy stuff on its own. It is possible to mix classes with namespaces and without, and even use zf2 things together with zf1, but zf1 won't offer any automatic functionality to use these.
Is the latest Symfony version (1.14.18) supposed to run properly with PHP 5.4?
I've just upgraded to PHP 5.4 locally and multiple sites that have previously worked fine are now throwing the following error when trying to load any page:
Fatal error: Call to undefined method sfCoreAutoload::register() in C:\dev\projects\my_site\config\ProjectConfiguration.class.php on line 4
The path to the sfCoreAutoload class is fine but for some reason it treats it as if it didn't exist at all.
I managed to resolve the issue so will just answer here for the benefit of anyone else facing the same. The culprit was APC. The latest "stable" version of the pre-compiled APC (3.1.9) didn't work with Symfony 1.4.18 + PHP 5.4.4, but using the APC beta (3.1.12) does work.