unzip packagename.zip -d ./dir
tar -zxvf packagename.tar.gz
yum install gcc
yum install -y autoconf
yum install -y pcre pcre-devel
yum install -y zlib zlib-devel
yum install libxml2 libxml2-devel openssl openssl-devel libcurl libcurl-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libmcrypt libmcrypt-devel -y
yum install glibc-headers yum install gcc-c++
在php源碼目錄中執行如下操做
./configure --prefix=/usr/local/php72 --with-mysqli --with-pdo-mysql --with-jpeg-dir --with-png-dir --with-iconv-dir --with-freetype-dir --with-zlib --with-libxml-dir --with-gd --with-openssl --with-mhash --with-curl --with-pear --with-fpm-user=nobody --with-fpm-group=nobody --enable-bcmath --enable-soap --enable-zip --enable-fpm --enable-mbstring --enable-sockets --enable-opcache --enable-pcntl --enable-simplexml --enable-xml --disable-fileinfo --disable-rpath
--with-fpm-user=nobody --with-fpm-group=nobody 設置爲www用戶也能夠
make && make install
cp php.ini-development /usr/local/php72/lib/php.ini
注意目錄的對應,生產環境的爲php.ini-production
在swoole源碼目錄中
/usr/local/php72/bin/phpize
./configure
若是提示:Cannot find php-config. Please use --with-php-config=PATH
則使用: ./configure --with-php-config=/usr/local/php72/bin/php-config
make && make install
php開啓swoole擴展
vim /usr/local/php72/lib/php.ini
搜索";extension=",在最後一個被搜索到的地方添加extension=swoole.so
/usr/local/php72/bin/php -ir | grep swoole
輸出一下內容爲正常:
swoole
swoole support => enabled
swoole.aio_thread_num => 2 => 2
swoole.display_errors => On => On
swoole.fast_serialize => Off => Off
swoole.unixsock_buffer_size => 8388608 => 8388608
swoole.use_namespace => On => On
swoole.use_shortname => On => On
PWD => /root/swoole-src-4.0.1
$_SERVER['PWD'] => /root/swoole-src-4.0.1
在redis源碼目錄
make PREFIX=/usr/local/redis install
在hiredis源碼目錄中
make && make install
建立www組和用戶php
groupadd -r www && useradd -r -g www -s /bin/false -M www
建立緩存目錄html
mkdir /var/tmp/nginx
配置mysql
./configure --prefix=/usr/local/nginx --conf-path=/usr/local/nginx/conf/nginx.conf --pid-path=/usr/local/nginx/conf/nginx.pid --lock-path=/var/lock/nginx.lock --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --with-http_gzip_static_module --http-client-body-temp-path=/var/tmp/nginx/client --http-proxy-temp-path=/var/tmp/nginx/proxy --http-fastcgi-temp-path=/var/tmp/nginx/fastcgi --http-uwsgi-temp-path=/var/tmp/nginx/uwsgi --http-scgi-temp-path=/var/tmp/nginx/scgi --with-http_stub_status_module --with-http_ssl_module --user=www --group=www
2019.01.25 新增安裝時ssl支持
編譯安裝nginx
make && make install
yum install -y libaio libaio-devel bison bison-devel zlib-devel openssl openssl-devel ncurses ncurses-devel libcurl-devel libarchive-devel boost boost-devel lsof wget gcc gcc-c++ make cmake perl kernel-headers kernel-devel pcre-devel
groupadd -r mysql useradd -r -g mysql -s /sbin/nologin -d /usr/local/mysql -M mysql
mkdir -p /usr/local/mysql
mkdir -p /data/mysql
chown -R mysql:mysql /data/mysql
在mariadb源碼目錄
cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \ -DMYSQL_DATADIR=/data/mysql \ -DSYSCONFDIR=/etc \ -DWITHOUT_TOKUDB=1 \ -DWITH_INNOBASE_STORAGE_ENGINE=1 \ -DWITH_ARCHIVE_STPRAGE_ENGINE=1 \ -DWITH_BLACKHOLE_STORAGE_ENGINE=1 \ -DWIYH_READLINE=1 \ -DWIYH_SSL=system \ -DVITH_ZLIB=system \ -DWITH_LOBWRAP=0 \ -DMYSQL_UNIX_ADDR=/tmp/mysql.sock \ -DDEFAULT_CHARSET=utf8 \ -DDEFAULT_COLLATION=utf8_general_ci
從新執行cmake命令須要執行:rm -f CMakeCache.txt
make && make install
在mariadb的安裝目錄(cd /usr/local/mysql/)
mysql
用戶執行腳本, 安裝數據庫到數據庫存放目錄scripts/mysql_install_db --user=mysql --datadir=/data/mysql
輸出如下內容c++
Installing MariaDB/MySQL system tables in '/data/mysql' ...
OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !To do so, start the server, then issue the following commands:
'./bin/mysqladmin' -u root password 'new-password'
'./bin/mysqladmin' -u root -h VM_0_4_centos password 'new-password' gitAlternatively you can run:
'./bin/mysql_secure_installation' githubwhich will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.redisSee the MariaDB Knowledgebase at http://mariadb.com/kb or the
MySQL manual for more instructions. sqlYou can start the MariaDB daemon with:
cd '.' ; ./bin/mysqld_safe --datadir='/data/mysql' 數據庫You can test the MariaDB daemon with mysql-test-run.pl
cd './mysql-test' ; perl mysql-test-run.plPlease report any problems at http://mariadb.org/jira
The latest information about MariaDB is available at http://mariadb.org/.
You can find additional information about the MySQL part at:
http://dev.mysql.com
Consider joining MariaDB's strong and vibrant community:
https://mariadb.org/get-invol...
./bin/mysql_secure_installation
/usr/local/mysql/bin/mysqld --verbose --help /usr/local/mysql/bin/mysql --help
support-files/
能夠用該文件夾中的文件對mysql進行管理
sudo apt-get install -y libxml2-dev build-essential openssl libssl-dev libcurl4-gnutls-dev libjpeg-dev libpng-dev libmcrypt-dev libreadline6 libreadline6-dev curl libfreetype6-dev
./configure --prefix=/usr/local/php7.2 --with-mysqli --with-pdo-mysql --with-jpeg-dir --with-png-dir --with-iconv-dir --with-freetype-dir --with-zlib --with-libxml-dir --with-gd --with-openssl --with-mhash --with-curl --with-pear --with-fpm-user=nobody --with-fpm-group=nobody --enable-bcmath --enable-soap --enable-zip --enable-fpm --enable-mbstring --enable-sockets --enable-opcache --enable-pcntl --enable-simplexml --enable-xml --disable-fileinfo --disable-rpath
sudo make && sudo make install