Demo of running zanphp on Mac

Source: Internet
Author: User
Tags install php openssl library

Demo of running zanphp on Mac

First into the deep pit of PHP, you need to configure the next zanphp environment to run the next zanphp demo.

Install PHP

Need to install some basic software, install PHP through the brew installation, here the version selected 5.6

Brew tap homebrew/homebrew-phpbrew  install  php56--with-fpm
 

Installing extensions, working with non-mandatory

Brew  Install  --build-from-source  php56-mcrypt                                   brew   Install  php56-redis                                                  brew  install  php56-xdebug             brew    Install  PHP56-APCU

It is possible that the brew download fails with the SS agent and the agent needs to be started and configured in the terminal
Export ALL_PROXY=SOCKS5://localhost:1086

Installing composer
Install composer

Installing zanphp

Zanphp's Git home address

HTTPS://Github.com/youzan/zan
 

Installing the zanphp Plugin

git clone https://github.com/youzan/zan.gitcd zan-extensionphpize. /configure--enable-sockets--enable-async-redis  --enable-OpenSSL make make Install
 

Problems encountered:

    • Configure stage, error


WORKAROUND: brew info curl See if Curl is installed as well as the path, as

/usr/local/cellar/curl/7.54. 1 (3922. 8MB)

, and then modify the CONFIG.M4 to modify the curl path to the current path

 for  in/usr/usr/local/usr/local/cellar/curl/7.54. 1  Do
 
    • Make stage, error
./php_swoole.h:127:2"Enable OpenSSL support, require OpenSSL library. "

Workaround:

Info OpenSSL
 

Get the path to the OpenSSL library:

Find This software need to set:    Ldflags:  -l/usr/local/opt/openssl/lib    -i/usr/local/opt/openssl/include
 

Then modify the CONFIG.M4, find the ldflags, add the corresponding path

ldflags="$LDFLAGS-lpthread-l/usr/local/opt/openssl/lib"
 
Installing Composor

Installation composer ( curl -sS https://getcomposer.org/installer | php )
Execute in root directory

Composer Update
 
Configure PHP.ini

Configure PHP.ini

zanphp. Run_mode =true

Configuration files are typically/usr/local/etc/php/5.6/php.ini

Launch Demo

Start the HTTP server

PHP bin/httpd
 

Visit 127.0.0.1:8030 , you can see the Welcome page

Demo of running zanphp on 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.