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:
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
./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