I tried to deploy laravel 5.6 using PHP deployer. The site got deployed successfully. But I see the below error while trying to access the website,
Parse error: syntax error, unexpected '?', expecting variable (T_VARIABLE) in /mnt/data/sites/laravel_deployer/releases/5/vendor/symfony/http-foundation/Request.php on line 1587
Php info page shows, the site is running with PHP 7.0.27
whereas the default PHP version in the deployment server is 7.1.
[surendar.m@testmachine current]$ php -v
PHP 7.1.17 (cli) (built: May 10 2018 17:38:04) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
I have the following doubts,
- Why the deployed site is not using the system default PHP version?
- Is this because of the PHP version mismatch I'm getting the parse error while trying to access the website?
My composer version is 1.9.1
Composer.json file is as follows,
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": "^7.1.3",
"fideloper/proxy": "^4.0",
"laravel/framework": "5.6.*",
"laravel/tinker": "^1.0"
},
"require-dev": {
"filp/whoops": "^2.0",
"fzaninotto/faker": "^1.4",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^2.0",
"phpunit/phpunit": "^7.0"
},
"autoload": {
"classmap": [
"database/seeds",
"database/factories"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"extra": {
"laravel": {
"dont-discover": [
]
}
},
"scripts": {
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"@php artisan key:generate"
],
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover"
]
},
"config": {
"preferred-install": "dist",
"sort-packages": true,
"optimize-autoloader": true
},
"minimum-stability": "dev",
"prefer-stable": true
}
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire