摘要:源碼安裝文件下載下載源碼下載下載源碼下載下載源碼下載源碼下載源碼下載源碼包解壓命令包解壓命令安裝安裝前的準(zhǔn)備安裝安裝安裝安裝安裝需要的擴(kuò)展安裝安裝時(shí)需要的擴(kuò)展安裝在源碼目錄中執(zhí)行以下操作執(zhí)行命
源碼安裝 1. 文件下載 1.1 下載PHP源碼
php.net
下載 php-7.2.7.tar.gz
https://github.com/swoole/swo...
下載 swoole-src-4.0.1.zip
https://redis.io/download
redis-4.0.10.tar.gz
https://github.com/redis/hire...
hiredis-0.13.3.zip
http://nginx.org/en/download....
nginx-1.15.1.tar.gz
https://downloads.mariadb.org...
mariadb-10.3.8.tar.gz
unzip packagename.zip -d ./dir1.8 tar.gz包解壓命令
tar -zxvf packagename.tar.gz2. 安裝 2.1 安裝前的準(zhǔn)備
安裝GCC
yum install gcc
安裝autoconf
yum install -y autoconf
安裝pcre
yum install -y pcre pcre-devel
安裝zlib
yum install -y zlib zlib-devel
安裝需要的擴(kuò)展
yum install libxml2 libxml2-devel openssl openssl-devel libcurl libcurl-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libmcrypt libmcrypt-devel -y
安裝swoole安裝時(shí)需要的擴(kuò)展
yum install glibc-headers yum install gcc-c++2.2 安裝PHP
在php源碼目錄中執(zhí)行以下操作
執(zhí)行./configure 命令
./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
編譯和安裝
make && make install
復(fù)制配置文件到php的配置目錄
cp php.ini-development /usr/local/php72/lib/php.ini
注意目錄的對(duì)應(yīng)2.3 安裝swoole
在swoole源碼目錄中
執(zhí)行phpize
/usr/local/php72/bin/phpize
執(zhí)行./configure
./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擴(kuò)展
vim /usr/local/php72/lib/php.ini
搜索";extension=",在最后一個(gè)被搜索到的地方添加extension=swoole.so
檢查swoole擴(kuò)展是否被安裝上
/usr/local/php72/bin/php -ir | grep swoole
輸出一下內(nèi)容為正常:2.4 安裝redis
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 install2.5 安轉(zhuǎn)hiredis
在hiredis源碼目錄中
編譯和安裝
make && make install2.6 安裝nginx
創(chuàng)建www組和用戶
groupadd -r www && useradd -r -g www -s /bin/false -M www
創(chuàng)建緩存目錄
mkdir /var/tmp/nginx
配置
./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 新增安裝時(shí)ssl支持
編譯安裝
make && make install2.7 安裝mariadb
安裝依賴
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
創(chuàng)建mysql組和用戶
groupadd -r mysql useradd -r -g mysql -s /sbin/nologin -d /usr/local/mysql -M mysql
創(chuàng)建安裝目錄
mkdir -p /usr/local/mysql
創(chuàng)建數(shù)據(jù)存放目錄
mkdir -p /data/mysql
修改數(shù)據(jù)存放目錄的所屬
chown -R mysql:mysql /data/mysql
在mariadb源碼目錄
cmake
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
重新執(zhí)行cmake命令需要執(zhí)行:rm -f CMakeCache.txt
編譯安裝
make && make install
在mariadb的安裝目錄(cd /usr/local/mysql/)
使用 mysql 用戶執(zhí)行腳本, 安裝數(shù)據(jù)庫到數(shù)據(jù)庫存放目錄
scripts/mysql_install_db --user=mysql --datadir=/data/mysql
輸出以下內(nèi)容
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"Alternatively you can run:
"./bin/mysql_secure_installation"which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.See the MariaDB Knowledgebase at http://mariadb.com/kb or the
MySQL manual for more instructions.You 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...
初始化mysql
./bin/mysql_secure_installation
查看命令幫助
/usr/local/mysql/bin/mysqld --verbose --help /usr/local/mysql/bin/mysql --help
暫未解決my.cnf的默認(rèn)配置文件找不到的問題
神奇的支持文件
support-files/
可以用該文件夾中的文件對(duì)mysql進(jìn)行管理2.8 debian發(fā)行版安裝PHP7
安裝依賴
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
./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
文章版權(quán)歸作者所有,未經(jīng)允許請(qǐng)勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。
轉(zhuǎn)載請(qǐng)注明本文地址:http://systransis.cn/yun/40020.html
摘要:基礎(chǔ)命令關(guān)于搜索下載查看或者刪除單個(gè)刪除多個(gè)刪除查看信息占用關(guān)于查看重啟停止雜項(xiàng)命令網(wǎng)絡(luò)相關(guān)清除網(wǎng)絡(luò)緩存查看網(wǎng)絡(luò)列表查看詳情掛載目錄清除緩存查看列表查看詳情系統(tǒng)相關(guān)系統(tǒng)信息查看占用清除所有包含構(gòu)建失敗的鏡像沒有被使用的網(wǎng)絡(luò)配 docker基礎(chǔ)命令 關(guān)于images 搜索 docker search php 下載 docker pull php:7.3.6-fpm-alpine3....
摘要:基礎(chǔ)命令關(guān)于搜索下載查看或者刪除單個(gè)刪除多個(gè)刪除查看信息占用關(guān)于查看重啟停止雜項(xiàng)命令網(wǎng)絡(luò)相關(guān)清除網(wǎng)絡(luò)緩存查看網(wǎng)絡(luò)列表查看詳情掛載目錄清除緩存查看列表查看詳情系統(tǒng)相關(guān)系統(tǒng)信息查看占用清除所有包含構(gòu)建失敗的鏡像沒有被使用的網(wǎng)絡(luò)配 docker基礎(chǔ)命令 關(guān)于images 搜索 docker search php 下載 docker pull php:7.3.6-fpm-alpine3....
摘要:源碼解讀系列一好難都跑不起來怎么破了解一下唄閱讀框架源碼第一步搞定環(huán)境小伙伴剛接觸的時(shí)候會(huì)感覺壓力有點(diǎn)大更直觀的說法是難開發(fā)組是不贊成難這個(gè)說法的的代碼都是實(shí)現(xiàn)的而又是世界上最好的語言的代碼閱讀起來是很輕松的開發(fā)組會(huì)用源碼解讀系列博客深 date: 2018-8-01 14:22:17title: swoft| 源碼解讀系列一: 好難! swoft demo 都跑不起來怎么破? doc...
摘要:源碼解讀系列一好難都跑不起來怎么破了解一下唄閱讀框架源碼第一步搞定環(huán)境小伙伴剛接觸的時(shí)候會(huì)感覺壓力有點(diǎn)大更直觀的說法是難開發(fā)組是不贊成難這個(gè)說法的的代碼都是實(shí)現(xiàn)的而又是世界上最好的語言的代碼閱讀起來是很輕松的開發(fā)組會(huì)用源碼解讀系列博客深 date: 2018-8-01 14:22:17title: swoft| 源碼解讀系列一: 好難! swoft demo 都跑不起來怎么破? doc...
閱讀 1763·2023-04-25 16:28
閱讀 697·2021-11-23 09:51
閱讀 1478·2019-08-30 15:54
閱讀 1164·2019-08-30 15:53
閱讀 2838·2019-08-30 15:53
閱讀 3431·2019-08-30 15:43
閱讀 3269·2019-08-30 11:18
閱讀 3292·2019-08-26 10:25