I have installed Laravel 5.5 and I'm getting the same error, documentation says this:
PHP >= 7.0.0
OpenSSL PHP Extension
PDO PHP Extension
Mbstring PHP Extension
Tokenizer PHP Extension
XML PHP Extension
I ran:
$ php artisan --version`
$ Laravel Framework 5.5.42
and I'm getting this error:
Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_PARSE)
Parse error: syntax error, unexpected '?', expecting variable (T_VARIABLE)
Is the documentation wrong? I'm using: https://laravel.com/docs/5.5/installation#installing-laravel
My server can only use PHP 7.0. Not 7.1. Is there no way to run Laravel on 7 anymore?
I'm installing via composer.
Is there a way to download a compatible version with 7.0?
If you have PHP 5.5 (actually 5.5.9 or greater) you should use Laravel 5.2.
If you have PHP 7.0 you can use Laravel 5.5.
The error you mentioned is because you are using PHP 5.5 which does not support PHP 7 Null coalescing operator (??) and it is being used somewhere in Laravel code.
As you said your server supports PHP 7.0, you might have more than one PHP versions installed on your system. Check PHP version running php --version.
The issue could be that the command line version of PHP differs to the Apache version of PHP. Run php --version and verify that you're using PHP 7.0.0 or greater.
Laravel 5.5.* has no issues running on PHP 7.0.*. I currently have a project running Laravel 5.5.43 on PHP 7.0.15 and this issue does not occur.
If the command line version of PHP is not up to date or if you have access to multiple versions of PHP, you should contact your hosting provider for help. You may also be able to run a command similar to the following to see if you can access a different version of PHP:
locate bin/php
The above may give you an idea of the installation location. For example, I see three different versions of PHP installed, but the default version (/usr/bin/php) is 7.0.15:
/opt/cpanel/ea-php56/root/usr/bin/php
/opt/cpanel/ea-php70/root/usr/bin/php
/opt/cpanel/ea-php71/root/usr/bin/php
/usr/bin/php
It was an issue with the Symfony Translation stack, i had to disable for the moment, also i have downgraded the carbon package to make it work, not sure why. It has some php7.1 code.
Related
I upload my laravel project on azure. However when I go to the link I got this error. My project php version is 8.0.0 and my azure php version is 7.4.11. How can I can increase the version on my azure php.
If you are deploying your application, you need to update your php version to php version 8
I have the same problem and now it already solve.
Check PHP version commend # php --version
If your PHP 7.4 you need to commend in your laravel project # composer update
If you php >=8.0.0 you need to install php 7.4 and commend in your laravel project # composer update
Simply go to vendor/composer/ , then you will find platform_check.php file. Just open it and comment full code. Save it. That's it. You can now use it with lower php verson.
I can't install Jetstream to my Laravel project. When I use the command composer require laravel / jetstream, it will generate the following error:
[InvalidArgumentException]
The laravel / jetstream package has a PHP requirement incompatible with your PHP version, PHP
extensions and
Composer version
My PHP version is 7.2.24, and my Composer version is 2.0.8.
Laravel Jetstream requires PHP version to be minimum 7.3 so you need to upgrade your PHP version to a minimum of 7.3. It would be better if you upgrade it to PHP 7.4 at least. As PHP 7.3 is now EOL - meaning no active support for PHP 7.3, only security fixes for one more year.
https://www.php.net/supported-versions.php
Laravel Jetstream also requires ext-json to be enabled for PHP. So depending upon your PHP version i.e. 7.3.x or 7.4.x or 8.x you need to install ext-json as well - php7.3-json or php7.4-json or php8.0-json
I was having the exact same problem I just upgraded the version of my PHP 7.3 or above and you should also have laravel version 8 to use jetstream. So for upgrading the PHP version in xampp you can refer to this question.
Upgrading PHP in XAMPP for Windows?
I'm using Laravel 5.0 and homestead 0.4.0 wich is shipped with php 7,
so when I use php artisan tinker I get this error:
error
How can I fix this or should I downgrade my php version and if so wouldn't be any conflict with composer or any other tool in my homestead or laravel?
It seems that one of the libraries your application is using - PhpParser - is not compatible with PHP7. It defines a class called String which is a reserved keyword in version 7.
You need to either downgrade to PHP5 or check if it's possible to upgrade your dependencies so that used PhpParser library is compatible with PHP7. Version 2.x of PhpParser should be compatible.
If you're including the package directly in your composer.json try to upgrade version there.
If not, you can see which of your dependencies requires PhpParser by calling
composer depends nikic/php-parser
See if you are able to upgrade versions of packages it lists.
I solved my problem by installing an older version of homestead v0.3.3 wich is shipped with php 5.6 so here is all you need to download it:
$vagrant box add laravel/homestead --box-version 0.3.3
and then download an older version of Homestead installer from git, I'm using v2.1.8 it works fine:
Installed Laravel Framework and getting Error when I install artisian with the below (php artisan migrate:install)
My PHP version is [PHP: 5.5.11]
Parse error: syntax error, unexpected '[' in E:\xampp\htdocs\laravel-testing\vendor\laravel\framework\src\Illuminate\Support\helpers.php on line 426
E:\xampp\htdocs>cd laravel-testing
E:\xampp\htdocs\laravel-testing>php artisan migrate:install
Parse error: **syntax error, unexpected '['** in E:\xampp\htdocs\laravel-testing\vendor\laravel\framework\src\Illuminate\Support\helpers.php on line 426
What may be the problem ?
I would suggest to remove older version of your php and set latest version in environment variable. Secondly I would recommend to read this article. It's definitely going to help you understand migration.
Make sure you have composer installed in the VM (Vagrant) if you are not using homestead (laravel specific vagrant dist)
I was getting the same error. Wondering why the PHP version would matter if the VM was using a single and correct PHP dist.
https://getcomposer.org/download/
I have tried to install the udropship extension to my local server.Following error occurs
Fatal error: The file
F:\xampp\htdocs\xxxx\app\code\community\Unirgy\DropshipMicrosite\Helper\Protected.php
was encoded by the ionCube Encoder for PHP 5 and cannot run under PHP
5.5 or PHP 5.6. Please ask the provider of the script to provide a version encoded with the ionCube Encoder for either PHP 5.3 or PHP 5.4
or PHP 5.5. in Unknown on line 0
I have updated the latest version of Ioncube Loader although same error occurs repeatedly.Below the screenshot of loader installed successfully.
Can any one help? I couldn't figure out what is going on.
The message from the Loader is surely very precise:
[your file] cannot run under PHP 5.5 or PHP 5.6. Please ask the
provider of the script to provide a version encoded with the ionCube
Encoder for either PHP 5.3 or PHP 5.4 or PHP 5.5.
So, you should... "ask the provider of the script to provide a version encoded with the ionCube Encoder for either PHP 5.3 or PHP 5.4 or PHP 5.5."
There is further an alternative that while unstated, logically follows from the statement that your file "cannot run under PHP 5.5 or PHP 5.6", which is NOT to use PHP 5.5 or 5.6, i.e. use PHP 5.4 instead.