尝试像localhost / project_name / public一样运行时,语法错误,laravel中的意外“版本”(T_STRING)

syntax error, unexpected 'version' (T_STRING)

in laravel when try to run like localhost/project_name/public

And same project running throught php artisan serve cmd . So I was not able to understand why this is happening .

Click Here to see the actual error

Set Php tag short_open 0 or Off either in php.ini or .htaccess

For .htaccess add the following line

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews -Indexes
    </IfModule>
    php_value short_open_tag 0
    RewriteEngine On

    RewriteCond %{HTTPS} !=on
    RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} (.+)/$
    RewriteRule ^ %1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>