Version:
- OS
lsb_release -a
: Ubuntu 20.04.2 LTS - PHP Intelephense: 1.6.2
- PHP
php -v
: 8.0.1 - Laravel: 8.25
Error:
Getting
Unexpected 'Unknown'
,';' expected.
,'VariableName' expected.
error.
These kind of lines are causing error
namespace App\Http\Controllers; //Unexpected 'Unknown' and ';' expected Error
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Auth;
Here, Screenshot of my error:
Tried
I've have added PHP executable path VS Code article. But still not working
settings.json
{
"php.validate.executablePath": "/usr/bin/php"
}
$ whereis php
php: /usr/bin/php8.0 /usr/bin/php.default /usr/bin/php /usr/lib/php
/etc/php /usr/share/php8.0-mysql /usr/share/php8.0-readline
/usr/share/php8.0-common /usr/share/php8.0-zip /usr/share/php8.0-xml
/usr/share/php8.0-bz2 /usr/share/php /usr/share/php7.1-common
/usr/share/php8.0-opcache /usr/share/php8.0-mbstring /usr/share/php8.0-gd
/usr/share/php7.1-mcrypt /usr/share/php8.0-curl /opt/lampp/bin/php
/usr/share/man/man1/php.1.gz
$ which php
/usr/bin/php
settings.json
{
"php.validate.executablePath": "usr\\bin\\php"
}
Giving me following message
Cannot validate since usr\bin\php is not a valid php executable. Use the setting 'php.validate.executablePath' to configure the PHP executable.
Thanks.