Wamp内部的Laravel 4无法正常工作 [英] Laravel 4 inside Wamp does not work

查看:82
本文介绍了Wamp内部的Laravel 4无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的项目中使用Laravel,但是遇到了一个问题. 也就是说,我已经在使用WAMP服务器作为本地服务器...我按照说明在WAMP中安装Laravel ...所以我先启用了openSSL,然后下载了Composer,然后在CMD中尝试了composer命令,到目前为止一切都还不错...然后创建了项目... Composer已经下载了依赖项...一切看上去都很完美,但是当我尝试localserver/myProject/public时,我得到了

I want to use Laravel in my projects, but I faced a problem. Namely, I'm already using WAMP server as local server... I followed the instructions for installing Laravel inside WAMP... so I enabled openSSL first, then downloaded Composer, then tried composer command in the CMD, everything was fine so far... then created project... Composer has downloaded the dependencies... and everything looked perfect, but when I try localserver/myProject/public I get

Parse error: syntax error, unexpected T_CLASS, expecting T_STRING or T_VARIABLE or '$' in C:\wamp\www\myProject\public\index.php on line 50

有任何错误是很奇怪的,因为我什至没有触摸包中的文件... 提一下,我在Windows XP上使用WAMP 2.2(PHP 5.3.1),并安装了Laravel 4.

It is strange to have any errors, since I didn't even touch the files inside the package... To mention, I am using WAMP 2.2 (PHP 5.3.1) on Windows XP, and installed Laravel 4.

有什么想法可以解决这个问题吗?

Any ideas how to solve this issue?

这是公用文件夹中的index.php:

Here is the index.php in the public folder:

    require __DIR__.'/../bootstrap/autoload.php';

    $app = require_once __DIR__.'/../bootstrap/app.php';

    $kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);//This is line 50

    $response = $kernel->handle(
        $request = Illuminate\Http\Request::capture()
    );

$response->send();

$kernel->terminate($request, $response);

推荐答案

$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);//This is line 50

仅从另外,您必须误安装了laravel 5.1+,因为这是唯一需要php 5.5+的版本.

Also you must have mistakingly installed laravel 5.1+ because that's the only version to require php 5.5+

这篇关于Wamp内部的Laravel 4无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