在Unbuntu 上安装Phalcon

Phalcon是一个用C实现的扩展,因此您能够下载适合您机器的二进制格式文件或者使用源代码进行编译。php

Ubuntu

若是要再Unbuntu上安装Phalcon,请按照如下步骤操做:python

sudo apt-add-repository ppa:phalcon/stable
sudo apt-get update
sudo apt-get install php5-phalcon

If you wish to install the legacy version of Phalcon (1.x) use the following PPA:mysql

sudo apt-add-repository ppa:phalcon/legacy

若是你没有apt-add-repository请执行如下command:git

# Ubuntu 14.04+
sudo apt-get install software-properties-common

# Ubuntu 12.04
sudo apt-get install python-software-properties

编译

Linux下,使用源代码编译安装是很方便的。github

安装要求

咱们须要提早安装一些库:web

  • PHP 5.x 开发工具包sql

  • GCC 编译器服务器

#Ubuntu
    sudo apt-get install php5-dev php5-mysql gcc libpcre3-dev

#Fedora
    sudo yum install php-devel php-mysqlnd gcc libtool

#RHEL
    sudo yum install php-devel php-mysql gcc libtool

#Suse
    yast2 -i php5-pear php5-devel php5-mysql gcc

#OS X (Using Homebrew)
    brew tap homebrew/dupes
    brew tap homebrew/versions
    brew tap homebrew/php
    brew install php5x php5x-phalcon # Where "x" - minor number of PHP

编译

1. 从C源代码建立扩展请按照下面的步骤:工具

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

2. 添加扩展到php.ini文件:开发工具

extension=phalcon.so

3. 最后,重启web服务器

相关文章
相关标签/搜索