phplaravellaravel-artisanclear-cache

Laravel 5.7 - Unable to run php artisan commands when shifted project to live


I'm new to laravel, My commands of PHP artisan were working fine in localhost. When i shifted my project to live server the commands stopped working and gives me following error:

Warning: require(): Invalid date.timezone value 'GST', we selected the timezone 'UTC' for now. (I fixed this by defining my timezone) Parse error: syntax error, unexpected '?' laravel/framework/src/Illuminate/Foundation/helpers.php on line 500

There are actually no errors the project is working fine,My PHP version is 7.2.10. I'm inside the directory where PHP artisan is installed but of no use. I hope I have to clear the cache but how can I clear cache when my artisan commands are not working? Any ideas?


Solution

  • try to change version in apache

    find total install version in server

    sudo update-alternatives --config php
    

    then select one version then check php version again.

    sudo php -v
    

    second way u can do by this command

    sudo a2dismod php5.6   //disable old version 
    sudo a2enmod php7.2    //enable new version
    

    and restart apache2 server

    sudo service apache2 restart 
    

    and check php version

    sudo php -v
    

    for more better understanding see