[英]Laravel 5.8 Fresh Deployment Not Working In Hostinger Shared Hosting
I tried to deploy a fresh laravel application.我试图部署一个新的 Laravel 应用程序。 I installed a laravel 5.8 and upload to github repository.我安装了 laravel 5.8 并上传到 github 存储库。
The repository or project folder is working since I tried to run php artisan serve
and it successfully shows the laravel home screen page.存储库或项目文件夹正在工作,因为我尝试运行php artisan serve
并成功显示 laravel 主屏幕页面。
I tried to connect in my shared hosting using ssh.我尝试使用 ssh 连接到我的共享主机。
Here's the steps that I've done:这是我完成的步骤:
mkdir my-assignment-calculator
then cd my-assignment-calculator创建一个项目文件夹mkdir my-assignment-calculator
然后 cd my-assignment-calculatorgit clone **repo_url**
cd my-assignment-calculator
导航项目文件夹, cd my-assignment-calculator
cp .env-example .env
复制 .env 文件, cp .env-example .env
composer install
Public
folder to public_html folder然后将Public
文件夹中的所有文件复制到 public_html 文件夹nano index.php
转到 public_html 然后更新 index.php, nano index.php
Here's the sample code for #9:以下是#9 的示例代码:
require __DIR__.'/../my-assignment-calculator/my-assignment-calculator/vendor/autoload.php';
/*
|--------------------------------------------------------------------------
| Turn On The Lights
|--------------------------------------------------------------------------
|
| We need to illuminate PHP development, so let us turn on the lights.
| This bootstraps the framework and gets it ready for use, then it
| will load up this application so that we can run it and send
| the responses back to the browser and delight our users.
|
*/
$app = require_once
__DIR__.'/../my-assignment-calculator/my-assignment-calculator/bootstrap/app.php';
-public_html
-domains
--my_assignment_calculator
--my_assignment_calculator
---laravel files
The current output is only white screen.当前输出只有白屏。 I tried to check the developers tools or devtools, there's no error.我试图检查开发人员工具或开发工具,没有错误。 It's just a white background.这只是一个白色的背景。 It's the same as before.这和以前一样。
I tried to check .htaccess file and I didn't touch this file.我试图检查 .htaccess 文件,但我没有触及这个文件。 Here is the .htaccess:这是.htaccess:
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews -Indexes
</IfModule>
RewriteEngine On
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
Should display laravel welcome or home screen page应该显示 laravel 欢迎或主屏幕页面
laravel folder is in root then all your public folder files transfer it into public_html then go to your index file in your public_html configure by adding laravel directory like this: laravel 文件夹位于根目录中,然后您的所有公共文件夹文件都将其传输到 public_html 中,然后通过添加如下所示的 laravel 目录转到您的 public_html 配置中的索引文件:
require __DIR__.'/../laravel/vendor/autoload.php';
$app = require_once __DIR__.'/../laravel/bootstrap/app.php';
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.