CodeIgniter_01

1.Installation

1.1 download and install Codeigniter
webpage

1.2 configuration

main configuration

  1. Develop your app inside the app folder.
  2. The public folder will be your public-facing document root.
  3. Do not change anything inside the system folder!

CI4 has been already an application before and can be nested into the htdocs of XAMPP.

And there are TWO values necessarily modified.

  1. app/Config/App.php => baseURL=?
  2. app/Config/Database.php =>some info:username,password=?

Then the configuration of server:
apache2/conf/httpd.conf

LoadModule rewrite_module modules/mod_rewrite.so
//make it uncommented

htaccess

<Directory "/opt/lamp/apache2/htdocs">
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>

if localhost/ci_project doesn’t work ,the solution below will be applied.
apache/phpini

(append)
extension = intl;

1.3 remove /public from URL

  1. copy these two files : .htaccess && index.html in public folder to the project root folder.
  2. modify the value of $pathsConfig to “FCPATH . ‘/app/Config/Paths.php’”;

URL without public folder can work!

2.composer installation

2.1 download XAMPP

2.2 download composer

a dependency manager of php

download link for composer

2.2.1 install composer like normal software

2.2.2 download codeigniter and create new project directory

command:

composer create-project codeigniter4/appstarter   project-name

2.3 configuration

  • 2.3.1 A subtle problem

  • A problem may be emerged due to a lack of internation implement;
    solution=> delete ; from ;extension=intl in /php/php.in

  • 2.3.2 env file

(official description )
CodeIgniter makes it simple and painless to set Environment Variables by using a “dotenv” file. The term comes from the file name, which starts with a dot before the text “env”.
CodeIgniter expects .env to be at the root of your project alongside the system and app directories. There is a template file distributed with CodeIgniter that’s located at the project root named env (Notice there’s no dot (.) at the start?). It has a large collection of variables your project might use that have been assigned empty, dummy, or default values. You can use this file as a starting place for your application by either renaming the template to .env, or by making a copy of it named .env.
(Attention: add . before env)

There indeed are three important points emphasised here.

  • CI_ENVIRONMENT = development (the original value is production)

  • app.baseURL = ‘http://localhost/’

  • mysql parameters group

    writable
    some modifiable files like session ,cache or files stored in the server.

    vendor

    public
    it’s like a entry of codeigniter ???set up running environment and launch the default index webpage.


Reference:
1.[extremely recommend]
Alex Lancer —youtube

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值