List

To get started with Phalcon, I already have my server stack setup with Ubuntu 16.04, Percona MySQL, Nginx, and PHP 7.0 FPM. If you need a refresher, you can check out my other blog post where I set this stack up for a Laravel web app.

Phalcon Core

To get started, we need to add the Phalcon repository to our system.

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

This script will go through and add the Phalcon keys, add the repo, and update the APT cache. After this, all we will need to do is install the PHP extension.

sudo apt-get install php7.0-phalcon

Reboot PHP FPM.

sudo systemctl php7.0-fpm restart

Now we can create a /info.php file with the contents

<?php phpinfo();

and check in our browser that Phalcon is indeed loaded in.

DevTools

Phalcon also includes a package of tools,┬ácalled the Phalcon DevTools, to aid in development. Let’s install these now.

I will be using the Git install method, but Phalcon DevTools can also be installed with Composer using the instructions on their docs page.

To get started, I will clone the repo into my home folder. You can put this repo wherever you’d like, but you cannot delete or move this folder without reinstalling the DevTools.

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

Now run the installer script:

sudo bash phalcon.sh

The installer will add the current dir to your path, which will enable you to use

phalcon

straight from your terminal. If you are having issues, be sure to log out of your shell session and re-login to load in the new PATH environment variable.

Be sure to check back in a few days where I will go over using models in Phalcon.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  Posts

1 2 3 4
February 28th, 2018

Concluding the February Challenge

Writing every day for the month of February has been an experience, and has changed my perspective on writing tremendously. […]

February 27th, 2018

Cloudflare2DB

Cloudflare stats are very useful, but they expire and can’t be tracked over a long period of time. That’s why […]

February 26th, 2018

Nightly Database Backups to Google Drive

If you have a Google Apps account (a business account with more than 5 users or one provided by your […]

February 25th, 2018

Sublime Text

Sublime Text is a really powerful text editor and includes tons of functionality relevant to programming. I will dive into […]

February 24th, 2018

Great Resources for Student Developers

Being enrolled in a university comes with its pros and cons (a topic itself worthy of many other blog posts), […]

February 23rd, 2018

What is MVC?

MVC is a term thrown around lots of software development projects. Laravel, Zend, CodeIgniter, Ruby on Rails, Django, iOS, and […]

February 22nd, 2018

Getting Started With Phalcon PHP

To get started with Phalcon, I already have my server stack setup with Ubuntu 16.04, Percona MySQL, Nginx, and PHP […]

February 21st, 2018

What is Phalcon?

Phalcon is a modern PHP framework with the typical feature set you’d expect. Database ORM, error handling, MVC architecture, and […]

February 20th, 2018

Setting Up a PHP Development Environment

If you do PHP development, moving to a PHP IDE is extremely beneficial especially when debugging. PHPStorm is a great […]