1.Apache配置文件---httpd.conf
(1)Deny from all問(wèn)題
<Directory />
Options +Indexes +FollowSymLinks +ExecCGI
AllowOverride All
Order allow,deny
Allow from all
Require all granted
</Directory>
原始Allow from all如果為Deny from all則需要更改捎拯。
(2)所有端口號(hào)需要一致,如:
Listen 8080
ServerName localhost:8080
需保持一致
(3)路徑為項(xiàng)目的路徑静盅,我的項(xiàng)目文件夾為L(zhǎng)ooperWeb-master
DocumentRoot "D:\phpStudy\WWW\LooperWeb-master"
(4)學(xué)會(huì)看錯(cuò)誤日志error.log,根據(jù)錯(cuò)誤日志找問(wèn)題颤练。
2.phpstrom端口設(shè)置
File-->Settings-->Build,Execution,Deployment-->Debugger
端口號(hào)需跟Apache配置的端口號(hào)一致
ThinkPHP問(wèn)題
運(yùn)行項(xiàng)目出現(xiàn)
You don't have permission to access / on this server.
權(quán)限不足春瞬,在根目錄下創(chuàng)建.htaccess
文件韵洋,文件內(nèi)容為
<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>