Install Yaf to Mac

Source: Internet
Author: User
Tags php framework automake

Fast installation of PHP framework under Mac YAF

Reference YAF is the framework of PHP laruence based on the extension of the domestic PHP great God. The main feature is speed, high efficiency, more than the use of PHP code Development Framework performance is much higher. According to the great God has been used on Sina Weibo, TPS increased by 76%. Refer to Yaf's homepage for details. Installing open source software and server Software under Mac is certainly not the apt-get of Ubuntu, but there are excellent package managers such as macports and homebrew, and I am using the latter because it is simpler to use and allows you to focus on what you need to focus on. Recently several projects are ready to be developed with YAF, so submitted Yaf brew script up, if you are interested can also contribute some good PHP brew, let everybody use up convenient. Specifically, you can refer to the Homebrew-php project on the installation of brew, basically a command is done, the specific can refer to homebrew installation

Ruby < (CURL-FSSKL raw.github.com/mxcl/homebrew/go)

Next you need to tap the Brew Library of PHP to local (homebrew-php project can install most common PHP extensions)

Brew Tap josegonzalez/homebrew-php

If you tap, just perform

Brew Update

Then the installation only needs to execute

Brew Install PHP53-YAF//If it is 5.4, use PHP54-YAF

Done (note: You need to modify php.ini add extension path)



I press the above operation, the result is not loaded, helpless, but this should be calculated to be more good
Specific links will not be done, click to see the original

2 MacOS YAF (PHP) extended compilation (Mac make)

Reference in the Mac installed YAF (PHP) extension, is a tangled process, troubled me for several days, the system is not supported by default make, no Yum/apt-get (note: macport, Test proves that it is not good, too much), after these days finally put Yaf compiled into the Mac PHP , let's share this process with you.
If you still cannot complete MacOS YAF compilation through this tutorial, you can go to YAF QQ group to get help, group number is: 5134185, and YAF forum for help: yafphp.com

Operating system: Mac OS X Lion 10.7.4
Development environment: XAMPP (Integrated development environment)

The first step is to download the integrated development environment first XAMPP
(Of course you can also compile the source code or Mac comes with, in: System Preferences > Web sharing, because it is not the focus of this article, do not introduce)
Xampp:www.apachefriends.org/zh_cn/xampp-macosx.html
Installation method will not be written, the site gray often detailed,
Remind you, remember to download: Developer package (compiled PHP extension to use)

Environment installation Well, I met the first puzzle, Mac OS no Yum/apt-get, No./configure, no make
The solution to this problem:
1, install Xcode, in the App Store can get free
2. Open Xcode and the menu is: Xcode > Preferences > Downloads > Components
3. Click the Install button on the right side of Command line Tools
The process of installing Xcode and Command line Tools is very long and patient, and after installation you have the MAC make && make install feature.

In the second step, some commonly used packages, some of which are YAF dependent, are installed, and the installation steps are as follows:

# First download the required source code.
Curl-o ftp://ftp.gnu.org/gnu/m4/m4-1.4.16.tar.bz2
Curl-o ftp://ftp.gnu.org/gnu/autoconf/autoconf-2.68.tar.bz2
Curl-o ftp://ftp.gnu.org/gnu/automake/automake-1.11.1.tar.bz2
Curl-o ftp://ftp.gnu.org/gnu/libtool/libtool-2.4.tar.gz
Curl-o ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.30.tar.gz
Curl-o http://pecl.php.net/get/yaf-2.1.16.tgz

# M4
Tar xjf m4-1.4.16.tar.bz2
CD m4-1.4.16
./configure--prefix=/usr/local
Make clean && make-j4 && make Install-strip
Cd..
RM-RF m4-1.4.16

# autoconf
Tar xjf autoconf-2.68.tar.bz2
CD CD autoconf-2.68
./configure--prefix=/usr/local
Make clean && make-j4 && make Install-strip
Cd..
RM-RF autoconf-2.68

# Automake
Tar xjf automake-1.11.1.tar.bz2
CD automake-1.11.1
./configure--prefix=/usr/local
Make clean && make-j4 && make Install-strip
Cd..
RM-RF automake-1.11.1

# Libtool
Tar xjf libtool-2.4.tar.gz
CD libtool-2.4
./configure--prefix=/usr/local
Make clean && make-j4 && make Install-strip
Cd..
RM-RF libtool-2.4

# PCRE
Tar xzf pcre-8.30.tar.gz
CD pcre-8.30
./configure--prefix=/usr/local--enable-utf8
Make clean && make && make install
Cd..
RM-RF pcre-8.30

Step three, install Yaf to MacOS
Download YAF, the address is: PECL.PHP.NET/PACKAGE/YAF, and then execute the command:
Tar-xzf yaf-2.1.16.tgz
CD yaf-2.1.16
/applications/xampp/xamppfiles/bin/phpize
./configure--with-php-config=/applications/xampp/xamppfiles/bin/php-config
Make && make install

Restart XAMPP, open phpinfo () see if there's a yaf?
If you have YAF, congratulations, the installation is over.

When I finished the above steps, I still did not show the YAF, so I was troubled a day (sometimes a problem tangled too long, only the last one can Pierce).
The cause of the problem is my macos,64 bit, and the PHP extension needs to be 32 bit, try to add a parameter in./configure, the problem is done.
/applications/xampp/xamppfiles/bin/phpize
./configure cflags= "-arch i386"--with-php-config=/applications/xampp/xamppfiles/bin/php-config
Make && make install

Again, according to my method, it is possible that you still can not solve the problem, because the system environment this thing, is really various, through the results, I summed up the solution to the problem, is in the./configure on the way to find a breakthrough, you can according to their own problems under Google (Baidu in the time of less information, it appears that some deficiencies )。

Install Yaf to Mac

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.