Ubuntu 22.04编译安装NGINX 1.24

下载:

wget http://nginx.org/download/nginx-1.24.0.tar.gz

解压缩包:

tar zxf nginx-1.24.0.tar.gz

进入源码目录:

cd nginx-1.24.0

编译安装:

./configure --prefix=/usr/local/nginx --user=test --group=test --with-threads --with-http_ssl_module --with-http_v2_module && make && make install

安装过程中可能出现的报错:

./configure: error: the HTTP rewrite module requires the PCRE library.

解决方法:

apt install libpcre3-dev

Ubuntu 22.04编译安装PHP 8.2

下载:

wget https://www.php.net/distributions/php-8.2.12.tar.gz

解压缩包:

tar zxf php-8.2.12.tar.gz

进入源码目录:

cd php-8.2.12

编译安装:

./configure --prefix=/usr/local/php --with-mysql-sock=/var/lib/mysql/mysql.sock --enable-fpm --with-fpm-user=test --with-fpm-group=test --enable-gd --with-jpeg --with-webp --with-openssl --with-zlib --with-curl --enable-mbstring --with-mysqli --with-freetype --enable-intl --enable-exif --with-zip && make && make install

安装过程中可能出现的报错:

configure: error: no acceptable C compiler found in $PATH
configure: error: The pkg-config script could not be found or is too old
configure: error: Package requirements (libxml-2.0 >= 2.9.0) were not met
configure: error: Package requirements (openssl >= 1.0.2) were not met
configure: error: Package requirements (sqlite3 >= 3.7.7) were not met
configure: error: Package requirements (zlib >= 1.2.0.4) were not met
configure: error: Package requirements (libcurl >= 7.29.0) were not met
configure: error: Package requirements (libpng) were not met
configure: error: Package requirements (libwebp >= 0.2.0) were not met
configure: error: Package requirements (libjpeg) were not met
configure: error: Package requirements (freetype2) were not met
configure: error: C++ preprocessor "/lib/cpp" fails sanity check
configure: error: Package requirements (oniguruma) were not met
configure: error: Package requirements (libzip >= 0.11 libzip != 1.3.1 libzip != 1.7.0) were not met

解决方法:

apt install gcc pkg-config libxml2-dev libssl-dev libsqlite3-dev zlib1g-dev libcurl4-openssl-dev libpng-dev libwebp-dev libjpeg-dev libfreetype-dev g++ libonig-dev libzip-dev

Ubuntu 22.04使用DPKG安装MySQL 8.2

下载:

wget https://dev.mysql.com/get/Downloads/MySQL-8.2/mysql-server_8.2.0-1ubuntu22.04_amd64.deb-bundle.tar

解压缩包:

tar xf mysql-server_8.2.0-1ubuntu22.04_amd64.deb-bundle.tar

安装:

dpkg -i mysql-common_8.2.0-1ubuntu22.04_amd64.deb
dpkg -i mysql-community-client-plugins_8.2.0-1ubuntu22.04_amd64.deb
dpkg -i libmysqlclient22_8.2.0-1ubuntu22.04_amd64.deb
dpkg -i libmysqlclient-dev_8.2.0-1ubuntu22.04_amd64.deb
dpkg -i mysql-community-client-core_8.2.0-1ubuntu22.04_amd64.deb
dpkg -i mysql-community-client_8.2.0-1ubuntu22.04_amd64.deb
dpkg -i mysql-client_8.2.0-1ubuntu22.04_amd64.deb
dpkg -i mysql-community-server-core_8.2.0-1ubuntu22.04_amd64.deb
dpkg -i mysql-community-server_8.2.0-1ubuntu22.04_amd64.deb

安装过程中可能出现的报错:

dpkg: dependency problems prevent configuration of mysql-community-server-core:
 mysql-community-server-core depends on libmecab2 (>= 0.996); however:
  Package libmecab2 is not installed.
 mysql-community-server-core depends on libnuma1 (>= 2.0.11); however:
  Package libnuma1 is not installed.

dpkg: error processing package mysql-community-server-core (--install):
 dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.35-0ubuntu3.4) ...
Errors were encountered while processing:
 mysql-community-server-core

dpkg: dependency problems prevent configuration of mysql-community-server:
 mysql-community-server depends on psmisc; however:
  Package psmisc is not installed.

dpkg: error processing package mysql-community-server (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 mysql-community-server

解决方法:

apt --fix-broken install
apt install psmisc

CentOS Stream 9使用RPM安装MySQL 8.2

下载:

wget https://dev.mysql.com/get/Downloads/MySQL-8.2/mysql-8.2.0-1.el9.x86_64.rpm-bundle.tar

解压缩包:

tar xf mysql-8.2.0-1.el9.x86_64.rpm-bundle.tar

安装:

rpm -ivh mysql-community-common-8.2.0-1.el9.x86_64.rpm
rpm -ivh mysql-community-client-plugins-8.2.0-1.el9.x86_64.rpm
rpm -ivh mysql-community-libs-8.2.0-1.el9.x86_64.rpm
rpm -ivh mysql-community-client-8.2.0-1.el9.x86_64.rpm
rpm -ivh mysql-community-icu-data-files-8.2.0-1.el9.x86_64.rpm
rpm -ivh mysql-community-server-8.2.0-1.el9.x86_64.rpm

初始化:

mysqld --initialize-insecure

启动:

systemctl start mysqld.service

安装过程中可能出现的报错:

error: Failed dependencies:
	/usr/bin/perl is needed by mysql-community-server-8.2.0-1.el9.x86_64
	net-tools is needed by mysql-community-server-8.2.0-1.el9.x86_64

解决方法:

yum install perl net-tools