当前位置:Gxlcms > 数据库问题 > php mysql nginx

php mysql nginx

时间:2021-07-01 10:21:17 帮助过:5人阅读

nginx配置

一、cd /usr/local/nginx/conf
编辑版本改IP
www.nautilus.org
ssb.nautilus.org
ssa.nautilus.org
二、./nginx -t查看有无报错
ps aux | grep nginx
./nginx bbs.nautilus.org重启
cd html
curl bbs.bautilus.org
ifconfig查看ip然后去浏览器登陆

                                                 mysql配置

一、在cenos上下载mysql。5.6.33版本
#解压
tar -zxvf mysql-5.6.33-linux-glibc2.5-x86_64.tar.gz
#复制解压后的mysql目录
cp -r mysql-5.6.33-linux-glibc2.5-x86_64 /usr/local/mysql
二、#添加用户组
groupadd mysql
#添加用户mysql 到用户组mysql
useradd -g mysql mysql
三、cd /usr/local/mysql/<br>mkdir ./data/mysql
chown -R mysql:mysql ./
./scripts/mysql_install_db --user=mysql --datadir=/usr/local/mysql/data/mysql
cp support-files/mysql.server /etc/init.d/mysqld
chmod 755 /etc/init.d/mysqld
cp support-files/my-default.cnf /etc/my.cnf

#修改启动脚本
vi /etc/init.d/mysqld

#修改项:
basedir=/usr/local/mysql/
datadir=/usr/local/mysql/data/mysql

#启动服务
service mysqld start

#测试连接
./mysql/bin/mysql -uroot

#加入环境变量,编辑 /etc/profile,这样可以在任何地方用mysql命令了
export PATH=$PATH:/usr/local/mysql//bin

#启动mysql
service mysqld start
#关闭mysql
service mysqld stop
#查看运行状态
service mysqld status

                                                  php配置

一、先下载源码包
wget http://cn2.php.net/distributions/php-5.6.0.tar.xz
然后 解压
1# xz -d php-5.6.0.tar.xz
1# tar xf php-5.6.0.tar -C /usr/local/src/
然后yam编译安装
yum install zlib-devel libxml2-devel libjpeg-devel libjpeg-turbo-devel
yum install freetype-devel libpng-devel gd-devel libcurl-devel libxslt-devel bz2-devel

yum -y install libmcrypt-devel mhash mcrypt
(yum install epel-release.noarch )
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo
二、创建www用户
groupadd www
useradd -g www -s /sbin/nologin -M www
编译安装
cd /usr/local/src/php-5.6.0/

三、# ./configure \
--prefix=/usr/local/php56 \
--with-config-file-path=/usr/local/php56/etc \
--enable-inline-optimization \
--disable-debug \
--disable-rpath \
--enable-shared \
--enable-opcache \
--enable-fpm \
--with-fpm-user=www \
--with-fpm-group=www \
--with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-gettext \
--enable-mbstring \
--with-iconv \
--with-mcrypt \
--with-mhash \
--with-openssl \
--enable-bcmath \
--enable-soap \
--with-libxml-dir \
--enable-pcntl \
--enable-shmop \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--enable-sockets \
--with-curl \
--with-zlib \
--enable-zip \
--with-bz2 \
--with-readline\
--with-gd
配置redis php
wget https://github.com/phpredis/phpredis/archive/develop.zip --no-check-certificate
unzip develop.zip
cd phpredis-develop/
phpize
./configure --with-php-config=/usr/local/php56/bin/php-config
make && make install
vim /usr/local/php56/etc/php.ini
[redis]extension=redis.so
配置 memcache
./configure --with-php-config=/usr/local/php56/bin/php-config
[memcache]
extension=memcache.so
四、编译完成的界面是
imong.png
编译完成之后,执行安装命令:
make && make install

php mysql nginx

标签:evel   复制   free   red   ini   mirrors   util   mat   data   

人气教程排行