简体   繁体   English

Laravel 上传到 cpanel css 问题

[英]Laravel upload to cpanel css issue

I am trying to upload a laravel project to cpanel hosting server.我正在尝试将 Laravel 项目上传到 cpanel 托管服务器。 My laravel version is 5.3 and php version on the server is 5.6.我的 Laravel 版本是 5.3,服务器上的 php 版本是 5.6。

What I have done is:我所做的是:

  1. Create a folder called "online_system" to root of file manager.创建一个名为“online_system”的文件夹到文件管理器的根目录。
  2. Copy contents of laravel project except public folder.复制除公用文件夹外的 Laravel 项目的内容。
  3. Create a folder called "online_system" to public_html.在 public_html 中创建一个名为“online_system”的文件夹。
  4. Copy contents of public folder of laravel project.复制 Laravel 项目公用文件夹的内容。
  5. Jump to index.php file.跳转到 index.php 文件。
  6. Edit require __DIR__.'/../../online_system/bootstrap/autoload.php';编辑require __DIR__.'/../../online_system/bootstrap/autoload.php';
  7. Edit $app = require_once __DIR__.'/../../online_system/bootstrap/app.php';编辑$app = require_once __DIR__.'/../../online_system/bootstrap/app.php';
  8. Change .env to link DB.将 .env 更改为链接 DB。
  9. Open domain/online_system.开放域/online_system。

在此处输入图片说明

Home page is working fine , but as long as I click login or register provided by laravel, then the website looks plain without css load.主页工作正常,但只要我点击 laravel 提供的登录或注册,那么网站看起来很简单,没有 css 加载。

在此处输入图片说明

How can I solve this problem?我怎么解决这个问题?

试试看

<link rel="stylesheet" type="text/css"  href="{{ url('online_system/css/styl.css') }}" />

我想这可以解决问题:

<link rel="stylesheet" type="text/css"  href="/public/css/style.css"/>

如果您的项目在服务器上并更改您的视图,那么清除视图缓存:

php /path_to_your_project/ artisan view:clear

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

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