Linux 安装
1.安装php
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
yum remove php-common
yum install php72w-common php72w-fpm php72w-opcache php72w-gd php72w-mysqlnd php72w-mbstring php72w-pecl-redis php72w-pecl-memcached php72w-devel
2.启动php-fpm
cd /sbin/;./php-fpm;ps -aux|grep php-fpm
3.杀死进程
killall -9 php
4.安装 composer
curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer
Ubuntu 安装
1.先安装一下这个命令 add-apt-repository
sudo apt-get install software-properties-common
2.添加第三方源
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
3. 安装php
sudo apt-get install php7.4 php7.4-fpm php7.4-mysql php7.4-gd php7.4-mbstring
sudo service php7.4-fpm start
sudo php -v
4. 杀死进程
sudo killall -9 php
composer 常用命令
1.查看版本
composer --version
2.创建ThinkPHP项目
composer create-project topthink/think voip-yy-api
3.运行
php think run
php think run -H tp5.com -p 80
4.添加镜像
composer config -g repo.packagist composer https://php.cnpkg.org
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
5.安装workerman
composer require topthink/think-worker -vvv
6.从当前目录读取 composer.json 文件,处理依赖关系,并安装到 vendor 目录下
composer install