ThinkPHP5环境搭建和使用
目录
一、下载并且安装thinkphp
1、官方下载
http://www.thinkphp.cn/down/1278.html
注意:安装方式此文只提供下载,其他方式(composer下载安装、码云下载等途径均可)
2、下载文件解压到指定WWW文件夹下
注意:如果没有环境的,建议下载phpstudy并安装,官方下载地址:https://www.xp.cn/download.html
二、thinkphp的使用
1、phpstudy配置运行环境
①启动apache和mysql服务
注意:根据实际开发选择不同版本
②创建网站
③高级配置---日志
2、网站访问
①输入自定义的网站域名,即可访问成功
三、创建新模块无法访问解决办法
1、出现No input file specified
2、解决方案:
①找到ThinkPHP的public目录下的.htaccess文件
②倒数第二排的正则改成如下:
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?/$1 [QSA,PT,L]
</IfModule>