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

Ubuntu or Debian

如果要再Unbuntu上安装Phalcon,请按照以下步骤操作:

curl -s "https://packagecloud.io/install/repositories/phalcon/stable/script.deb.sh" | sudo bash

sudo apt-get install php5-phalcon

# Ubuntu 16.04+, Debian 9+
sudo apt-get install php7.0-phalcon

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

sudo apt-add-repository ppa:phalcon/legacy

如果你没有apt-add-repository请执行以下command:

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

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

编译

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

安装要求

我们需要提前安装一些库:

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

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

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

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

# OS X (Homebrew)
brew tap homebrew/dupes
brew tap homebrew/versions
brew tap homebrew/php
brew install php5x php5x-phalcon # php55, php56, ...

编译

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服务器

Arch Linux

There is a PKGBUILD for ArchLinux, available here

OpenSUSE

There is a package available here (thanks to Mariusz Łączak)

FreeBSD

FreeBSD下,只需要简单的几行命令即可安装:

pkg_add -r phalcon

cd /usr/ports/www/phalcon && make install clean

cPanel

After requests from the community, the cPanel developers released a custom module that allows for installation of Phalcon in cPanel hosted sites. Information can be found here. The module is maintained in Github.

依赖

尽管Phalcon并不直接依赖其他PHP扩展,但还是使用了一部分扩展用于提供某些功能。所使用的扩展如下:

It is not necessary for all the above extensions to be present in the system that has Phalcon installed. You can only install the ones that meet your needs. For instance if you use a MySQL database, then you can only load PDO and PDO/MySQL ignoring the Oracle, SQlite, Postgresql and Mongo.

需要帮助吗?

Have a look at our support page for ways to get support. We will do our best to help you.