1.Apache配置文件---httpd.conf
(1)Deny from all问题
<Directory />
Options +Indexes +FollowSymLinks +ExecCGI
AllowOverride All
Order allow,deny
Allow from all
Require all granted
</Directory>
原始Allow from all如果为Deny from all则需要更改。
(2)所有端口号需要一致,如:
Listen 8080
ServerName localhost:8080
需保持一致
(3)路径为项目的路径,我的项目文件夹为LooperWeb-master
DocumentRoot "D:\phpStudy\WWW\LooperWeb-master"
(4)学会看错误日志error.log,根据错误日志找问题。
2.phpstrom端口设置
File-->Settings-->Build,Execution,Deployment-->Debugger
image.png端口号需跟Apache配置的端口号一致
ThinkPHP问题
运行项目出现
You don't have permission to access / on this server.
权限不足,在根目录下创建.htaccess
文件,文件内容为
<IfModule mod_rewrite.c>
Options +FollowSymlinks -Multiviews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
# RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]
</IfModule>
网友评论