Parse Error Syntax Error Unexpected T_class Expecting T_string
Contents |
Local Community Meetups Laravel.io Site and Community Forum Installation Laravel 5 Error on Installation. I'm trying to create a new Laravel project via "laravel new project_name" however it stays on crafting the parse error syntax error unexpected t_class expecting t_string or t_variable or '$' in laravel application for a minute or two and then it shows this error: Crafting application... unexpected 'class' (t_class) laravel Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T _STRING) or variable (T_VARIABLE) or '{' or '$' in I:\PP\artisan on
Symfony Parse Error: Syntax Error, Unexpected 'class' (t_class), Expecting Identifier (t_string)
line 31 Script php artisan clear-compiled handling the post-install-cmd event returned w ith an error [RuntimeException] Error Output: run-script [--dev] [--no-dev] [-l|--list] [script] [args1] ... [argsN] Application ready! Build something amazing. Furthermore, when I go
Syntax Error, Unexpected 'class' (t_class) Laravel
to check the installation in my web browser I'm thrown this error: Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in I:\PP\public\index.php on line 50 Is anyone else facing this error? I've updated my Composer installation as well as the installer for Laravel. xxyxxyz 1 year ago harikt 1 year ago What version of PHP are you using ? xxyxxyz 1 parse error syntax error unexpected 'class' (t_class) laravel year ago harikt said: What version of PHP are you using ? PHP version is 5.4.16. kayyyy 1 year ago Solution xxyxxyz said: harikt said: What version of PHP are you using ? PHP version is 5.4.16. Installation Server Requirements The Laravel framework has a few system requirements. Of course, all of these requirements are satisfied by the Laravel Homestead virtual machine: PHP >= 5.5.9 OpenSSL PHP Extension Mbstring PHP Extension Tokenizer PHP Extension xxyxxyz 1 year ago chris said: xxyxxyz said: harikt said: What version of PHP are you using ? PHP version is 5.4.16. Installation Server Requirements The Laravel framework has a few system requirements. Of course, all of these requirements are satisfied by the Laravel Homestead virtual machine: PHP >= 5.5.9 OpenSSL PHP Extension Mbstring PHP Extension Tokenizer PHP Extension I see. Thanks, was this changed recently as I had no problems beforehand when making a new Laravel project. tkprocat 1 year ago Yep, it was changed 12 days ago, see https://github.com/laravel/framework/commit/8349040e7381d083868fa40bd7dcaf301f0347e3 dhavalv 5 months ago It's same problem on PHP V5.6.15 PHP Parse error: syntax error, unexpected T_CLASS, expecting T_STRING or T_VARIABLE or '$' in /opt/lampp/htdocs/laravel_demo/artisan on line 31 ggwebdev 4 months ago I have same problem, check your php version run on
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 more about Stack Overflow
$kernel = $app->make(illuminate\contracts\http\kernel::class);
the company Business Learn more about hiring developers or posting ads with us Stack Overflow laravel 5 requirements Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 laravel 5.2 php version 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 2 down vote favorite 1 I developed a http://laravel.io/forum/06-10-2015-laravel-5-error-on-installation 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 am using XAMPP on windows platform. I have some idea of it http://stackoverflow.com/questions/34020272/laravel-parse-error-syntax-error-unexpected-t-class-expecting-t-string 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 5 more comments 1 Answer 1 active oldest votes up vote 2 down vote accepted Even if you have PHP/5.6.14 installed, your app is
Apparel forum Discussions forum Forum record_voice_over Laracasts Podcast forum Laravel Podcast Forum Servers Put my Laravel site online lars64 — 1 year ago I already did that but still not working. I already did that but https://laracasts.com/discuss/channels/servers/put-my-laravel-site-online?page=2 still not working. Cancel Update Your Reply lars64 — 1 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 https://www.drupal.org/node/2474941 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, 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. 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 unexpected 'class' (t_class) 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.9 Please check http://laravel.com/docs/5.1/installation#installation You need PHP 5.5.9 Cancel Update Your Reply lars64 — 1 year ago @taijuten thanks for that! I assumed that both domains had the php same version. But obviously not,.... @taijuten thanks for that! I assumed that both domains had the php same version. But obviously not,.... Cancel Update Your Reply « 12 » Sign in or create a forum account to participate in this discussion. Plenty of educational sites will teach you how to make a website. But what about those of us who already do
that make connections all over the world. Join today Download & Extend Drupal Core Distributions Modules Themes Drupal driver for SQL Server and SQL AzureIssues Boost minimum required PHP version and Closed (fixed)Project:Drupal driver for SQL Server and SQL AzureVersion:7.x-2.x-devComponent:DocumentationPriority:MajorCategory:Feature requestAssigned:UnassignedReporter:gabriel.achilleCreated:April 21, 2015 - 03:59Updated:June 5, 2015 - 15:29 Log in or register to update this issue Jump to:Most recent comment Most recent attachment Problem/Motivation The driver is not compatible anymore with PHP 5.3. Not only that, but both the wincache extension and the sql server pdo extensions are deprecated on PHP 5.3, so it makes no sense to support 5.3. Proposed resolution Boost requirements in module.info file. Original report PHP<5.4: Parse error: syntax error, unexpected '[' After updating the module to the latest dev, i have the following error in a white screen for all pages.Parse error: syntax error, unexpected '[' in ...\sites\all\modules\contrib\sqlsrv\sqlsrv.install on line 10 The line 10 is initializing an array with the short array syntax: $_data = []; which is available only in PHP>=5.4. I'm using PHP 5.3. Can we change to the normal syntax array: $_data = array(); to make the module compatible with older php version or explicitly say that the module requires PHP 5.4 ?... (or should i update my PHP :( )Files: CommentFileSizeAuthor #15 2474941_12.patch3.71 KBdavid_garcia #12 2474941_12.patch1.91 KBcosmicdreams 3 more files CommentFileSizeAuthor #9 2474941_9.patch473 bytescosmicdreams #2 sqlsrv-syntax-error-2474941-2.patch993 bytesgabriel.achille #1 sqlsrv-syntax-error-2474941-1.patch385 bytesgabriel.achille Comments Comment #1 gabriel.achille CreditAttribution: gabriel.achille commented April 21, 2015 at 4:05am FileSize sqlsrv-syntax-error-2474941-1.patch385 bytes And here is a proposal of patch to make it compatible with PHP < 5.4 (ie using traditional syntax array) Log in or register to post comments Comment #2 gabriel.achille CreditAttribution: gabriel.achille commented April 22, 2015 at 5:34am FileSize sqlsrv-syntax-error-2474941-2.patch993 bytes in the