MAC OS 10.9 Installing PHP extensions

Source: Internet
Author: User
Tags apc configuration php zts



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;  }}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.