0

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

Qirel
  • 25,449
  • 7
  • 45
  • 62
  • 1
    Can you post code where error has occurred? – Lovepreet Singh Aug 23 '18 at 09:07
  • What happened in /storage/framework/views/c3777xxxx.php line 19. Open it and show it here. – Sang Nguyen Aug 23 '18 at 09:08
  • 1
    Possible duplicate of [PHP parse/syntax errors; and how to solve them?](https://stackoverflow.com/questions/18050071/php-parse-syntax-errors-and-how-to-solve-them) – Qirel Aug 23 '18 at 09:12
  • @LovepreetSingh Actually I am creating website and I have done with it now. Till now I run project through artisan command but now i want to run project after hitting localhost/project_name and it should be run . Website is static – Hitendra Patil Aug 23 '18 at 09:16
  • It is minor syntax error in php. You should check code on the line which causing issue or post that line here. – Lovepreet Singh Aug 23 '18 at 09:18
  • In 95 pct of cases semicolon has been forgotten in line before. – Tpojka Aug 23 '18 at 09:33
  • Thanks Guys for helping me....working fine now , problem comes when this line is find in code . I don't know why it is happening , but other hand I problem is SALVED – Hitendra Patil Aug 24 '18 at 06:34

1 Answers1

0

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>

Bedram Tamang
  • 3,748
  • 31
  • 27