swoole 相关

安装虚拟机

VMware Workstation Pro

安装CentOS

CentOS-7-x86_64-Minimal-1708.iso

安装FinalShell

教程地址

安装lnmp

教程地址
服务状态管理命令

1、安装lnmp
2、安装memcache、redis
3、安装opcache
4、安装swoole
5、添加虚拟主机
6、上传项目

安装swoole

pecl install swoole

启动swoole

cd到项目下执行: php index.php

停止swoole

1.查找进程pid编号:netstat -apn | grep 9503 (9503为启动swoole时监听的端口号)

执行后会出现:
"tcp        0      0 0.0.0.0:9501            0.0.0.0:*               LISTEN      73731/php"
73731为pid

2.干掉进程:kill -9 73731

3.干掉所有php进程:killall php

Redis

安装php redis扩展:pecl install redis
reids启动:cd /root/lnmp1.5/src/redis-4.0.6/src
./redis-server ../redis.conf
win启动: redis-server redis.windows.conf

centos安装xdebug

1.首先安装和你php版本对应的xdebug

2.对下载下来的文件进行编译(依次执行下面的命令)

  • tar zxvf xdebug-2.8.0alpha1.tgz

  • cd xdebug-2.8.0alpha1

  • /usr/local/php/bin/phpize

  • ./configure --enable-xdebug --with-php-config=/usr/local/php/bin/php-config

  • make

  • make install

  • 安装成功会出现如下所示:

    +----------------------------------------------------------------------+
    |                                                                      |
    |   INSTALLATION INSTRUCTIONS                                          |
    |   =========================                                          |
    |                                                                      |
    |   See https://xdebug.org/install.php#configure-php for instructions  |
    |   on how to enable Xdebug for PHP.                                   |
    |                                                                      |
    |   Documentation is available online as well:                         |
    |   - A list of all settings:  https://xdebug.org/docs-settings.php    |
    |   - A list of all functions: https://xdebug.org/docs-functions.php   |
    |   - Profiling instructions:  https://xdebug.org/docs-profiling2.php  |
    |   - Remote debugging:        https://xdebug.org/docs-debugger.php    |
    |                                                                      |
    |                                                                      |
    |   NOTE: Please disregard the message                                 |
    |       You should add "extension=xdebug.so" to php.ini                |
    |   that is emitted by the PECL installer. This does not work for      |
    |   Xdebug.                                                            |
    |                                                                      |
    +----------------------------------------------------------------------+
    
    

    3.修改php.ini配置文件 (remote_host为ssh主机地址ip)

    zend_extension=/usr/local/php/lib/php/extensions/no-debug-non-zts-20170718/xdebug.so
    xdebug.remote_enable = on
    xdebug.remote_autostart = 1
    xdebug.remote_port = 9000
    ;xdebug.remote_connect_back = 1
    xdebug.remote_host = 192.168.20.12
    xdebug.auto_trace = 1
    xdebug.collect_includes = 1
    xdebug.collect_params = 1
    xdebug.remote_log = /tmp/xdebug.log
    

vscode 配置

1. vscode连接ssh成功,安装对应的插件
* PHP Debug
* PHP Intelephense

2. 修改settings(注意不是修改本地的,是连接ssh后会出现一个ssh远程的配置文件)
```"php.validate.executablePath": "/usr/bin/php",```

3.f5开启debug访问你的网站就可以了

其它配置

1.centos安装wget

yum -y install wget

yum -y install setup 

yum -y install perl

2.重启fpm

/etc/init.d/php-fpm restart

rocketMq相关

1.rocketMq单机环境安装
2.安装Maven
3.安装jdk1.8
4.搭建rocketMq控制台

启动参数

  • 步骤一,启动 Name Server
nohup sh bin/mqnamesrv > /dev/null 2>&1 &
  • 步骤二,指定 Broker 外网IP
    添加
vi /opt/apache-rocketmq/conf/broker.conf
brokerIP1=192.168.20.12

输入终端执行

export NAMESRV_ADDR=192.168.20.12:9876
  • 步骤三,启动 Broker
nohup sh bin/mqbroker -n 192.168.20.12:9876 > autoCreateTopicEnable=true -c /opt/rocketmq-all-4.5.2-bin-release/conf/broker.conf /dev/null 2>&1 &
  • 步骤四,启动监控页面
nohup java -jar target/rocketmq-console-ng-1.0.1.jar --rocketmq.config.namesrvAddr=192.168.20.12:9876  > /dev/null 2>&1 &
posted @ 2018-10-29 13:44  满猪小星小猪满  阅读(336)  评论(0编辑  收藏  举报