Install yaf on mac

Source: Internet
Author: User
Tags automake
The installation process is a bit tortuous, And the bitterness will not be mentioned .. I tried a variety of methods for two or three hours, and the results could not be sorted out correctly. So I posted some clips and hoped to help those who needed them. 1 MAC quick install PHP framework Yaf reference Yaf is the domestic PHP Laruence extension development framework based on PHP. Main features

The installation process is a bit tortuous, And the bitterness will not be mentioned .. I tried a variety of methods for two or three hours, and the results could not be sorted out correctly. So I posted some clips and hoped to help those who needed them. 1. quick installation of the PHP framework in Mac Yaf reference Yaf is a framework developed based on PHP extension by Laruence, a domestic PHP master. Main features

The installation process is a bit tortuous, And the bitterness will not be mentioned ..
I tried a variety of methods for two or three hours, and the results could not be sorted out correctly. So I posted some clips and hoped to help those who needed them.

1. Install the PHP framework Yaf quickly on Mac

Reference

Yaf is a framework developed based on PHP extension by Laruence, the PHP master in China. The main feature is high speed and efficiency, which is much higher than the performance of the framework developed using PHP code. According to the great god, the TPS has been increased by 76 age points since Sina Weibo was used. For more information, see the Yaf homepage. Installing open-source software and server software on Mac is certainly not as good as Ubuntu apt-get, but there are also excellent package managers such as MacPorts and HomeBrew. I am currently using the latter, because it is easier to use, you can focus on what needs to be focused. Recently, Yaf is ready for development in several projects, so I submitted the Yaf Brew script. If you are interested, you can also contribute some useful PHP Brew to make it easy for everyone to use. For details, refer to the homebrew-php project for Brew installation. Basically, the previous command is done. For details, refer to HomeBrew installation.

Ruby <(curl-fsSkL raw.github.com/mxcl/homebrew/go)

Next we need to tap the PHP Brew library locally (most common php extensions can be installed in the homebrew-php project)

Brew tap maid/homebrew-php

If you tap, you only need to execute

Brew update

Then, you only need to execute

Brew install php53-yaf // if it is 5.4, use the php54-yaf

(Note: You need to modify the php. ini file to add the extension path)



I followed the operation above and the result could not be loaded, but this should be a better description.
Click here to view the original article.

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

Reference

Installing Yaf (PHP) Extension on Mac is a tangled process that has plagued me for several days. By default, the system does not support make, and there is no yum/apt-get (note: macPort, the experiment proves that it is not easy to use, too much difference). After a few days, Yaf has finally been compiled into Mac PHP, And I will share this process with you.
If you still cannot complete MacOS Yaf compilation through this tutorial, you can go to the Yaf QQ Group for help. The 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)

Step 1: Download the integrated development environment XAMPP
(Of course, you can also compile the source code or the built-in Mac, in: System Preference> Web Sharing, because it is not the focus of this article, it will not be introduced)
XAMPP: www.apachefriends.org/zh_cn/xampp-macosx.html
The installation method will not be written, and the website is often detailed,
Please remember to download the Developer package (used to compile PHP extensions)

After the environment is installed, I encountered the first problem. Mac OS does not have yum/apt-get, and cannot./configure or make
Solution:
1. Install Xcode and get it free of charge in App Store
2. Open Xcode and choose Xcode> Preferences> Downloads> Components.
3. Click the Install button on the Right of Command Line Tools.
The installation of Xcode and Command Line Tools takes a long time and is patient. After installation, you will have the Mac make & make install function.

Step 2: install some commonly used packages that Yaf depends on. The installation steps are as follows:

# Download all the required source code first
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 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 install
Cd ..
Rm-rf pcre-8.30

Step 3: Install Yaf to MacOS
Download YAF at pecl.php.net/package/yaf. then run the following 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 and open phpinfo () to check if Yaf exists?
If Yaf exists, congratulations, the installation is complete.

When I completed the above steps, I still did not display Yaf, so I had a hard time for another day (sometimes a problem had to be tangled for too long, so I could just crack it in the end ).
The cause of the problem is my MacOS, 64-bit, And the PHP extension needs to be 32-bit. I tried to add a parameter in./configure, and the problem was solved.
/Applications/XAMPP/xamppfiles/bin/phpize
./Configure CFLAGS = "-arch i386" -- with-php-config =/Applications/XAMPP/xamppfiles/bin/php-config
Make & make install

In addition, according to my methods, you may still be unable to solve the problem, because the system environment is really diverse. Through the results, I will summarize the solutions to the problem, yes. /configure to find a way to break through, You can Google according to your own problems (Baidu seems somewhat inadequate when there is little information ).

Finally, I would like to thank laruence, zike, Demon, mini, and other enthusiastic friends... ^_^



This reference does not work either, but the installation of the corresponding content is still suitable for reference, maybe it is my step.

3. You can also try to compile and install

View the official http://yaf.laruence.com/ma...
You can see yaf in phpinfo.

Original article address: Install yaf on mac. Thank you for sharing it with me.

Related Article

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.