简体   繁体   English

Laravel共享主机上的部署问题

[英]Laravel deployment trouble on shared hosting

I had a problem when I tried to deploy my Laravel project on a shared hosting (hostinger.com) 当我尝试在共享主机(hostinger.com)上部署Laravel项目时遇到问题

I have followed tutorials by putting all the files of public in public_html. 我已经按照教程将public的所有文件都放在public_html中。 It works but it shows me that layouts.master wasn't found. 它可以工作,但显示出找不到layouts.master。

View [layouts.master] not found. 找不到[layouts.master]。 (View: /home/u102686349/OneGram/resources/views/index.blade.php) in FileViewFinder.php (line 137) (查看:FileViewFinder.php中的/home/u102686349/OneGram/resources/views/index.blade.php)(第137行)

Please tell me what to do 请告诉我应该怎么做

(1) Make sure that you point your website to Your_Laravel_project_Folder/public.Because laravel serves the file from the project's public folder. (1)确保将网站指向Your_Laravel_project_Folder / public。因为laravel提供了项目公共文件夹中的文件。

(2) Lets say if you have a web folder like www or /var/www on your hosting provider, then you copy the laravel app to www or /var/www and then in your httpd.conf or vhost or your nginx conf file, your website folder should be set as www/Your_Laravel_project_Folder/public or /var/www/Your_Laravel_project_Folder/public. (2)假设您的托管服务提供商上有一个Web文件夹,例如www或/ var / www,那么您可以将laravel应用复制到www或/ var / www,然后复制到httpd.conf或vhost或nginx conf文件中,您的网站文件夹应设置为www / Your_Laravel_project_Folder / public或/ var / www / Your_Laravel_project_Folder / public。

(3) After this, go to your laravel project folder using ssh (you should have artisan app already install on project root folder for this step. It should come by default with Laravel). (3)之后,使用ssh转到您的laravel项目文件夹(此步骤您应该已在项目根文件夹上安装了artisan应用。默认情况下,Laravel附带该工具)。 Then try running this command from terminal if you can ssh to your webhost : php artisan cache:clear && composer dump-autoload . 然后,如果可以ssh到Webhost,请尝试从终端运行此命令: php artisan cache:clear && composer dump-autoload Probably this will resolve the issue. 也许这可以解决问题。

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

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