php7.2编译安装mysql_编译安装centos7 php7.2 mysql5.7 nginx1.9.9

赵骏奇
2023-12-01

centos7

网卡

cd/etc/sysconfig/network-scripts/TYPE=Ethernet

PROXY_METHOD=none

BROWSER_ONLY=no

BOOTPROTO=staticDEFROUTE=yes

IPV4_FAILURE_FATAL=no

IPV6INIT=yes

IPV6_AUTOCONF=yes

IPV6_DEFROUTE=yes

IPV6_FAILURE_FATAL=no

IPV6_ADDR_GEN_MODE=stable-privacy

NAME=ens160

UUID=90a09195-c24e-401d-bf4e-8c846539b130

DEVICE=ens160

ONBOOT=yes

IPADDR=172.17.1.253GATEWAY=172.17.1.1NETMASK=255.255.255.255DNS1=8.8.8.8DNS2-172.17.1.1关闭firewall

systemctl stop firewalld.service #停止firewall

systemctl disable firewalld.service #禁止firewall开机启动

yum install-y apr* autoconf automake bison bzip2 bzip2* cloog-ppl compat* cpp curl curl-devel fontconfig fontconfig-devel freetype freetype* freetype-devel gcc gcc-c++ gtk+-devel gd gettext gettext-devel glibc kernel kernel-headers keyutils keyutils-libs-devel krb5-devel libcom_err-devel libpng libpng-devel libjpeg* libsepol-devel libselinux-devel libstdc++-devel libtool* libgomp libxml2 libxml2-devel libXpm* libxml* libtiff libtiff* make mpfr ncurses* ntp openssl openssl-devel patch pcre-devel perl php-common php-gd policycoreutils telnet t1lib t1lib* nasm nasm* wget zlib-devel

yum-y groupinstall "Development Tools"yum install-y gcc gcc-c++ make cmake automake autoconf gd filebison patch mlocate flex \

diffutils zlib zlib-devel pcre pcre-devel \

libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel \

glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel \

ncurses ncurses-devel curl curl-devel libcurl libcurl-devel e2fsprogs e2fsprogs-devel \

krb5 krb5-devel openssl openssl-devel \

openldap openldap-devel nss_ldap openldap-clients openldap-servers \

openldap-devellibxslt-devel kernel-devel libtool-libs \

readline-devel gettext-devel libcap-devel php-mcrypt libmcrypt libmcrypt-devel recode-devel

yum install-y libxml2 libxml2* openssl-dev libcurl3-openssl-dev openssl-devel.i686 \

openssl-perl.i686 libcurl-devel.i686 libjpeg-turbo-devel.i686 libpng.i686 libpng-devel.i686l freetype-devel php-gd

yum-y install cmake ncurses ncurses-devel bison bison-devel boost boost-devel

安装MySQL

groupaddmysql #添加mysql组

useradd-g mysql mysql -s /bin/false #创建用户mysql并加入到mysql组,不允许mysql用户直接登录系统

mkdir -p /data/mysql #创建MySQL数据库存放目录

chown -R mysql:mysql /data/mysql #设置MySQL数据库存放目录权限

mkdir -p /usr/local/mysql #创建MySQL安装目录

mkdir -p /usr/local/boost

cd/usr/local/boost

wget http://www.sourceforge.net/projects/boost/files/boost/1.59.0/boost_1_59_0.tar.gz

tar-xvzf boost_1_59_0.tar.gz

编译

cmake \-DCMAKE_INSTALL_PREFIX=/usr/local/mysql\-DMYSQL_DATADIR=/usr/local/mysql/data \-DSYSCONFDIR=/etc \-DWITH_MYISAM_STORAGE_ENGINE=1\-DWITH_INNOBASE_STORAGE_ENGINE=1\-DWITH_MEMORY_STORAGE_ENGINE=1\-DWITH_READLINE=1\-DMYSQL_UNIX_ADDR=/tmp/mysql.sock \-DMYSQL_TCP_PORT=3306\-DENABLED_LOCAL_INFILE=1\-DWITH_PARTITION_STORAGE_ENGINE=1\-DEXTRA_CHARSETS=all \-DDEFAULT_CHARSET=utf8 \-DDEFAULT_COLLATION=utf8_general_ci \-DMYSQL_USER=mysql\-DWITH_DEBUG=0\-DWITH_SSL=system\-DWITH_BOOST=/usr/local/boost

pid=/www/lanmps/php5.6.31/var/run/php-fpm.piderror_log = /www/lanmps/php5.6.31/var/log/php-fpm.loglog_level=notice

[www]

listen= /tmp/php-cgi.sock

listen.backlog = -1listen.allowed_clients = 127.0.0.1listen.owner =www

listen.group =www

listen.mode = 0666user=www

group=www

pm=dynamic

pm.max_children = 80pm.start_servers = 40pm.min_spare_servers = 40pm.max_spare_servers = 80request_terminate_timeout= 100request_slowlog_timeout= 0slowlog= var/log/slow.log

#修改/usr/local/mysql权限

chmod +w /usr/local/mysql

chown -R mysql:mysql /usr/local/mysqlmv/etc/my.cnf /etc/my.cnf.bak

cp./support-files/mysql.server /etc/rc.d/init.d/mysqld#拷贝mysql安装目录下support-files服务脚本到init.d目录

