# Parse error: syntax error, unexpected 'class' (T\_CLASS), expecting identifier (T\_STRING) or variable (T\_VARIABLE) or '{' or '$' in

**URL:** <https://discourse.slimframework.com/t/parse-error-syntax-error-unexpected-class-t-class-expecting-identifier-t-string-or-variable-t-variable-or-or-in/646>\
**Category:** Questions\
**Created:** [August 22, 2016, 4:41pm UTC](https://discourse.slimframework.com/t/parse-error-syntax-error-unexpected-class-t-class-expecting-identifier-t-string-or-variable-t-variable-or-or-in/646 "2016-08-22T16:41:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![simonshaw](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.slimframework.com/simonshaw/32/197_2.png) [@simonshaw](https://discourse.slimframework.com/u/simonshaw)\
**Post date:** [August 22, 2016, 4:41pm UTC](https://discourse.slimframework.com/t/parse-error-syntax-error-unexpected-class-t-class-expecting-identifier-t-string-or-variable-t-variable-or-or-in/646/1 "2016-08-22T16:41:48Z")

</div>

I am receiving the following error, but have no idea how to fix it:

arse error: syntax error, unexpected ‘class’ (T\_CLASS), expecting identifier (T\_STRING) or variable (T\_VARIABLE) or ‘{’ or ‘$’ in

---

<div class="post-metadata">

**Author:** ![geggleto](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.slimframework.com/geggleto/32/11_2.png) [@geggleto](https://discourse.slimframework.com/u/geggleto)\
**Post date:** [August 22, 2016, 4:47pm UTC](https://discourse.slimframework.com/t/parse-error-syntax-error-unexpected-class-t-class-expecting-identifier-t-string-or-variable-t-variable-or-or-in/646/2 "2016-08-22T16:47:24Z")

</div>

please post your code with your syntax error.

---

<div class="post-metadata">

**Author:** ![simonshaw](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.slimframework.com/simonshaw/32/197_2.png) [@simonshaw](https://discourse.slimframework.com/u/simonshaw)\
**Post date:** [August 22, 2016, 4:54pm UTC](https://discourse.slimframework.com/t/parse-error-syntax-error-unexpected-class-t-class-expecting-identifier-t-string-or-variable-t-variable-or-or-in/646/3 "2016-08-22T16:54:29Z")

</div>

not sure,what code is causing it… it works fine on localhost using `php -S 0.0.0.0:8080`, but when I deploy to my microsoft sever with IIS 7 I get the error -

```auto
use \Psr\Http\Message\ServerRequestInterface as Request;
use \Psr\Http\Message\ResponseInterface as Response;

require '../vendor/autoload.php';

$config['displayErrorDetails'] = true;
$config['addContentLengthHeader'] = false;

$app = new \Slim\App(["settings" => $config]);

```

my web.config file loos like this:

```auto
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
    	<httpProtocol>
            <customHeaders>
                <add name="Access-Control-Allow-Origin" value="*" />
                <add name="Access-Control-Allow-Headers" value="Content-Type,Request-Method,Authorization" />
                <add name="Access-Control-Allow-Methods" value="GET, POST, PUT, DELETE, OPTIONS, PATCH" />
            </customHeaders>
        </httpProtocol>
		<rewrite>
            <rules>
                <rule name="slim" patternSyntax="Wildcard">
                    <match url="*" />
                    <conditions>
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                    </conditions>
                    <action type="Rewrite" url="index.php" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

```

---

<div class="post-metadata">

**Author:** ![geggleto](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.slimframework.com/geggleto/32/11_2.png) [@geggleto](https://discourse.slimframework.com/u/geggleto)\
**Post date:** [August 22, 2016, 5:11pm UTC](https://discourse.slimframework.com/t/parse-error-syntax-error-unexpected-class-t-class-expecting-identifier-t-string-or-variable-t-variable-or-or-in/646/4 "2016-08-22T17:11:39Z")

</div>

You likely dont have the proper PHP version installed on your IIS envrionment.

Please double check that it’s above 5.5+

---

<div class="post-metadata">

**Author:** ![simonshaw](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.slimframework.com/simonshaw/32/197_2.png) [@simonshaw](https://discourse.slimframework.com/u/simonshaw)\
**Post date:** [August 22, 2016, 5:13pm UTC](https://discourse.slimframework.com/t/parse-error-syntax-error-unexpected-class-t-class-expecting-identifier-t-string-or-variable-t-variable-or-or-in/646/5 "2016-08-22T17:13:50Z")

</div>

that was it, thanks!!!
