webman1.4以上安装与使用

composer 安装
1. 去掉composer代理

composer config -g --unset repos.packagist

说明:有些composer代理镜像不全(如阿里云),使用以上命令可删除composer代理
2、创建项目

composer create-project workerman/webman

3、运行
进入webman目录
debug方式运行(用于开发调试)

php start.php start

daemon方式运行(用于正式环境)

php start.php start -d

windows用户用 双击windows.bat 或者运行 php windows.php 启动

4、访问

浏览器访问 http://ip地址:8787

5.安装数据库ORM
webman数据库默认采用的是 illuminate/database

composer require -W psr/container ^1.1.1 illuminate/database illuminate/pagination illuminate/events symfony/var-dumper

6.验证器
composer有很多验证器可以直接在使用
安装验证器 top-think/think-validate

composer require topthink/think-validate

7.安装ENV

composer require vlucas/phpdotenv

官方链接

Mac Git安装、卸载

通过Homebrew安装

安装完 homebrew 后(可以在本站搜索),使用命令安装Git

brew install git

初始化Git设置
设置username和email

git config --global user.name "username"
git config --global user.email "email"

通过终端命令创建ssh key

ssh-keygen -t rsa -C "eamil"

查看.ssh/id_rsa.pub文件

cat .ssh/id_rsa.pub

卸载Git
查看Git安装位置,使用命令 which -a git
终端运行 sh /usr/local/git/uninstall.sh 卸载

which -a git
 
cd /usr/local
 
cd git
 
sh uninstall.sh

MAC 安装 homebrew 国内镜像

一、安装
1.安装前置(已安装直接跳过)
为了安装 Homebrew,您需要安装 Xcode 命令行工具。如果您从未在 Mac 上使用过终端,则很可能需要安装它。将以下命令粘贴到终端中以安装 Xcode:

xcode-select --install

2.安装Homebrew
要安装 Homebrew,请打开终端并粘贴以下命令:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

根据每个人的网络环境不同,可能无法连接官网安装,或者安装速度极慢,可以在终端粘贴以下命令:

/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"

或者选择其他安装方式(感谢国内源,当然推荐上面傻瓜式安装):

3.卸载Homebrew
卸载 Homebrew 与它的安装方式非常相似。打开终端并粘贴以下命令:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"

该脚本将向您显示它将删除的内容并询问您是否要继续卸载 Homebrew。键入“y”继续卸载。
注意:上述操作会卸载您安装的每个软件包,例如之前使用 brew install git ,卸载后git将无法使用。

如出现错误提示如下:

Warning: formula.json: update failed, falling back to cached version.

检测更新

brew update

重新下载wget

brew install wget

mac下安装composer

检测版本
composer -v

1.下载安装脚本 composer-setup.php 到当前目录(通过终端进入)
php -r "copy('https://install.phpcomposer.com/installer', 'composer-setup.php');

2.安装
php composer-setup.php

3.删除安装脚本
php -r "unlink('composer-setup.php');"

4.将命令添加到全局
sudo mv composer.phar /usr/local/bin/composer