Install Xcode's latest version 1 First,
Create a soft linksudo ln-s/applications/xcode.app/contents/developer/platforms/macosx.platform/developer/sdks/macosx10.9.sdk/usr /include/usr/include
2, installation M4
: m4-latest.tar.gz
after the download is complete, unzip the CD to the extracted directory and execute the following command:/usr/bin/phpize./configuresudo Makesudo make Install
3, installation autoconf
: autoconf-latest.tar.gz
after the download is complete, unzip the CD to the extracted directory and execute the following command:/usr/bin/phpize./configuresudo Makesudo make Install
4, installation Pcre
: Pcre-perl Compatible Regular Expressions
after the download is complete, unzip the CD to the extracted directory and execute the following command:/usr/bin/phpize./configuresudo Makesudo make Install
5. CP pcre.h/applications/xcode.app/contents/developer/platforms/macosx.platform/developer/sdks/macosx10.9.sdk/usr/include /
5. Installation of PHP extension YAF
: Yaf-2.3.2.tgz
after the download is complete, unzip the CD to the extracted directory and execute the following command:/usr/bin/phpize./configuresudo Makesudo make Install
6. Installation of the PHP extension APC: Http://pecl.php.net/get/APC/usr/bin/phpize./configuresudo Makesudo make install
7, configuration php.inisudo vim/pravate/etc/php.ini Add the following two lines extension=/usr/lib/php/extensions/no-debug-non-zts-20100525/yaf.soextension=/ Usr/lib/php/extensions/no-debug-non-zts-20100525/apc.so
8. Verify Installation Success
<?phpecho "<pre>";print_r(get_loaded_extensions());echo "</pre>";
?>
看结果有没有yaf和apc。
9、接下来配置apache或者nginx即可运行yaf框架的网站。
apache配置参考如下:
Listen 8080
<virtualhost *:8080>
ServerAdmin [Email protected]
DocumentRoot "/users/jry/documents/workspace/admin_yaf/public_html"
ServerName localhost
Serveralias localhost
SETENV "Code_env" "Development"
SETENV "Db_host" "127.0.0.1"
SETENV "Db_name" "Dreamore"
SETENV "Db_user" "root"
SETENV "Db_pwd" ""
SETENV "Db_charset" "UTF8"
errorlog "/private/var/log/apache2/error_log"
Customlog "/private/var/log/apache2/access_log" common
<directory/>
Options Indexes FollowSymLinks MultiViews
allowoverride All
Order Allow,deny
Allow from all
</Directory>
</VirtualHost>
URL重写规则参考如下:
Apache's rewrite (httpd.conf)
#.htaccess, of course, can also be written in Httpd.confrewriteengine Onrewritecond%{request_filename}!-frewriterule. * index.php
Nginx's rewrite (nginx.conf)
server { Listen * * *; server_name domain.com; Root document_root; Index index.php index.html index.htm; if (!-e $request _filename) { rewrite ^/(. *) /index.php/$1 last; }}