安装依赖
apt-get install gcc libpcre3 libpcre3-dev libxml2 libxml2-dev build-essential openssl libssl-dev libcurl4-gnutls-dev libjpeg-dev libpng-dev libmcrypt-dev libreadline6 libreadline6-dev libgd-dev libxslt-dev autoconf
mysql数据库(1,2,3可忽略)
1 wget http://repo.mysql.com//mysql-apt-config_0.7.3-1_all.deb
2 dpkg -i mysql-apt-config_0.7.3-1_all.deb
3 apt-get update
4 apt-get install mysql-server
5 service mysql status
6 service mysql start / stop /restart
note:修改配置
my.cnf bind-address
修改密码
mysqladmin -u root -p password hufeng
查询用户
SELECT DISTINCT CONCAT('User: ''',user,'''@''',host,''';') AS query FROM mysql.user;
添加用户
CREATE USER 'hufeng' IDENTIFIED BY '12345678';
远程访问
GRANT ALL PRIVILEGES ON *.* TO 'hufeng'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;
nginx
apt-get install nginx
1 wget http://nginx.org/download/nginx-1.11.1.tar.gz
2 ./configure --prefix=/usr/local/nginx --conf-path=/etc/nginx/nginx.conf --with-http_ssl_module
3 make && make install
4 cp /usr/local/nginx/sbin/nginx /usr/local/bin/
5 nginx , nginx -s reload / stop
php
1 wget http://php.net/distributions/php-7.0.7.tar.gz
2 tar -zxvf php-7.0.7.tar.gz
3 ./configure --prefix=/usr/local/php7 --with-config-file-path=/usr/local/php7/etc --with-pear --with-pdo-mysql --with-mysqli --enable-libxml --enable-soap --enable-zip --enable-shmop --enable-mbstring --enable-sockets --with-mcrypt --with-gd --with-jpeg-dir --with-png-dir --enable-fpm --with-curl --with-freetype-dir --with-openssl --enable-pcntl --with-zlib --enable-bcmath
4 make && make install
5 cp php.ini-development /usr/local/php7/etc/php.ini
6 cp /usr/local/php7/etc/php-fpm.conf.default php-fpm.conf
7 cp /usr/local/php7/sbin/php-fpm /usr/local/bin/ ; cp /usr/local/php7/bin/php /usr/local/bin/; cp /usr/local/php7/bin/php-config /usr/local/bin/; cp /usr/local/php7/bin/phpize /usr/local/bin/
8 打开 php.ini: 定位到 cgi.fix_pathinfo= 并将其修改为:cgi.fix_pathinfo=0
9 修改 php-fpm.conf 配置文件,确保 php-fpm 模块使用 www-data 用户和 www-data 用户组的身份运行
vim /usr/local/etc/php-fpm.conf
user = www-data
group = www-data
常用命令 php --ini,php -m,php-fpm,kill -USR2 xxxx(重启php-fpm)
10 新版PHP默认端口不是9000,自行修改,或则NGINX502
#ubuntu 最新php源
apt-cache search php #查看PHP版本
https://blog.csdn.net/mrwangweijin/article/details/79499128
#解决有可能存在的语言问题
sudo apt install -y language-pack-en-base
sudo locale-gen en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
#添加php的仓库
sudo apt-get install -y software-properties-common
#中途按下回车,添加源
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
#一键安装
apt-get install php7.4 php7.4-fpm php7.4-dev php7.4-curl php7.4-gd php7.4-gmp php7.4-json php7.4-mysql php7.4-opcache php7.4-readline php7.4-sqlite3 php7.4-tidy php7.4-xml php7.4-bcmath php7.4-bz2 php7.4-intl php7.4-mbstring php7.4-mcrypt php7.4-soap php7.4-xsl php7.4-zip php7.4-redis
#镜像php源码包
http://mirrors.sohu.com/php/
注意php.ini中 memory_limit
REDIS
apt-get install redis-server
swoole扩展
1 wget https://github.com/swoole/swoole-src/archive/v2.2.0.tar.gz
2 ./configure --with-php-config=/usr/local/bin/php-config
3 make && make install
4 extension=swoole.so
5 mac m1芯片 参考 https://www.cnblogs.com/wxvirus/p/14696984.html
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。