简体   繁体   English

如何将本地Laravel Web项目上传到服务器?

[英]How can I upload my local Laravel web project to server?

I work on a website which i made from Laravel and now i need to push it to the server and go live. 我在Laravel制作的网站上工作,现在我需要将它推送到服务器并上线。 I'm new to Laravel hosting. 我是Laravel托管的新手。 Earlier I did coding by pure php and those days i just push the project to server and it works. 之前我用纯php进行编码,那些日子我只是将项目推送到服务器并且它可以工作。 My server is one.com and this is what i get when i copy my content and try to access the page. 我的服务器是one.com,这是我在复制我的内容并尝试访问该页面时得到的。

在此输入图像描述

please help me on this manner! 请以这种方式帮助我! thank you 谢谢

Option 1: Use .htaccess 选项1:使用.htaccess

if it isn't already there, create an .htaccess file in the Laravel root directory. 如果它不存在,请在Laravel根目录中创建一个.htaccess文件。 Create a .htaccess file your Laravel root directory if it does not exists already. 如果Laravel根目录不存在,请创建一个.htaccess文件。 (Normally it is under your public_html folder) Edit the .htaccess file so that it contains the following code: (通常它位于您的public_html文件夹下)编辑.htaccess文件,使其包含以下代码:

<IfModule mod_rewrite.c>
   RewriteEngine On 
   RewriteRule ^(.*)$ public/$1 [L]
</IfModule>

Laravel has an Entry Point (which is the index.php File). Laravel有一个入口点( index.php文件)。 This File lives inside the public folder. 此文件的生活里面public文件夹。 To go LIVE with a Laravel Project, you have to set your Document Root to point to the public Directory. 要使用Laravel项目进行实时 ,您必须将文档根目录设置为指向public目录。

Right now, you can only access your Site by navigating to: http://van.lesthi.com/public/ 目前,您只能通过导航到以下网址访问您的网站: http//van.lesthi.com/public/

At the moment of this writing; 在写这篇文章的那一刻; accessing the URL above throws somewhat of an SQL Error, which you may want to fix first.... 访问上面的URL会引发一些SQL错误,您可能需要先修复它....

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

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