编译安装php和mysql

wget http://cn.php.net/distributions/php-7.1.8.tar.gz

yum instal  curl-devel libmcrypt-devel

./configure –prefix=/work/apps/php –with-config-file-path=/work/apps/php/etc \
–with-curl –with-mysqli –with-mcrypt \
–with-pdo-mysql –with-zlib –without-pdo-sqlite \
–without-pear –without-sqlite3 –disable-cgi –disable-ipv6 \
–disable-phar –enable-fpm –enable-mbstring –enable-maintainer-zts

给php提速,训练成适合自己网站的

make prof-gen
sapi/cgi/php-cgi -T 100 /data/htdocs/wordpress/index.php >/dev/null
make prof-clean
make prof-use && make install

cp php.ini-production /work/apps/php/etc/php.inc
cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm

切换目录
cp php-fpm.conf.default php-fpm.conf
cp php-fpm.d/www.conf.default php-fpm.d/www.conf

wget https://cdn.mysql.com//Downloads/MySQL-5.6/mysql-5.6.37.tar.gz
groupadd mysql
useradd -r -g mysql mysql
cmake . -DCMAKE_INSTALL_PREFIX=/work/apps/mysql -DMYSQL_DATADIR=/work/data/mysql -DSYSCONFDIR=/etc -DDEFAULT_CHARSET=utf8mb4 -DDEFAULT_COLLATION=utf8mb4_general_ci -DEXTRA_CHARSETS=all -DENABLED_LOCAL_INFILE=1 -DENABLE_DOWNLOADS=1
make && make install
chown -R mysql:mysql /work/apps/mysql
chown -R mysql:mysql /work/data/mysql
cd /work/apps/mysql

scripts/mysql_install_db –basedir=/work/apps/mysql –datadir=/work/data/mysql –user=mysql  –skip-name-resolve

发表评论