如何在linux下安装phalcon框架linux 升级php版本本的扩展

Prerequisite packages are:
PHP &= 5.3 development resourcesGCC 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:
sudo apt-get install php5-dev libpcre3-dev gcc make php5-mysql
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
pkg install gcc-45 php-53 apache-php53
Creating the extension:
git clone --depth=1 git:///phalcon/cphalcon.git
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/php5/conf.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
上面的内容来自phalcon的中文指导手册:
安装phalcon之前必须安装php5-dev、libpcre3-dev、gcc、make、php5-mysql这几个库,用于编译phalcon以及phalcon的扩展依赖。
然后,从github上clone代码到本地,进入编译目录bulid,然后开始安装phalcon的扩展。下面就是安装的细节。
$ sudo ./install
find . -name \*.gcno -o -name \*.gcda | xargs rm -f
find . -name \*.lo -o -name \*.o | xargs rm -f
find . -name \*.la -o -name \*.a | xargs rm -f
find . -name \*.so | xargs rm -f
find . -name .libs -a -type d|xargs rm -rf
rm -f libphp.la&&&&&& modules/* libs/*
Cleaning..
Configuring for:
PHP Api Version:&&&&&&&&
Zend Module Api No:&&&&&
Zend Extension Api No:&&
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for icc... no
checking for suncc... no
checking whether gcc and cc understand -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
checking for PHP extension directory... /usr/lib/php5/;lfs
checking for PHP installed headers prefix... /usr/include/php5
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking for gawk... no
checking for nawk... nawk
checking if nawk is broken... no
checking whether to enable phalcon... yes, shared
checking whether HAVE_BUNDLED_PCRE is declared... no
checking whether HAVE_JSON is declared... no
checking how to print strings... printf
checking for a sed that does not truncate output... (cached) /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands &+=&... yes
checking how to convert i686-pc-linux-gnu file names to i686-pc-linux-gnu format... func_convert_file_noop
checking how to convert i686-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking for gawk... (cached) nawk
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for mt... mt
checking if mt is a manifest tool... no
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
configure: creating ./config.status
config.status: creating config.h
config.status: executing libtool commands
/bin/bash /var/www/phalcon/build/32bits/libtool --mode=compile gcc& -I. -I/var/www/phalcon/build/32bits -DPHP_ATOM_INC -I/var/www/phalcon/build/32bits/include -I/var/www/phalcon/build/32bits/main -I/var/www/phalcon/build/32bits -I/usr/include/php5 -I/usr/include/php5/main
-I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64& -DPHALCON_RELEASE -DHAVE_CONFIG_H& -march=native -mtune=native -O2 -fomit-frame-pointer -fvisibility=hidden&&
-c /var/www/phalcon/build/32bits/phalcon.zep.c -o phalcon.lo
libtool: compile:& gcc -I. -I/var/www/phalcon/build/32bits -DPHP_ATOM_INC -I/var/www/phalcon/build/32bits/include -I/var/www/phalcon/build/32bits/main -I/var/www/phalcon/build/32bits -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend
-I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DPHALCON_RELEASE -DHAVE_CONFIG_H -march=native -mtune=native -O2 -fomit-frame-pointer -fvisibility=hidden -c /var/www/phalcon/build/32bits/phalcon.zep.c& -fPIC
-DPIC -o .libs/phalcon.o
/bin/bash /var/www/phalcon/build/32bits/libtool --mode=link gcc -DPHP_ATOM_INC -I/var/www/phalcon/build/32bits/include -I/var/www/phalcon/build/32bits/main -I/var/www/phalcon/build/32bits -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM
-I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64& -DPHALCON_RELEASE -DHAVE_CONFIG_H& -march=native -mtune=native -O2 -fomit-frame-pointer -fvisibility=hidden&& -o phalcon.la -export-dynamic
-avoid-version -prefer-pic -module -rpath /var/www/phalcon/build/32bits/modules& phalcon.lo
libtool: link: gcc -shared& -fPIC -DPIC& .libs/phalcon.o&&& -march=native -mtune=native -O2&& -Wl,-soname -Wl,phalcon.so -o .libs/phalcon.so
libtool: link: ( cd &.libs& && rm -f &phalcon.la& && ln -s &../phalcon.la& &phalcon.la& )
/bin/bash /var/www/phalcon/build/32bits/libtool --mode=install cp ./phalcon.la /var/www/phalcon/build/32bits/modules
libtool: install: cp ./.libs/phalcon.so /var/www/phalcon/build/32bits/modules/phalcon.so
libtool: install: cp ./.libs/phalcon.lai /var/www/phalcon/build/32bits/modules/phalcon.la
libtool: finish: PATH=&/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin& ldconfig -n /var/www/phalcon/build/32bits/modules
----------------------------------------------------------------------
Libraries have been installed in:
&& /var/www/phalcon/build/32bits/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/lib/php5/;lfs/
Installing header files:&&&&&&&&& /usr/include/php5/
Thanks for compiling Phalcon!
Build succeed: Please restart your web server to complete the installation
从上面我们可以得知上那个信息:
1、安装目录以及安装的是多少位的:
Libraries have been installed in:
&& /var/www/phalcon/build/32bits/modules
本次安装在 /var/www/phalcon/下面了,是32位。
2、扩展文件在哪里:
Installing shared extensions:&&&& /usr/lib/php5/;lfs/
这个路径下放着php所有的扩展包文件(.so)
3、header文件在哪里:
Installing header files:&&&&&&&&& /usr/include/php5/
该路径下放着ext 、include、 main 、 sapi& 、TSRM、 Zend等接口。
最后,根据上面的信息,我们还必须将这个扩展文件配置到php的环境中,如果你希望配置到php.ini文件,就打开 /etc/php5/fpm/php.ini文件,将
extension=phalcon.so
添加到该文件即可,重启php5-fpm.
这里我不推荐直接编辑到php.ini文件,可以在/etc/php5/mods-available下面城建一个phalcon.ini文件,内容为extension=phalcon.so,然后建立软链接。
:/etc/php5/cli/conf.d# ln -s ../../mods-available/phalcon.ini 20-phalcon.ini
:/etc/php5/fpm/conf.d# ln -s ../../mods-available/phalcon.ini 20-phalcon.ini
注意,路径已经在php5的安装路径下了。
本文已收录于以下专栏:
相关文章推荐
1:下载和安装Wampserver2.4-x86.exe 服务器; 
2:到phalcon官方网站下载对应的dll文件 phalcon_x86_VC9_php5.4.0_1.2.5 我下的是这个...
前言: 最近不知什么理由用起了Phalcon框架,之前因为有用过Zend FrameWork还有ThinkPHP。因为自己的水平有限,目前无法对什么框架进行批判,只是会有些建议什么的。当然在新的任务来...
phalcon-入门篇8(Model层基础使用2)本教程基于phalcon2.0.9版本前言先在这里感谢各位phalcon技术爱好者,我们提供这样一个优秀的交流平台在上一节我们已经介绍了,phalco...
法尔康!法尔康! 法尔康!
·坑我,坑我,坑我
环境:linux  centos7.0  nginx  php5.5.* 
1. 检查php扩展
官方的github位置 :
http://...
想知道排名前200的电商网站在设计上有什么共同点吗?想知道这些网站是如何在保证一流的更新率同时仍然提供优质的用户体验吗?我们针对200多家电商网站进行了调研,制作了如下最新的图文表格——“200家顶尖...
我用的服务器是ubuntu server 14.04 LTS
按照官网说:
1. 从C源代码创建扩展请按照下面的步骤:
git clone --depth...
在phalcon3.0以后就不支持php5.4了。
但是由于项目需要。很蛋疼的要使用php5.4跟phalcon2.安装
下载解压phalcon2
进入phalcon&build
修改 insta...
phalcon是php的mvc框架,适合大中型项目,对mvc的支持非常好,同时也有相应的一套创建工具。
git clone --depth=1 git:///phalcon/cphalcon.git
cd cphalcon/build/64bits
make clean
phalcon是用c语言写的一个国外框架,以扩展的方式加载运行,从官方简单描述是性能”最快”的php框架,这里介绍在mac环境下如何安装phalcon框架。
可以参考官方安装...
他的最新文章
讲师:姜飞俊
您举报文章:
举报原因:
原文地址:
原因补充:
(最多只允许输入30个字)PhalconDebugbar —— Phalcon 框架调试大杀器
Phalcon 是一款非常火的高性能C扩展 php开发框架. 特点是高性能低耦合. 但遗憾的是长期缺少一款得力的调试辅助工具.今天, 我很高兴地在这里宣布, phalcon也有了专属的debug工具: Phalcon Debugbar. 从今天起phalcon开发者们再也不用羡慕Zf,Laravel,Ci等集成了php debug bar的框架, 因为phalcon已经正式成为了其中一员.这是首次发布的初始版本, 主要以Laravel debugbar的具有功能为蓝本开发, 并针对phalcon的功能特征进行了小幅更改. 未来版本还将针对phalcon的功能进行进一步扩展丰富.源码托管于git.oschina.net, 接受&Issue和Pullrequest. &也可 @朱_朱 反馈发现的问题.源码:&这个扩展包将
与 & 集成在了一起.要感谢 laravel-debugbar, 我从中得到了启发, 使用了其中的一些代码, 经过几天夜以继日的工作, PhpDebugbar 终于可以用在项目上了!我在 Mac/PHP5.6/Phalcon 1.3.4 之下开发, 时间关系, 只在PHP5.4/Linux下测试通过, 其他环境尚未测试, 如果有问题, 欢迎提Issue或者Pull Reqeust.注意: 这是一个开发辅助扩展, 切勿部署生产环境.功能特性常规请求调试信息收集Ajax请求调试信息收集Redirect请求调试信息调试信息本地持久化支持支持 多模块,单模块,微应用.支持收集的调试数据MessagesCollector : 收集自己发送的调试数据TimeDataCollector : 收集时间计算信息MemoryCollector : 请求的内存占用ExceptionsCollector : 异常信息收集QueryCollector: 收集所有SQL查询, 每条SQL的执行时间, SELECT语句的EXPLAIN信息RouteCollector: 收集当前路由的相关信息ViewCollector: &收集当前请求渲染的所有模板, 每个模板的渲染耗时, 赋值到视图的视图变量PhalconRequestCollector: 收集请求头信息, 请求数据, 解密后的cookie, RAW BODY, 以及响应头信息ConfigCollector: 收集 config service中的数据.SessionCollectior 收集session数据SwiftMailCollector 收集邮件发送信息
phalcon-debugbar 的详细介绍:
phalcon-debugbar 的下载地址:
转载请注明:文章转载自 开源中国社区
本文标题:PhalconDebugbar —— Phalcon 框架调试大杀器
本文地址:
引用来自“朱__朱”的评论1. vendor/autoload.php 引入到index.php2. 按照readme中的说明, 把app实例保存到$di[&app&]3. 在handle应用之前, 创建debugbar的provider实例,然后执行注册和启动.okay,我之前好像见过你,在群里。
1. vendor/autoload.php 引入到index.php2. 按照readme中的说明, 把app实例保存到$di[&app&]3. 在handle应用之前, 创建debugbar的provider实例,然后执行注册和启动.
已经在composer里了,github也能找到Mac OS 10.9安装apache+mysql+php详细配置+phalcon/yaf扩展的macos安装方式 | 微度网络
你的位置: &
& Mac OS 10.9安装apache+mysql+php详细配置+phalcon/yaf扩展的macos安装方式
Mac OS 10.9安装apache+mysql+php详细配置+phalcon/yaf扩展的macos安装方式
很早以前的教程就是让共享上开启apache就可以了,但是苹果已经取消了这个选项,现在我们怎么做呢?今天我就讲解开发环境的搭建和使用
1.apache的启用和配置
#启动apache
sudo apachectl start
#配置文件目录
cd /etc/apache2/
#开启虚拟主机
cd /etc/apache2 && sudo vim httpd.conf
#加载php,去掉LoadModule php5_module libexec/apache2/libphp5.so前边的#
LoadModule php5_module libexec/apache2/libphp5.so
#找到如下,去掉Include前边的#
# Virtual hosts
Include /private/etc/apache2/extra/httpd-vhosts.conf
配置虚拟主机
一般我们都是开发用,所以都自己配置自己简单喜欢的就行,我的配置如下,我打算安装phalcon这个扩展
cd /etc/apache2/extra && sudo vim httpd-vhosts.conf
#我的简单配置如下,DocumentRoot是你的目录,ServerName是你的域名
&VirtualHost *:80&
ServerAdmin webmaster@dummy-
DocumentRoot "/Users/widuu/wwwroot/phalcon"
ServerName
&/VirtualHost&
#配置hosts
sudo vim /etc/hosts
127.0.0.1 phalcon
cd /Users/widuu/wwwroot/phalcon && vim index.php
&?php phpinfo();?&
#打开浏览器,输入phalcon,这时候phpinfo的信息就全出来了
2.安装phalcon和yaf扩展
#打开终端先安装命令行开发者工具,如果不安装这个会出现
#include "php.h"
1 error generated.
make: *** [phalcon.lo] Error 1 或者 make: *** [yaf.lo] Error 1的错误
#输入如下命令安装命令行工具
xcode-select --install
phalcon安装方法
git clone --depth=1 git:///phalcon/cphalcon.git
cd cphalcon/build
sudo ./install
yaf安装方法
wget http://pecl.php.net/get/yaf-2.3.2.tgz
tar zxvf yaf-2.3.2.tgz && cd yaf-2.3.2
./configure --with-php-config=/usr/bin/php-config
make && sudo make install
安装完成之后,都会显示一个安装的目录,譬如我的是
Installing shared extensions:
/usr/lib/php/extensions/no-debug-non-zts-/
这个时候你配置php.ini 如果/etc下没有php.ini 你执行如下
cp /etc/php.ini.default /etc/php.ini
sudo chmod 755 /etc/php.ini
sudo vim /etc/php.ini
extension=/usr/lib/php/extensions/no-debug-non-zts-/yaf.so
extension=/usr/lib/php/extensions/no-debug-non-zts-/phalcon.so
#重启apache
sudo apachectl retstart
测试安装是否成功
echo "&pre&";
print_r(get_loaded_extensions());
echo "&/pre&";
如图安装成功
3.mysql安装配置
下载地址:,然后根据自己的系统下载对应的,我下载的Mac OS X 10.7 (x86, 64-bit), DMG Archive
进入下载页面下载
双击打开下载的文件,会有三个文件
mysql-5.6.17-osx10.7-x86_64.pkg
MySQLStartupItem.pkg
MySQL.prefPane
然后依次打开安装,安装好后,在macos中的系统偏好设置会有mysql的图标,这时候我们点击,然后启动mysql就可以了
vim .bash_profile
#点击i进入编辑模式加入下边的代码
export PATH="/usr/local/mysql/bin:$PATH"
#保存退出,执行如下命令
source ~/.bash_profile
修改mysql密码
mysqladmin -u root password '这里填你要设置的密码'
pdf下载文档:/macos.pdf
转载请注明来自,本文标题:
与本文相关的文章视频太卡?试试切换线路
本课时主要讲解了Phalcon框架的设计重点。并明确指出了该框架不适合新手学习。
本课时以CentOS 7为例,在Linux环境下演示如何搭建并配置Phalcon运行环境。
由于大部分开发者采用Windows进行编码,因此这里额外讲解了如何在Windows下搭建Phalcon环境,从而可以更好得开发Phalcon站点。并在最后发布到Linux系统上运行。
只有成为VIP会员才能提问&回复,快吧!如果你还没有账号你可以一个账号。
添加新技术问题
课程 [Linux(CentOS)下搭建Phalcon环境]
中已存在问题
添加新技术问题
问题描述越详细,被解答的速度越快
有新回答时请邮件提醒我
着急,拜托快点
不急,慢慢解决
关联课程 [Linux(CentOS)下搭建Phalcon环境]

我要回帖

更多关于 linux 多版本php 的文章

 

随机推荐