如何在laravel上运行网站

时间:2016-04-25 08:41:01

标签: laravel laravel-5

我安装了WAMP,已安装的Composer。在cmd我写了命令:

composer global require laravel/installer

安装了Laravel安装程序。使用cmd转到文件夹c:/wamp/www并写入命令:

laravel新博客

出现了包含以下内容的文件夹博客: enter image description here 现在我要在浏览器中打开网站的主页面?

3 个答案:

答案 0 :(得分:1)

将Wamp Web服务器指向Laravel项目的public文件夹。找到httpd.conf并将文件夹更改为以下内容:

DocumentRoot "C:/wamp/www/public"
<Directory "C:/wamp/www/public">

重新启动Apache并在浏览器中运行localhost。如果一切正常,你会看到Laravel的首页。

答案 1 :(得分:1)

You can see the app in browser by simply

 http://localhost/blog/public

Or, you can create virtual host and point it to the 'public' folder of your laravel app and access site like

 http://yourlocalsitename.dev/

Setup Virtual Host in WAMP

After installing Laravel, you may need to configure some permissions. Directories within the storage and the bootstrap/cache directories should be writable by your web server or Laravel will not run.

Run composer update from your terminal (from your project root).

答案 2 :(得分:1)

An easy way is to use PHP's built-in development server. In the root directory of your project run php artisan serve and your site will be served on http://localhost:8000/