简体   繁体   English

如何在共享/经销商托管(hostgator)上正确安装Laravel 5.2?

[英]How to install correctly Laravel 5.2 on a shared / reseller hosting (hostgator)?

I have a fresh installation of Laravel 5.2.43 via ssh with composer on a reseller hosting account from Hostgator. 我在Hostgator的经销商托管帐户上通过ssh与作曲家进行了全新的Laravel 5.2.43安装。 Laravel is installed in the root like this: Laravel像这样安装在root中:

 /home/user/laravel

I want to do the following: to move the public folder from Laravel internal structure, this is the url: 我想执行以下操作:从Laravel内部结构移动公用文件夹,这是url:

/home/user/laravel/public 

to another folder inside the public_html, this would be the url: 到public_html中的另一个文件夹,这将是url:

/home/user/public_html/laravel-public-folder-here

How can I do that using the right way? 我怎么能用正确的方法做到这一点?

To make the redirect I wanted to use the last steps from this forum post: 要进行重定向,我想使用此论坛帖子的最后几步:

http://laravel.io/forum/02-13-2014-how-to-install-laravel-on-a-hostgator-shared-server http://laravel.io/forum/02-13-2014-how-to-install-laravel-on-a-hostgator-shared-server

But it seems that Laravel 5.2 doesn't have the file "laravel/bootstrap/paths.php". 但似乎Laravel 5.2没有“laravel / bootstrap / paths.php”文件。 Probably the forum post is for an older version of Laravel. 论坛帖子可能是旧版本的Laravel。

Please answer if you know how I can do that in the right way. 如果你知道我怎么能以正确的方式做到这一点,请回答。 I have looked on answers on similar questions here on stack, but they didn't solve my issue, Probably is just a Laravel config matter which I miss at the moment. 我已经在堆栈上查看了类似问题的答案,但它们没有解决我的问题,可能只是我目前想念的Laravel配置问题。

Thank you! 谢谢!

You only needs copy all your files of laravel project and put in folder /public_html , the next step is create an .htaccess file in /public_html with this code: 您只需复制laravel项目的所有文件并放入文件夹/ public_html ,下一步是使用以下代码在/ public_html中创建.htaccess文件:

## Redirect to public folder
    <IfModule mod_rewrite.c>
        RewriteEngine on
        RewriteRule ^$ public/ [L]
        RewriteRule (.*) public/$1 [L]
    </IfModule>

this work's for me in godaddy. 这项工作适合我在godaddy。

Regards! 问候!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM