首页 > 作文

PHP7 安装 Swoole 教程

更新时间:2023-04-08 13:53:11 阅读: 评论:0

php7 源码安装

步骤

1、解压 tar -xjvf

2、configure

3、make

4、make install

安装上传下载命令

yum install -y lrzsz

  

linux 操作

[root@vm_0_5_centos ~]# cd /home/[root@vm_0_5_centos home]# mkdir -p work/study/softpackage[root@vm_0_5_centos softpackage]# pwd/home/work/study/softpackage[root@vm_0_5_centos softpackage]# lltotal 14900-rw-r--r-- 1 root root 15235268 apr  2 21:19 php-7.2.29.tar.bz2[root@vm_0_5_centos softpackage]# tar -xjvf php-7.2.29.tar.bz2drwxrwxr-x 14 root root     4096 mar 17 18:16 php-7.2.29-rw-r--r--  1 root root 15235268 apr  2 21:19 php-7.2.29.tar.bz2[root@vm_0_5_centos softpackage]# cd php-7.2.29/[root@vm_0_5_centos php-7.2.29]# yum install gcc----configure: error: libxml2 not found. plea check your libxml2 installation.----//start安装豪华套餐yum -y install gcc libxml2 yum -y install php-mcrypt libmcrypt libmcrypt-devel autoconf freetype gd jpegsrc libmcrypt libpng libpng-devel libjpeg libxml2 libxml2-devel//end[root@vm_0_5_centos php-7.2.29]# ./configure -四非大学-prefix=/home/work/study/soft/php[root@vm_0_5_centos php-7.2.29]# make[root@vm_0_5_centos php-7.2.29]# make install[root@vm_0_5_centos php-7.2.29]# cd /home/work/study/[root@vm_0_5_centos study]# lltotal 8drwxr-xr-x 3 root root 4096 apr  2 22:04 softdrwxr-xr-x 3 root root 4096 apr  2 21:44 softpackage[root@vm_0_5_centos study]# cd soft/php/[root@vm_0_5_centos php]# [root@vm_0_5_centos php]# ./bin/php -m//测试[root@vm_0_5_centos php]# vim test.php[root@vm_0_5_centos php]# ./bin/php test.php 1585836467[root@vm_0_5_centos php]# //编辑[root@vm_0_5_centos php]# vi ~/.bash_profile# .bash_profile# get the alias and functionsif [ -f ~/.bashrc ]; then . ~/.bashrcfi# ur specific environment and startup programspath=$path:$home/binexport pathalias php=/home/work/study/soft/php/bin/php//让配置生效[root@vm_0_5_centos php]#  source ~/.bash_profile [root@vm_0_5_centos php]# php -vphp 7.2.29 (cli) (built: apr  2 2020 22:03:18) ( nts )copyright (c) 1997-2018 the p精华液的用法hp groupzend engine v3.2.0, copyright (c) 1998-2018 zend technologies//测试[root@vm_0_5_centos study]# mkdir demo[root@vm_0_5_centos study]# cd demo/[root@vm_0_5_centos demo]# vim t.php[root@vm_0_5_centos demo]# php t.php1585836787[root@vm_0_5_centos demo]# pwd/home/work/study/demo

  

转移 php.ini

[root@vm_0_5_centos study]# cd softpackage/php-7.2.29/[root@vm_0_5_centos php-7.2.29]# pwd/home/work/study/softpackage/php-7.2.29[root@vm_0_5_centos php-7.2.29]# cp php.ini-development /home/work/study/soft/php/etc/[root@vm_0_5_centos ~]# cd /home/work/study/soft/php/etc/[root@vm_0_5_centos etc]# lltotal 80-rw-r--r-- 1 root root  1354 apr  2 22:05 pear.conf-rw-r--r-- 1 root root 71232 apr  2 22:17 php.ini-development[root@vm_0_5_centos etc]# mv php.ini-development php.ini[root@vm_0_5_centos php-7.2.29]# php -i | grep php.iniconfiguration file (php.ini) path => /home/work/study/soft/php/lib[root@vm_0_5_centos php-7.2.29]# cd /home/work/study/soft/php/[root@vm_0_5_centos php]#  mv ./etc/php.ini ./lib/

  

