Phalcon → How to install on CentOS 6.5 on Digital Ocean.


THE INTRO

This is a quick post log on what I did to get Phalcon working on CentOS 6.5 on a Digital Ocean VM. I followed these instructions http://docs.phalconphp.com/en/latest/reference/install.html , however, I ran into some problems with my installs, below is the way I was able to get phalcon to work on my VM.

THE STEPS

  1. Updated all my php and other apps
sudo yum update

2. Then I installed the proper php devel pacakage along with other depencies that were needed for the install by using the command

yum — enablerepo=remi,remi-php54 install php-devel

3. Then I had to also install the gcc package from yum with the following

sudo yum install gcc

4. Then I downloaded the phalcon repo from github.com and ran the following commands

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

If successful it should say something like this in your SSH terminal

Libraries have been installed in:
/var/www/sites/phalcon-test/cphalcon/build/64bits/modules
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR’
flag during linking and do at least one of the following:
— add LIBDIR to the `LD_LIBRARY_PATH’ environment variable
during execution
— add LIBDIR to the `LD_RUN_PATH’ environment variable
during linking
— use the `-Wl,-rpath -Wl,LIBDIR’ linker flag
— have your system administrator add LIBDIR to `/etc/ld.so.conf’
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —
Build complete.
Don’t forget to run ‘make test’.
Installing shared extensions: /usr/lib64/php/modules/
Installing header files: /usr/include/php/
Thanks for compiling Phalcon!
Build succeed: Please restart your web server to complete the installation

5. I followed the instructions and restarted my websever with the following:

sudo service httpd restart

6. I also created a phalcon.ini file to included in the php runtime configuration in the folder /etc/php.d/phalcon.ini. It had the following line:

extension=phalcon.so

6. To make sure Phalcon installed properly, make a dummy php page and use phpinfo() to see if Phalcon is installed and enabled.

7. Once I saw that it has been succesfully installed, I set up my virtual hosts on my apache web server with the following:

<VirtualHost *:80>
DocumentRoot /var/www/phalcon-test/public
ServerName example.com
<Directory “/var/www/phalcon-test/public”>
Options All
AllowOverride All
Allow from all
</Directory>
<IfModule mod_rewrite.c>
<Directory “/var/www/phalcon-test/”>
RewriteEngine on
RewriteRule ^$ public/ [L]
RewriteRule (.*) public/$1 [L]
</Directory>
<Directory “/var/www/phalcon-test/public”>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?_url=/$1 [QSA,L]
</Directory>
</IfModule>
</VirtualHost>

8. I restarted my webserver after changing the httpd.conf file

sudo service httpd restart

9. I got to this point and phalcon began to work for me. This may not work for you, but this worked for me, so I hope it works for you too.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.