Home > Backend Development > PHP7 > How to install Phalcon framework for PHP7?

How to install Phalcon framework for PHP7?

coldplay.xixi
Release: 2023-02-17 15:56:02
forward
3596 people have browsed it

How to install Phalcon framework for PHP7?

What is Phalcon?

Phalcon is an open source, full-featured stack, PHP 5 framework written using C extensions and optimized for high performance. Developers do not need to learn and use the functions of C language, because all functions are exposed in the form of PHP classes and can be used directly. Phalcon is also loosely coupled, so you can use other objects as needed for your project.

The current stable version of Phalcon is 2.0. It supports PHP versions from 5.3 to 5.6 and does not support PHP7. 2.1.x is a beta version that supports PHP7. Therefore, if you want to use Phalcon for production environment, please use 5.6.

Installing Zephir

Phalcon2.1.x, which supports PHP7 version, does not support normal compilation and installation and can only be installed through zephir. Therefore, before installing phalcon, please install Zephire first. The installation method is as follows:

$zypper in re2c #Opensuse 安装zephir解释器
$git clone https://github.com/phalcon/zephir.git
$cd zephir
$./install -c #-c表示全局安装,需要root密码
Copy after login

Other versions of Linux can search and install re2c by themselves, and Mac can also install it through brew.
After the installation is completed, you can view the relevant command parameters and functions through the zephir command

Compile and install phalcon

Please confirm before compilingwhich php And which phpize points to the PHP7 version
The installation code is as follows:

git clone http://github.com/phalcon/cphalcon
cd cphalcon
git checkout 2.1.x
zephir build --backend=ZendEngine3
Copy after login

After compilation is completed, extension=phalcon.so will be added to php.iniFile, restart php-fpm and nginx (I installed lnmp).
You can check whether the installation is successful through php -i|grep phalcon, or you can check through the web page output phpinfo()

Reference materials

zephir
#11635
Phalcon 2.1.0 RC1 released

Recommended tutorial: "php tutorial"

The above is the detailed content of How to install Phalcon framework for PHP7?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:segmentfault.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template