cp support-files/mysql.server /etc/rc.d/init.d/mysqld#赋予权限

chmod +x /etc/rc.d/init.d/mysqld#设置开机启动

chkconfig mysqld on#执行初始化配置脚本,创建系统自带的数据库和表,注意配置文件的路径

./bin/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data

确保/usr/local/mysql/data为空./bin/mysqld --initialize-insecure --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data

vi/etc/my.cnf

[mysqld]

basedir=/usr/local/mysqldatadir=/usr/local/mysql/data

socket=/tmp/mysql.sock

symbolic-links=0[mysqld_safe]

;log-error=/var/log/mariadb/mariadb.logpid-file=/usr/local/mysql/data/localhost.localdomain.pid#修改/etc/profile文件

vi /etc/profile#在文件末尾添加

PATH=/usr/local/mysql/bin:$PATHexport PATH#让配置立即生效

source/etc/profile/usr/local/mysql/bin/mysqladmin -uroot -p password 'root';/usr/local/mysql/bin/mysqladmin -uroot -p password 'root';flushprivileges;

重新授权用户

mysqld--skip-grant-tables 回车--skip-grant-tables 的意思是启动MySQL服务的时候跳过权限表认证

GRANT ALL PRIVILEGES ON*.* TO 'zx'@'%'IDENTIFIED BY 'zx'WITH GRANT OPTION;

GRANT ALL PRIVILEGES ON*.* TO 'root'@'%'IDENTIFIED BY 'root'WITH GRANT OPTION;

nginx安装

yum-y install yasm libmcrypt libvpx tiff libpng freetype jpeg libgd t1lib./configure --prefix=/usr/local/nginx --without-http_memcached_module --user=www --group=www --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module

vi/etc/init.d/nginxchmod +x /etc/init.d/nginx

chkconfig nginx on./configure \--prefix=/usr/local/nginx \--sbin-path=/usr/sbin/nginx \--conf-path=/etc/nginx/nginx.conf \--error-log-path=/var/log/nginx/error.log\--http-log-path=/var/log/nginx/access.log\--pid-path=/var/run/nginx.pid \--lock-path=/var/run/nginx.lock \--http-client-body-temp-path=/var/cache/nginx/client_temp \--http-proxy-temp-path=/var/cache/nginx/proxy_temp \--http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp \--http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp \--http-scgi-temp-path=/var/cache/nginx/scgi_temp \--user=www \--group=www \--with-pcre \--with-http_v2_module \--with-http_ssl_module \--with-http_realip_module \--with-http_addition_module \--with-http_sub_module \--with-http_dav_module \--with-http_flv_module \--with-http_mp4_module \--with-http_gunzip_module \--with-http_gzip_static_module \--with-http_random_index_module \--with-http_secure_link_module \--with-http_stub_status_module \--with-http_auth_request_module \--with-mail\--with-mail_ssl_module \--with-file-aio \--with-ipv6 \--with-http_v2_module \--with-threads \--with-stream \--with-stream_ssl_module

yum-y install libicu-devel

make[2]: *** [progname.o] 错误 1make[2]:正在离开目录 `/home/lmos/libiconv-1.14/srclib'make[1]: *** [all] 错误 2

make[1]:正在离开目录 `/home/lmos/libiconv-1.14/srclib'make: *** [all] 错误 2进入srclib目录 执行 sed-i -e '/gets is a security/d' ./stdio.in.h

Cannot find ldap.h

复制代码 代码如下:yum-y install openldap

yum-y install openldap-devel

configure: error: Cannot find ldap libraries in /usr/lib

复制代码 代码如下:cp-frp /usr/lib64/libldap* /usr/lib/http://www.bkjia.com/PHPjc/1008013.html 参考bug解决办法

yum install-y epel-release

yum install-y libmcrypt-devel

export LD_LIBRARY_PATH=/usr/local/lib:LD_LIBRARY_PATH./configure --prefix=/usr/local/php \--with-config-file-path=/usr/local/php/etc \--with-mysql-sock=/tmp/mysql.sock \--enable-fpm \--with-fpm-user=www \--with-fpm-group=www \--enable-mysqlnd \--with-mysqli=mysqlnd \--with-pdo-mysql=mysqlnd \--enable-mysqlnd-compression-support \--with-iconv-dir\--with-freetype-dir\--with-jpeg-dir\--with-png-dir\--with-zlib \--with-libxml-dir\--enable-xml \--disable-rpath \--enable-bcmath \--enable-shmop \--enable-sysvsem \--enable-inline-optimization \--with-curl \--enable-mbregex \--enable-mbstring \--enable-intl \--with-mcrypt \--with-libmbfl \--enable-ftp \--with-gd \--enable-gd-jis-conv \--enable-gd-native-ttf \--with-openssl \--with-mhash \--enable-pcntl \--enable-sockets \--with-xmlrpc \--enable-zip \--enable-soap \--with-gettext \--enable-fileinfo \--enable-opcache \--with-pear \--enable-maintainer-zts \--with-ldap=shared \--without-gdbm

nodejs

curl--silent --location https://rpm.nodesource.com/setup_8.x | bash - 8是版本系列

yum install -y nodejs

npm install-g cnpm --registry=https://registry.npm.taobao.org

 类似资料: