簡體   English   中英

將 php(codeigniter)中的 web 應用程序從本地主機傳輸到我的服務器和域

[英]Transfer web app in php (codeigniter) from localhost to my server and domain

我正在和我的客戶一起做一個項目。 我主要做前端工作,所以我不太明白這里出了什么問題。

我們獲得了一個預構建應用程序的白色 label 許可證,我們在本地主機上完全重新設計並重新設計了該應用程序(我在 Mac 上使用 MAMP)。 該應用程序在那里運行良好,沒有任何問題。

當我嘗試將我的應用程序傳輸到我的主機服務器時,它不會加載。 當我將文件放在那里並故意將其鏈接到錯誤的頁面時,它不會顯示未找到和此類錯誤,該頁面只是空白

托管服務器和東西工作,如果我將隨機 index.html 文件放在同一文件夾中,它將顯示出來。

我的過程是,將所有數據庫內容(MySQL)從一個 PHPmyadmin 復制到另一個。

我為此創建了一個具有完全訪問權限的新數據庫和用戶。

使用文件管理器並上傳壓縮文件並將其解壓縮到我的服務器上。

現在 codeigniter 部分有它需要鏈接到的代碼部分,我需要第一次編輯它,否則它將無法在我的本地主機上工作。

代碼是這樣的。

/*
|--------------------------------------------------------------------------
| Base Site URL
|--------------------------------------------------------------------------
|
| URL to your CodeIgniter root. Typically this will be your base URL,
| WITH a trailing slash:
|
|   http://example.com/
|
| If this is not set then CodeIgniter will try guess the protocol, domain
| and path to your installation. However, you should always configure this
| explicitly and never rely on auto-guessing, especially in production
| environments.
|
*/
public $baseURL = 'http://localhost:8888/hr-prw';

我還有一個databse.php,它有這些代碼行。

/**
 * The directory that holds the Migrations
 * and Seeds directories.
 *
 * @var string
 */
public $filesPath = APPPATH . 'Database/';

/**
 * Lets you choose which connection group to
 * use if no other is specified.
 *
 * @var string
 */
public $defaultGroup = 'default';

/**
 * The default database connection.
 *
 * @var array
 */
public $default = [
    'DSN'      => 'mysql:host=localhost;dbname=root',
    'hostname' => 'localhost',
    'username' => 'root',
    'password' => 'root',
    'database' => 'root',
    'DBDriver' => 'MySQLi',
    'DBPrefix' => '',
    'pConnect' => true,
    'DBDebug'  => (ENVIRONMENT !== 'production'),
    'cacheOn'  => false,
    'cacheDir' => '',
    'charset'  => 'utf8',
    'DBCollat' => 'utf8_general_ci',
    'swapPre'  => '',
    'encrypt'  => false,
    'compress' => false,
    'strictOn' => false,
    'failover' => [],
    'port'     => 3306,
];

現在這是在我的 MAMP 上本地運行的所有內容,並且運行良好。

對於主機,我創建了一個子域。 假設我的文件位置和數據庫信息如下所示。

testnet.domain.hr/hr.prw

數據庫信息: 用戶名:database_root 密碼:databaseroot 數據庫名稱:database_root

現在我很想知道當我輸入時我需要把什么放在哪里才能完成這項工作。

https://testnet.domain.com/hr-prw/

當我 go 檢查網絡時,它顯示一個空白頁,錯誤為 500。

我試圖將信息放在這兩個表中並以各種不同的組合進行編輯,但我沒有運氣,非常感謝您的幫助。如果您需要更多信息,請詢問。

發現問題,在我的主機 PHP 版本上沒有啟用 INTL,這解決了所有問題。

public $baseURL = 'http://localhost:8888/hr-prw'值更改為您自己的域或項目根位置,如下所示

public $baseURL = 'http://example.com/hr-prw';

您可以使用 nginx 或 apache 從服務器綁定,然后從 http://localhost:8888/hr-prw 設置

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM