Mac PHP增加phalcon框架支持

1.apache的启用和配置

#启动apache
sudo apachectl start

#配置文件目录
cd /etc/apache2/

#开启虚拟主机
cd /etc/apache2 && sudo nano -w httpd.conf

#加载php,去掉LoadModule php5_module libexec/apache2/libphp5.so前边的#
LoadModule php5_module libexec/apache2/libphp5.so

#找到如下,去掉Include前边的#
# Virtual hosts
Include /private/etc/apache2/extra/httpd-vhosts.conf

配置虚拟主机
cd /etc/apache2/extra && sudo vim httpd-vhosts.conf

#我的简单配置如下,DocumentRoot是你的目录,ServerName是你的域名

ServerAdmin webmaster@dummy-host.example.com
DocumentRoot “/Volumes/Dev/dev/http/store”
ServerName phalcon.itseeker.net

#配置hosts

sudo vim /etc/hosts

#添加
127.0.0.1 phalcon.itseeker.net

cd /Volumes/Dev/dev/http/store && nano -w index.php

#写入

#打开浏览器,输入phalcon,这时候phpinfo的信息就全出来了

2.安装falcon

xcode-select –install

curl -O curl -O http://mirrors.kernel.org/gnu/m4/m4-latest.tar.gz
tar -xzvf m4-latest.tar.gz
cd m4-1.4.17
./configure –prefix=/usr/local
make
sudo make install

cd ..
curl -O http://mirrors.kernel.org/gnu/autoconf/autoconf-latest.tar.gz
tar -xzvf autoconf-2.69.tar.gz
cd autoconf-2.69
./configure –prefix=/usr/local
make
sudo make install

cd ..
curl -O http://mirrors.kernel.org/gnu/automake/automake-1.15.tar.gz
tar xzvf automake-1.15.tar.gz
cd automake-1.15
./configure –prefix=/usr/local
make
sudo make install

cd ..
curl -O http://mirrors.kernel.org/gnu/libtool/libtool-2.4.6.tar.gz
tar xzvf libtool-2.4.6.tar.gz
cd libtool-2.4.6
./configure –prefix=/usr/local
make
sudo make install

curl -O http://pkgconfig.freedesktop.org/releases/pkg-config-0.29.1.tar.gz -o pkg-config-0.29.1.tar.gz
tar -zxvf pkg-config-0.29.1.tar.gz
cd pkg-config-0.29.1
./configure –with-internal-glib
make && sudo make install

curl -O http://ncu.dl.sourceforge.net/project/pcre/pcre/8.38/pcre-8.38.tar.bz2
tar -xvf pcre-8.38.tar.bz2
cd pcre-8.38
./configure –with-internal-glib
make && sudo make install

禁用SIP保护机制
重启系统
按住Command + R
菜单“实用工具” ==>> “终端” ==>> 输入csrutil disable;执行后会输出:Successfully disabled System Integrity Protection. Please restart the machine for the changes to take effect.
再次重启系统
禁止掉SIP后,就可以顺利的安装了,当然装完了以后你可以重新打开SIP,方法同上,只是命令是csrutil enable

git clone –depth=1 git://github.com/phalcon/cphalcon.git
cd phalcon/cphalcon/build
sudo ./install

关于Zeno Chen

本人涉及的领域较多,杂而不精 程序设计语言: Perl, Java, PHP, Python; 数据库系统: MySQL,Oracle; 偶尔做做电路板的开发,主攻STM32单片机
此条目发表在Mac分类目录。将固定链接加入收藏夹。