• Bỏ qua primary navigation
  • Skip to main content
  • Bỏ qua primary sidebar

Thủ thuật thiết kế website

Chia sẻ kinh nghiệm thiết kế website

  • Trang chủ
  • Joomla
    • Thủ thuật Joomla
    • Joomla Extensions
    • Joomla Themes
  • WordPress
    • Thủ thuật WordPress
    • WordPress Plugins
    • WordPress Themes
  • PHP Framework
    • Codeigniter
    • Laravel
    • Laminas
  • App Developer
    • React Native
    • Flutter
  • SEO
  • Chia sẻ
  • Phần mềm
Bạn đang ở:Trang chủ / PHP Framework / Codeigniter / [CodeIgniter 4] How to upload Codeigniter 4 website on share hosting?

[CodeIgniter 4] How to upload Codeigniter 4 website on share hosting?

13/05/2021 - Administrator Để lại bình luận

For security reason codeigniter4 folder is made suchg a way that all the libraried and code folder is outside the public folder. By url only public folder is accesible. To host it on share hosting your directory structure should look like this.

--home/root (sharehosting root directory)
   |__ public_html (or your domain root folder)
   |    |__assets
   |    |__ index.php
   |    |__ .htaccess
   |
   |__ codeigniter (create a folder with any name you like)
        |__ app(all the files and folder in app folder)
        |__ system
        |__ writable
        |__ .env (dot env file here)

Now you need to change some values to up and running your codeigniter4 project

In public_html folder index.php file chnage the

$pathsPath = FCPATH . '../app/Config/Paths.php';

to

$pathsPath = FCPATH . '../codeigniter/app/Config/Paths.php';

In app/Config folder App.php file change

$baseURL = 'http://192.168.0.111/';

to

$baseURL = 'http://yourdomain.com/';

After this chnage your site will be up and running. To deploy in subdomain and if your subdomain root folder lies in public_html then you should change

$pathsPath = FCPATH . '../app/Config/Paths.php';

to

$pathsPath = FCPATH.'../../codeigniter/app/Config/Paths.php';

in public_html/yourdomain folder index.php file, followed that directory structure remains same. Important: public folder content should be placed in your subdomain folder.

Nguồn : https://stackoverflow.com

0 0 đánh giá
Article Rating
Theo dõi
Đăng nhập
Thông báo của
guest
guest
0 Comments
Phản hồi nội tuyến
Xem tất cả bình luận

Sidebar chính

LỜI NGỎ

Đây là blog cá nhân, cung cấp các thông tin, kiến thức và kinh nghiệm về lập trình và cuộc sống. Những bài viết được mình sưu tập từ nhiều nguồn, mọi chi tiết liên quan đến bản quyền xin vui lòng liên hệ qua email kairu2607@gmail.com ! Cám ơn rất nhiều.

Tìm kiếm

Thủ thuật Wordpress

Hướng dẫn tạo liên hệ All in one phiên bản có yêu cầu gọi lại

Cách Tạo Demo Website Mockup – giới thiệu trang tạo Demo Website Mockup

Hướng Dẫn Cấu Hình SMTP Để Gửi Mail Trên WordPress

Cách tự tạo thêm Sidebar cho theme wordpress

Vì Sao Rank Math Vượt Trội – SEO WordPress 2023

Thêm lượt xem bài viết vào WordPress Post Views Counter

Website Bị Hack Virus Index Tiếng Nhật và Toàn Tập Các Cách Xử Lý

Laravel

Câu hỏi phỏng vấn Laravel cơ bản đến nâng cao

Câu lệnh Php Artisan Laravel thường dùng nên biết

Tổng hợp câu lệnh trong Laravel PHP Framework

[Laravel Tutorials] Tổ chức theo dạng packages/modules – Phần 4: tạo local package với Composer

[Laravel Tutorials] Tổ chức theo dạng packages/modules – Phần 3: Load migrations, models, translations

[Laravel Tutorials] Tổ chức theo dạng packages/modules – Phần 2: Load views và controllers

Codeigniter Framework

[CodeIgniter 4] Codeigniter 4 Remove Public and Index.php From URL

[CodeIgniter 4] How to upload Codeigniter 4 website on share hosting?

Sửa lỗi website Codeigniter 2.x không chạy được với PHP 7.x

[CodeIgniter 4] Sử dụng cURL trong CodeIgniter 4

[CodeIgniter 4] Sử dụng cache để tăng tốc website trong CodeIgniter 4

[CodeIgniter 4] Xử lý hình ảnh chuyên nghiệp trong CodeIgniter 4

[CodeIgniter 4] Hướng dẫn gửi mail trong CodeIgniter 4

Dịch vụ Thiết Kế Website

Phần mềm hay

Hướng dẫn sử dụng phần mềm putty trên Windows

Switching between multiple PHP versions on macOS

Byebye Edge Chromium/Microsoft Edge

Hướng dẫn tắt Gatekeeper (Bật tùy chọn Anywhere) sửa lỗi “damaged and can’t be opened. You should move it to the Trash”

Cài lại macOS trên Mac Silicon (M1) “sạch trơn” bằng macOS Recovery

Copyright © 2023 · Metro Pro on Genesis Framework · WordPress · Đăng nhập

wpDiscuz