上传 swoole 文件包

[root@vm_0_5_centos softpackage]# rz[root@vm_0_5_centos softpackage]# lltotal 17076drwxrwxr-x 17 root root     4096 apr  2 21:55 php-7.2.29-rw-r--r--  1 root root 15235268 apr  2 21:19 php-7.2.29.tar.bz2-rw-r--r--  1 中国地名root root  2217161 apr  2 22:27 swoole-swoole-master.zip[root@vm_0_5_centos softpackage]# unzip swoole-swoole-master.zip [root@vm_0_5_centos softpackage]# lltotal 17080drwxrwxr-x 17 root root     4096 apr  2 21:55 出纳管理php-7.2.29-rw-r--r--  1 root root 15235268 apr  2 21:19 php-7.2.29.tar.bz2drwxr-xr-x  9 root root     4096 jan  9 20:06 swoole-rw-r--r--  1 root root  2217161 apr  2 22:27 swoole-swoole-master.zip//生成configure文件[root@vm_0_5_centos swoole]# /home/work/study/soft/php/bin/phpizeconfiguring for:php api version:         20170718zend module api no:      20170718zend extension api no:   320170718[root@vm_0_5_centos swoole]# ./configure --with-php-config=/home/work/study/soft/php/bin/php-configchecking how to run the c++ preprocessor... /lib/cppconfigure: error: in `/home/work/study/softpackage/swoole':configure: error: c++ preprocessor "/lib/cpp" fails sanity checke `config.log' for more details//说明error: c++ preprocessor "/lib/cpp" fails sanity check 问题的解决 问题的根源是缺少必要的c++库。如果是centos系统,运行,如下命令解决: yum install glibc-headers yum install gcc-c++

  

再执行

[root@vm_0_5_centos swoole]# ./configure --with-php-config=/home/work/study/soft/php/bin/php-config[root@vm_0_5_centos swoole]# make[root@vm_0_5_centos swoole]# make install[root@vm_0_5_centos swoole]# cd /home/work/study/soft/php/lib/php/extensions/no-debug-non-zts-20170718/[root@vm_0_5_centos no-debug-non-zts-20170718]# lltotal 17664-rwxr-xr-x 1 root root  3589814 apr  2 22:04 opcache.a-rwxr-xr-x 1 root root  1979620 apr  2 22:04 opcache.so-rwxr-xr-x 1 root root 12488337 apr  2 22:41 swoole.so[root@vm_0_5_centos lib]# lltotal 80drwxr-xr-x 15 root root  4096 apr  2 22:05 php-rw-r--r--  1 root root 71232 apr  2 22:17 php.ini[root@vm_0_5_centos lib]# vi php.ini [root@vm_0_5_centos lib]# pwd/home/work/study/soft/php/lib在php.ini文件中添加:extension=swoole.so查看是否添加成功:php -m[root@vm_0_5_centos rver]# php echo.php ^c[root@vm_0_5_centos rver]# pwd/home/work/study/softpackage/swoole/examples/rver//新开窗口[root@vm_0_5_centos rver]# netstat -anp|grep 9501tcp        0      0 0.0.0.0:9501            0.0.0.0:*               listen      23406/php [root@vm_0_硝酸钡化学式5_centos rver]# netstat -anp|grep 9501[root@vm_0_5_centos rver]# pwd/home/work/study/softpackage/swoole/examples/rver 

  

更多学习内容请访问:

腾讯t3-t4标准精品php架构师教程目录大全,只要你看完保证薪资上升一个台阶(持续更新)

本文发布于:2023-04-08 13:53:09,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/zuowen/a1709f65ec5ea87e20b7cb831c9f9fd9.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

本文word下载地址:PHP7 安装 Swoole 教程.doc

本文 PDF 下载地址:PHP7 安装 Swoole 教程.pdf

标签:文件   硝酸钡   命令   化学式
相关文章
留言与评论(共有 0 条评论)
   
验证码:
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图