如何在Hostinger上部署自定义PHP MVC网站

问题描述 投票:0回答:1

这是我第一次部署实际的网站,并且使用自定义 MVC 架构完成了一个项目。在本地一切正常,但当我将文件添加到 Hostinger 时,除了空白页面之外什么都没有出现。不过,图标和 CSS 仍然加载在 中。我的层次结构看起来像这样:

config
- index.php
public
- assets
- .htaccess
- index.php
- logout.php
src
- model
- view 
- controller
templates
- (list of all the things I render with my views)

在config文件夹中的index.php中,我有所有的常量。看起来是这样的:

<?php
// HOST
define("HOST", "https://heptagone-art.com/public/");

// DIR
define("DIR_ASSETS", HOST . "assets/");
define("DIR_CSS", DIR_ASSETS . "css/main.css");
define("DIR_JS", DIR_ASSETS . "js/");

define('DIR_APPLICATION', '../src/');
define('DIR_MODEL', DIR_APPLICATION . 'model/');
define('DIR_VIEW', DIR_APPLICATION . 'view/');
define('DIR_CONTROLLER', DIR_APPLICATION . 'controller/');

define('DIR_TEMPLATE', '../templates/');

// DB
define("DB_HOSTNAME", "localhost");
define("DB_USERNAME", "(the username hostinger gave me");
define("DB_PASSWORD", "(the password I added on hostinger)");
define("DB_DATABASE", "(the database I added on hostinger");
define("DB_PORT", "3306");

我真的不知道如何正确部署整个事情,而且我不知道如何搜索它,因为我找到的信息与我所做的不匹配。预先感谢,我可能没有很好地解释我的问题,因为英语不是我的母语,但请随时问我任何问题,让我帮助你帮助我哈哈

php model-view-controller deployment hosting
1个回答
0
投票

在托管商共享托管计划上部署 php 网站非常简单,您只需拖放此处即可完成教程:在托管商共享托管上托管 php 网站

© www.soinside.com 2019 - 2024. All rights reserved.