Edgar Latorre

I'm Edgar and this is my blog where I write about software development.

PHP and Phalcon Framework

04 Sep 2013

I’m working in a php project and I needed to look for some framework. My boss told me about Phalcon and I started trying this framework. In this post I’ll talk about how to install and configure the framework and some adjusts that I did.

Considering that you have apache and php5 configured we need to download the cphalcon and install:

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

Add phalcon extension at php.ini from apache and client.

extension=phalcon.so

Install phalcon-devtools:

git clone https://github.com/phalcon/phalcon-devtools.git
cd phalcon-devtools/
sudo ./phalcon.sh

The phalcon-devtools installation will make a symbolic link to directory phalcon-devtools then you can’t remove this directory.

Now it’s possible to make a new project:

phalcon project myapp simple

We can configure this app to run on apache

<VirtualHost *:80>
  DocumentRoot /Projects/myapp #path to your project
  <Directory /Projects/myapp> #path to your project
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    allow from all
  </Directory>
  ErrorLog ${APACHE_LOG_DIR}/error.log
  LogLevel warn
  CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

It’s very important to allow rewrite with the configuration AllowOverride All.

Now we just need to restart the apache:

/etc/init.d/apache2 restart

Your application should work :)

This post is staying very long I’m stopping here and I’ll write another post about some configurations.

See ya!