Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
886 views
in Technique[技术] by (71.8m points)

macos - Install and configure mod_rewrite for Apache 2 on Mac OS X for Zend Framework 2

I getting started with zend framework 2 and they have a prerequisite of an installation and configuration of mod_rewrite for apache. Apache 2.2.22 came pre-installed on Mac OS X 10.8.2. Is there an easy way to install and configure mod_rewrite for apache?

The only help I have come across suggests to recompile apache. Is this the only way?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

To check that mod_rewrite and PHP are enabled, look at /etc/apache2/httpd.conf and ensure that these lines:

LoadModule rewrite_module libexec/apache2/mod_rewrite.so
LoadModule php5_module        libexec/apache2/libphp5.so

are uncommented.

Also ensure that AllowOverride is set to All within the <Directory "/Library/WebServer/Documents"> section.

After making these changes, restart Apache with: sudo apachectl restart

If you then put your project within the /Library/WebServer/Documents folder, then it should work.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...