[英]Laravel on shared hosting - subdomain
I am trying to deploy my laravel application on a shared hosting.我正在尝试在共享主机上部署我的 Laravel 应用程序。 It should be deployed in www.subdomain.something.com它应该部署在 www.subdomain.something.com
My folder structure is:我的文件夹结构是:
/laravel
app/
vendor/
bootstrap/
server.php
artisan
composer.json
composer.lock
phpunit.xml
/public_html
subdomain/
index.php
My index.php have the following paths:我的 index.php 有以下路径:
require '/../../laravel/bootstrap/autoload.php';
$app = require_once '/../../laravel/bootstrap/start.php';
My paths.php我的路径.php
'app' => __DIR__.'/../../laravel/app',
'public' => __DIR__.'/../../public_html/subdomain',
'base' => __DIR__.'/../../laravel',
'storage' => __DIR__.'/../../laravel/app/storage',
Can anyone see what I am missing?谁能看到我错过了什么? I tried google, and found a bunch of step-by-step explanations but nothing seems to work - It results in a 500 internal server error.我试过谷歌,找到了一堆分步说明,但似乎没有任何效果 - 它导致 500 内部服务器错误。
Thanks for any feedback感谢您的任何反馈
Wesley卫斯理
Follow the first rule here .遵循这里的第一条规则。 If you use the first rule then everything should work fine.如果您使用第一条规则,那么一切都应该正常工作。 But somehow if you face 500 Internal Server Error
then login to ur server public_html
directory through ssh
and give the following command.但是不知何故,如果您遇到500 Internal Server Error
然后通过ssh
登录到您的服务器public_html
目录并给出以下命令。
sudo chmod 755 -R laravel
chmod -R o+w laravel/storage
Here laravel
is your Laravel project directory.这里laravel
是你的 Laravel 项目目录。
Make sure you have write permissions to app/storage/
and all the sub directories.确保您对app/storage/
和所有子目录具有写入权限。 This sounds like the culprit but if not then see if you get any errors in the app/storage/logs
dir.这听起来像是罪魁祸首,但如果不是,请查看app/storage/logs
目录中是否有任何错误。 If not see if you can parse the server logs.如果没有,看看是否可以解析服务器日志。
I was having similar problem and found the solution.Maybe someone can get help with this,我遇到了类似的问题并找到了解决方案。也许有人可以得到帮助,
Install LARAVEL 5 Locally Same as Share Hosting Directory (Deploy L5 Share Hosting Solution) 在本地安装 LARAVEL 5 与共享托管目录相同(部署 L5 共享托管解决方案)
I tried to deploy my first Laravel 8 application on shared hosting on DreamHost, and did encounter some issues.我尝试在 DreamHost 上的共享主机上部署我的第一个 Laravel 8 应用程序,但确实遇到了一些问题。
header("Location: http://www.cota.mydomain.com/public/index.php"); die();
接下来,我在 cota.mydomain.con 中添加了一个 index.php,其中包含以下内容header("Location: http://www.cota.mydomain.com/public/index.php"); die();
header("Location: http://www.cota.mydomain.com/public/index.php"); die();
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.