ubuntu环境搭建【开发备用】

24 篇文章 0 订阅
23 篇文章 0 订阅

#php

sudo apt install php

sudo apt install php-fpm php-curl php-gd php-xml php-mbstring php-dev php-zip php-amqp

sudo apt intstall php-redis

注:在Ubuntu20.04  php7.4 时报错,使用 pecl install redis 一路回车  然后编辑php配置文件添加extension=redis.so

#swoole

# 准备工作
sudo apt-get install libpcre3 libpcre3-dev
sudo apt-get install libcurl4-openssl-dev
sudo apt-get install libc-ares-dev
#安装openssl
sudo apt isntall openssl
#安装nghttp2
sudo apt install nghttp2
#WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
#更新pecl
sudo pecl channel-update pecl.php.net
#WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
#安装更新rec2
sudo apt install re2c
#configure: error: in `/tmp/pear/temp/pear-build-rootYHXkjq/swoole-4.5.0':
#configure: error: C++ preprocessor "/lib/cpp" fails sanity check
#See `config.log' for more details
#ERROR: `/tmp/pear/temp/swoole/configure --with-php-config=/usr/bin/php-config --enable-sockets=yes --enable-openssl=yes --enable-http2=yes --enable-mysqlnd=yes' failed
#安装g++
sudo apt install build-essential
sudo apt install g++
#安装swoole扩展
sudo pecl install swoole
enable sockets supports? [no] : yes
enable openssl support? [no] : yes
enable http2 support? [no] : yes
enable mysqlnd support? [no] : yes

# php --ini 查看php生效的配置文件
# 一种方法:将 extension=swoole.so 写入配置文件最后
# 第二种方法
sudo vim /etc/php/7.4/mods-available/swoole.ini
#写入
; configuration for php swoole module
; priority=30//这个值要比别的高
extension=swoole.so

# 创建软链接
sudo ln -s /etc/php/7.4/mods-available/swoole.ini /etc/php/7.4/cli/conf.d/30-swoole.ini

# 检验成果
php --ri swoole
php --ini

# 其他错误参考官方文档
# https://wiki.swoole.com/#/question/install

#Nginx

sudo apt install nginx

#mysql8.0

sudo apt install mysql-server mysql-client

# 跳过数据库权限验证
sudo echo 'skip-grant-tables' > /etc/mysql/mysql.conf.d/mysqld.cnf

sudo service mysql restart

sudo cat /etc/mysql/debian.cnf

# 找出默认的登录名和密码

mysql -udebian-sys-maint -p

>use mysql

>flush privilieges;

>ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'A111b222c333';

>flush privilieges;

>quit

sudo vim etc/mysql/mysql.conf.d/mysqld.cnf

删除刚才添加的skip-grant-tables

sudo service mysql restart

#Redis

sudo apt install redis-server

#composer

sudo apt install composer
#阿里云镜像
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/

#GIT

sudo apt install git

安装rabbitMQ  查看此教程

#谷歌浏览器

sudo wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb 
sudo dpkg -i google-chrome-stable_current_amd64.deb 
sudo apt install google-chrome-stable

#node  v12.16 、npm、yarn

curl -sL http://nsolid-deb.nodesource.com/nsolid_setup_3.x | sudo bash -
sudo apt-get -y install nsolid-erbium nsolid-console
sudo apt remove cmdtest
sudo apt remove yarn
sudo curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
sudo echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update  
sudo apt install yarn
#加速
npm config set registry=https://registry.npm.taobao.org
yarn config set registry 'https://registry.npm.taobao.org'

#phpstorm

sudo snap install phpstorm --classic

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值