# PHP環境
**軟件**
https://github.com/bcit-ci/CodeIgniter4
https://codeload.github.com/bcit-ci/CodeIgniter4/zip/develop
**手冊**
https://bcit-ci.github.io/CodeIgniter4/
# 下載Xampp
# 將Codeigniter跑起來
## 1. 修改運行目錄:

```text
If you see this message, you have not configured your web server properly.
You need to set your "document root" to the public folder inside your project. This could be your default setting, or that of a virtual host, depending on how you set up your local development environment.
```

修改文件 `E:\xampp\apache\conf\httpd.conf` ,第247行。(我的xampp解壓在`E:\` , 注意先備份,再修改!)
```
#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "/xampp/htdocs"
<Directory "/xampp/htdocs">
```
改為:
```
DocumentRoot "/xampp/htdocs/public"
```
修改完畢后,重啟Apache,然后訪問:127.0.0.1 。

## 2.修改Codeigniter的App.php
打開 `e:\xampp\htdocs\application\Config\App.php` 文件,24行:
```
public $baseURL = '';
```
改為:
```
public $baseURL = 'http://127.0.0.1/';
```