doujieyu7062 2015-10-21 05:20 采纳率: 0%
浏览 44
已采纳

在Ubuntu白屏上安装Laravel 5.1,laravel.log和.env文件中没有错误

I have been struggling with this for days now, to the point where I have visited every link on stack laravel.io and laracasts and still no luck

Permissions on storage and bootstrap/cache changed to 777

When I browse to the welcome page on my app the result in inspector is 'get 200' for the pretty url

Artisan is functioning, key has been generated added to .env and app.php

No errors in apache log

I have upgraded php in Ubuntu 14.04 to version 5.6.14 mcrypt is installed

Would be really grateful if someone could shed some light on this

  • 写回答

1条回答 默认 最新

  • dongtongjian3127 2015-10-21 05:33
    关注

    Apache DocumentRoot

    Seems like you are not shown the laravel page. Try to put something like the following in the public/index.php file of your laravel installation (at the beginning of the file):

    <?php
        die('Laravel index file');
    

    If you browse to your site and don't see the text Laravel index file, your document root is pointing somewhere else. As you are using Apache see for example the configuration of virtual hosts in Ubuntu.

    Note, that the document root should point to the public directory of your laravel installation, not the root directory of your laravel installation (so eg /home/user/public_html/my_laravel_app/public instead of /home/user/public_html/my_laravel_app)

    Laravel routes

    EDIT: As you said, you saw the text, the next step for me would be to check the routes. Have a look at your app/Http/routes.php. What file is included for your request?

    <?php
    
    Route::get('/', function () {
        return view('welcome');
    });
    

    The above route would include resources/views/welcome.blade.php (or resources/views/welcome.php) for your request to http://localhost (or whatever your host looks like). Try to insert debugging information at the beginning of the welcome.blade.php, eg

    welcome.blade.php

    <h1>Welcome.blade.php</h1>
    

    Check if you can see the above text on your web request.

    Other ideas

    Maybe it would be useful to also have the following information:

    • Your apache config file
    • Path to your laravel app
    • Path to your info.php
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?