swoole 相關

安裝虛擬機

VMware Workstation Pro

安裝CentOS

CentOS-7-x86_64-Minimal-1708.iso

安裝FinalShell

教程地址php

安裝lnmp

教程地址
服務狀態管理命令html

一、安裝lnmp
二、安裝memcache、redis
三、安裝opcache
四、安裝swoole
五、添加虛擬主機
六、上傳項目

安裝swoole

pecl install swoolejava

啓動swoole

cd到項目下執行: php index.phpredis

中止swoole

1.查找進程pid編號:netstat -apn | grep 9503 (9503爲啓動swoole時監聽的端口號)spring

執行後會出現:
"tcp        0      0 0.0.0.0:9501            0.0.0.0:*               LISTEN      73731/php"
73731爲pid

2.幹掉進程:kill -9 73731shell

3.幹掉全部php進程:killall phpapache

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.confwindows

centos安裝xdebug

1.首先安裝和你php版本對應的xdebugcentos

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 &
相關文章
相關標籤/搜索