Parse Error Syntax Error Unexpected T_class Expecting T_variable
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies parse error syntax error unexpected t_class expecting t_string or t_variable or '$' in laravel of this site About Us Learn more about Stack Overflow the company unexpected 'class' (t_class) laravel Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges
Symfony Parse Error: Syntax Error, Unexpected 'class' (t_class), Expecting Identifier (t_string)
Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a
Syntax Error, Unexpected 'class' (t_class) Laravel
minute: Sign up Laravel parse error: syntax error, unexpected T_CLASS, expecting T_STRING or T_VARIABLE up vote 9 down vote favorite 3 After installing laravel we get an error: Parse error: syntax error, unexpected T_CLASS, expecting T_STRING or T_VARIABLE or '$' in C:\xampp\htdocs\laravel\public\index.php on line 50 laravel-5 share|improve this question edited Aug 25 '15 at 14:26 Gigi 896 asked Aug 25 '15 at $kernel = $app->make(illuminate\contracts\http\kernel::class); 13:39 rajkishor saw 49112 Your PHP version? –idmean Aug 25 '15 at 13:43 add a comment| 2 Answers 2 active oldest votes up vote 21 down vote Laravel 5.1 uses the ::class property to get string representations of a fully qualified classname. The error you're seeing is caused by this line $kernel = $app->make(Illuminate\Contracts\Http\Kernel::class); This language feature has been introduced in PHP 5.5 which is a requirement of Laravel 5.1. Your installed PHP version is probably older than 5.5. Try to update your PHP binary. In case you are interested in why ::class is used, take a look at this answer share|improve this answer answered Aug 25 '15 at 13:58 lukasgeiter 52.9k786107 I am using php 5.6.0, but still i am getting Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in C:\wamp\www\laravelmaster\public\index.php on line 50 , i checked from cmd like php -v and using laravel 5.2 –151291 May 30 at 9:52 3 @151291 Your CLI version of php (the one you get with php -v) might be different from
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn
Laravel 5 Requirements
more about Stack Overflow the company Business Learn more about hiring developers or posting laravel 5.2 php version ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack laravel 5 php version Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Laravel parse error: syntax error, unexpected T_CLASS, expecting T_STRING up vote http://stackoverflow.com/questions/32205590/laravel-parse-error-syntax-error-unexpected-t-class-expecting-t-string-or-t-v 2 down vote favorite 1 I developed a laravel application back in August this year, and it was working fine then. I am trying to run that application now, and it returns this error: parse error: syntax error, unexpected T_CLASS, expecting T_STRING or T_VARIABLE or '{' or '$' in D:\bkonme\artisan line 31 And line 31 is like this: $kernel = $app->make(Illuminate\Contracts\Console\Kernel::class); My PHP version is 5.6.14 and I http://stackoverflow.com/questions/34020272/laravel-parse-error-syntax-error-unexpected-t-class-expecting-t-string am using XAMPP on windows platform. I have some idea of it happening because of some version conflict between laravel and PHP, but i don't know how to resolve that issue, any help? php laravel laravel-5 share|improve this question edited Dec 1 '15 at 12:34 Amarnasan 3,2891720 asked Dec 1 '15 at 12:17 Saani 422619 1 install a fresh piece of laravel and put ur controller, model etc there mybe will work not sure just idea. –Tariq Husain Dec 1 '15 at 12:20 can you show a bit more code before line 31? You probably have forgotten to close a tag or write a Semicolon ; –Lino Dec 1 '15 at 12:21 This is going to be a hell lot of work to do, i want some simple solution! –Saani Dec 1 '15 at 12:21 I don't see how this should be connected to some version. class is a reserved word in php. It cannot be used as valid identifier for some property or similar. –arkascha Dec 1 '15 at 12:21 2 Are you 100% sure you are running php 5.6? @arkascha available from 5.5 up: php.net/manual/en/… –Steve Dec 1 '15 at 12:24 | show
Apparel forum Discussions forum Forum record_voice_over Laracasts Podcast forum Laravel Podcast Forum Servers Put my Laravel site online lars64 — 1 https://laracasts.com/discuss/channels/servers/put-my-laravel-site-online?page=2 year ago I already did that but still not working. I already did that but still not working. Cancel Update Your Reply lars64 — 1 https://www.drupal.org/node/2731495 year ago I really don't understand it anymore. I've two domains and put exactly the same on it. One works the other one doesn't. This is syntax error the domain: http://www.leaseregistratie.nl. I've made sure that public is the main root. I didn't edit the index.php at all. And my host gives me the error: Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in /home/lnpo1q/public_html/public/index.php on line 50. I work with control unexpected 'class' (t_class) panel and have made the rood directory public_html/public with addon domains. I really don't understand it anymore. I've two domains and put exactly the same on it. One works the other one doesn't. This is the domain: http://www.leaseregistratie.nl. I've made sure that public is the main root. I didn't edit the index.php at all. And my host gives me the error: Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in /home/lnpo1q/public_html/public/index.php on line 50. I work with control panel and have made the rood directory public_html/public with addon domains. Cancel Update Your Reply TheNephilim — 1 year ago What PHP version is your host running? What PHP version is your host running? Cancel Update Your Reply lars64 — 1 year ago @bhulsman PHP-version 5.4.43 @bhulsman PHP-version 5.4.43 Cancel Update Your Reply check taijuten — 1 year ago Please check http://laravel.com/docs/5.1/installation#installation You need PHP 5.5.
that make connections all over the world. Join today Download & Extend Drupal Core Distributions Modules Themes Issues Why error? PHP Parse error: syntax error, unexpected 'CLASS' (T_CLASS), .... Closed (fixed)Project:Drupal coreVersion:8.1.1Component:php.modulePriority:NormalCategory:Support requestAssigned:UnassignedReporter:lilbebelCreated:May 23, 2016 - 17:31Updated:June 9, 2016 - 20:54 Log in or register to update this issue Jump to:Most recent comment Hello, I just uploaded my D8 website, imported the database and added my database/user names and passwords to the settings.php file. When I go to view my site, I get a WSOD. When I go to http://xx.xx.xxx.xxx/mysite/error_log, I get the following message: [23-May-2016 11:14:15 America/Denver] PHP Parse error: syntax error, unexpected 'CLASS' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in /home2/mywebsite/public_html/core/lib/Drupal/Core/Extension/ModuleInstaller.php on line 221 I spoke with my server provider who are used to hosting Drupal websites and they said there is a problem with D8 core. How can I fix this please? I have a client who needs this to go live soon but I am not comfortable hacking the core. The local version is working just fine and throwing no errors. Thank you in advance for any help. M Comments Comment #1 May 23, 2016 at 5:31pm lilbebel created an issue. See original summary. Log in or register to post comments Comment #2 bojanz CreditAttribution: bojanz at Commerce Guys commented May 23, 2016 at 5:51pm Category: Bug report » Support request Status: Active » Fixed Your server doesn't satisfy Drupal's requirements. D8 requires PHP 5.5 or newer, your server has an older version. Log in or register to post comments Comment #3 lilbebel CreditAttribution: lilbebel commented May 23, 2016 at 6:10pm Thank you Bojanz. Log in or register to post comments Comment #4 lilbebel CreditAttribution: lilbebel commented May 23, 2016 at 6:30pm Hello, I updated the php version on the server to: PHP 5.6 [Beta, check site functionality for compatibility after enabling] All files with the extension .php will be handled by the PHP 5.6 engine. Latest version of PHP. There was no option for version 5.5 Now, there are the following errors on errors_log page: [23-May-2016 11:13:04 America/Denver] PHP Parse error: syntax error, unexpected 'CLASS' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in /home2/adaptjb7/public_html/core/lib/Drupal/Core/Extension/ModuleInstaller.php on line 221 [23-May-2016 11:13:50 America/Denver] PHP Parse error: syntax error, unexpected 'CLASS' (T_CLASS), expecting identifier