Documentation

內容目录

上一个主题

< Micro Benchmark

下一个主题

XAMPP 下的安装(Installation on XAMPP) >

本页

安装(Installation)

PHP extensions require a slightly different installation method to a traditional php-based library or framework. You can either download a binary package for the system of your choice or build it from the sources.

Phalcon compiles from PHP 5.3.1, but because of old PHP bugs causing memory leaks, we highly recommend you use at least PHP 5.3.11 or greater.
PHP versions below 5.3.9 have several security flaws and these aren’t recommended for production web sites. Learn more

Windows

To use phalcon on Windows you can download a DLL library. Edit your php.ini file and then append at the end:

extension=php_phalcon.dll

Restart your webserver.

The following screencast is a step-by-step guide to install Phalcon on Windows:

Linux/Solaris/Mac

On a Linux/Solaris/Mac system you can easily compile and install the extension from the source code:

基本要求(Requirements)

Prerequisite packages are:

  • PHP 5.3.x/5.4.x/5.5.x development resources
  • GCC compiler (Linux/Solaris) or Xcode (Mac)
  • Git (if not already installed in your system - unless you download the package from GitHub and upload it on your server via FTP/SFTP)

Specific packages for common platforms:

#Ubuntu
sudo apt-get install gcc make git-core libpcre3-dev php5-dev

#Suse
sudo yast -i gcc make php5-devel
#or
sudo zypper install gcc make php5-devel

#CentOS/Fedora/RHEL
sudo yum install git gcc make pcre-devel php-devel

#Solaris
pkg install gcc-45 php-53 apache-php53

编译(Compilation)

Creating the extension:

git clone git://github.com/phalcon/cphalcon.git
cd cphalcon/build
sudo ./install

Add extension to your php configuration:

#Ubuntu: Add this line in your php.ini
extension=phalcon.so

#Centos/RedHat: Add a file called phalcon.ini in /etc/php.d/ with this content:
extension=phalcon.so

Restart the webserver.

Phalcon automatically detects your architecture, however, you can force the compilation for a specific architecture:

sudo ./install 32bits
sudo ./install 64bits
sudo ./install safe

FreeBSD

A port is available for FreeBSD. Just only need these simple line commands to install it:

pkg_add -r phalcon

or

export CFLAGS="-O2 -fno-delete-null-pointer-checks"
cd /usr/ports/www/phalcon && make install clean