Linux centos7下php安装cphalcon扩展的方法

来源:深圳沃龙软件开发公司     2020-09-25

说明:

操作系统:CentOS7

php安装目录:/usr/local/php

php.ini配置文件路径:/usr/local/php/etc/php.ini

运行环境:LNMP ,PHP7

 

1、安装cphalcon cd /usr/local/src

yum install git#git clone git://github.com/phalcon/cphalcon.git #需要安装安装git软件包(源太慢)

git clone https://gitee.com/mirrors/cphalcon.gitcd /usr/local/src/cphalcon/build/php7/64bits #选择相应的php版本目录/usr/local/php/bin/phpize ./configure --with-php-config=/usr/local/php/bin/php-config make make install

[root@app01 64bits]# make install

Installing shared extensions:     /usr/local/php/lib/php/extensions/no-debug-non-zts-20190902/

Installing header files:          /usr/local/php/include/php/

[root@app01 64bits]# vim /usr/local/php/etc/php.ini

[root@app01 64bits]# service php-fpm restart

Gracefully shutting down php-fpm . done

Starting php-fpm [11-Jun-2020 22:52:53] NOTICE: PHP message: PHP Warning:  Cannot load module 'phalcon' because required module 'psr' is not loaded in Unknown on line 0

done

安装psr

git clone https://github.com/jbboehr/php-psr.git

cd php-psr

find / -name phpize

/usr/local/php/bin/phpize

./configure --with-php-config=/opt/lampp/bin/php-config

make

sudo make install

2、配置php支持cphalcon vi /usr/local/php/etc/php.ini #编辑配置文件,在最后一行添加以下内容 添加

extension=psr.so extension=phalcon.so :wq! #保存退出3、重启php-fpm service php-fpm restart 在phpinfo页面可以看到关于cphalcon的选项,说明安装成功。

或使用

php -m | grep phalcon

phalcon #加载成功 至此,Linux下php安装phalcon扩展教程完成。


本内容皆为 深圳沃龙软件开发公司 原创
如需转载,请注明文章出处和来源网址:http://www.wooolong.com/blog/20.html

全部评论

Lucille | 2024-08-10

You can certainly see your skills in the work you write. The arena hopes for more passionate writers such as you who aren't afraid to mention how they believe. All the time follow your heart.

Reply

发表评论