Table Of Contents

Previous topic

< Welcome!

Next topic

Installation on XAMPP >

This Page

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.

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.

Linux/Solaris

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

Requirements

Prerequisite packages are:

  • PHP >= 5.3 development resources
  • GCC compiler (Linux/Solaris)
  • 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 php5-dev libpcre3-dev gcc make php5-mysql

#Suse
sudo yast -i gcc make autoconf2.13 php5-devel php5-pear php5-mysql

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

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

Compilation

Creating the extension:

git clone git://github.com/phalcon/cphalcon.git
git checkout tags/phalcon-v2.0.13
cd cphalcon/build
sudo ./install

Add extension to your php configuration:

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

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

#Ubuntu/Debian: Add a file called 30-phalcon.ini in /etc/php.d/ with this content:
extension=phalcon.so

#Debian with php5-fpm: Add a file called 30-phalcon.ini in /etc/php5/fpm/conf.d/30-phalcon.ini with this content:
extension=phalcon.so

Restart the webserver.

If you are running Debian with php5-fpm, restart it:

sudo service php5-fpm restart

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

cd cphalon/build
sudo ./install 32bits
sudo ./install 64bits
sudo ./install safe

If the automatic installer fails try building the extension manually:

cd cphalcon/build/64bits
export CFLAGS="-O2 --fvisibility=hidden"
./configure --enable-phalcon
make && sudo make install

Mac OS X

On a Mac OS X system you can compile and install the extension from the source code:

Requirements

Prerequisite packages are:

  • PHP >= 5.3 development resources
  • XCode
#brew
sudo brew install php53-phalcon
sudo brew install php54-phalcon
sudo brew install php55-phalcon

#MacPorts
sudo port install php53-phalcon
sudo port install php54-phalcon
sudo port install php55-phalcon

Add extension to your php configuration:

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 --fvisibility=hidden"
cd /usr/ports/www/phalcon && make install clean