I am deploying a laravel 5.5.12 app on WHM cpanel. As per laravel documentation (https://laravel.com/docs/5.5/installation#server-requirements) all the server requirements are okay: phpinfo(); results in following:
PHP >= 7.1.3
OpenSSL support enabled
PDO support enabled
Multibyte Support enabled (mbstring)
Tokenizer Support enabled
XML Support active
Ctype PHP Extension enabled
JSON PHP Extension enabled
i have done following steps (https://crescentke.com/uploading-laravel-5-to-cpanel-server/)
- uploaded laravel folder to /home/mylaravel (except public and node_modules)
- uploaded public folder contents to /home/public_html
- changed permission of storage, vendor and bootstrap/cache to 777.
changed following lines in /home/public_html/index.php
require DIR.'/../mylaravel/bootstrap/autoload.php';
$app = require_once DIR.'/../mylaravel/bootstrap/app.php';
changed following line in /home/mylaravel/server.php
require_once DIR.'/public_html/index.php';
create a database and added a user to it will full rights, this database, user name are updated in /home/mylaravel/.env file
- updated the .env file with live server URL
for storage folder link inside the public_html, created a php file inside pulic_html will following content and accessed it via URL to create the symlink
symlink('/home/gfree/go4ree/storage/app/public','/home/gfree/public_html/storage');
NOW at last when i visit the webpage it gives http 500 error. in log file following log is created:
[11-Jun-2018 11:37:57 UTC] PHP Parse error: syntax error, unexpected '?', expecting variable (T_VARIABLE) in /home/gfree/go4ree/vendor/symfony/finder/Comparator/NumberComparator.php on line 42
[11-Jun-2018 11:37:57 UTC] PHP Fatal error: Exception thrown without a stack frame in Unknown on line 0
whats (on earth) left to do?
public function __construct(?string $test)
yes, there is a ? on it but where it comes from? – mhk