mac下配置php开发环境问题总结

1.使用mac系统自带的apache 和 php环境

2.启动apache:sudo apachectl start/stop/restart

启动php: sudo php-fpm    ,关闭sudo pkill php-fpm

3.在apache2文件夹下找到httpd.conf,放开

LoadModule rewrite_module libexec/apache2/mod_rewrite.so

LoadModule php5_module libexec/apache2/libphp5.so


以及DocumentRoot "/Library/WebServer/Documents"

Options FollowSymLinks Multiviews

MultiviewsMatch Any

AllowOverride All

Order allow,deny

Allow from all

Require all granted,


4.在users文件夹下创建****.conf文件:


Options Indexes MultiViews

AllowOverride All

Require all granted

5.在httpd.conf结尾添加AccessFileName htaccess
6.修改Runtime权限:sudo chmod -R 777 Runtime/

7..htaccess文件一定要 有:


Options +FollowSymlinks

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{REQUEST_FILENAME} !-f

RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]


你可能感兴趣的:(mac下配置php开发环境问题总结)