🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
# 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. 修改运行目录: ![](https://box.kancloud.cn/74250bd92a2d62e4e395650a0387324b_697x188.png) ```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. ``` ![](https://box.kancloud.cn/125601e40702ebda2701a0aa43284c04_748x475.png) 修改文件 `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 。 ![](https://box.kancloud.cn/d821bdf4b1d4e132bc6d338da9e093ff_1282x741.png) ## 2.修改Codeigniter的App.php 打开 `e:\xampp\htdocs\application\Config\App.php` 文件,24行: ``` public $baseURL = ''; ``` 改为: ``` public $baseURL = 'http://127.0.0.1/'; ```