CentOS下搭建LAMP环境详解(2)

成功则显示:

测试: /opt/mysql/bin/mysqladmin ping

成功则显示:

查看数据库: /opt/mysql/bin/mysql -u root -e 'show databases;' 关闭: sudo /opt/mysql/support-files/mysql.server stop

成功则显示:

PHP编译安装 安装依赖:

最后三个文件可以从下面的链接下载。

------------------------------------------分割线------------------------------------------

免费下载地址在

用户名与密码都是

具体下载目录在 /2015年资料/9月/3日/Linux中文man离线手册 CHM/

下载方法见

------------------------------------------分割线------------------------------------------

cd Downloads/ sudo yum install zlib1g-dev libbz2-dev libcurl4-gnutls-dev libjpeg-dev libpng12-dev libfreetype6-dev libmcrypt-dev libxml2-dev sudo yum install bzip2-devel.x86_64 -y sudo yum -y install curl-devel sudo yum install openssl.x86_64 openssl-devel.x86_64 -y sudo yum install libjpeg.x86_64 libpng.x86_64 freetype.x86_64 libjpeg-devel.x86_64 libpng-devel.x86_64 freetype-devel.x86_64 -y sudo yum install libjpeg libjpeg-devel libpng libpng-devel ########安装Libmcrypt tar -zxvf libmcrypt-2.5.8.tar.gz cd libmcrypt-2.5.8 ./configure sudo make sudo make install 说明:libmcript默认安装在/usr/local ########安装mhash cd .. tar -zxvf mhash-0.9.9.9.tar.gz cd mhash-0.9.9.9 ./configure sudo make sudo make install #########安装mcrypt cd .. tar -zxvf mcrypt-2.6.8.tar.gz cd mcrypt-2.6.8 LD_LIBRARY_PATH=/usr/local/lib ./configure sudo make sudo make install 编译安装: cd Downloads/ wget http://labfile.oss.aliyuncs.com/php-5.5.21.tar.gz tar -zxvf php-5.5.21.tar.gz cd php-5.5.21 ./configure --prefix=/opt/php --with-bz2 --with-curl --with-jpeg-dir --with-gd --enable-shared --enable-mbstring --with-mcrypt --with-mysql=/opt/mysql --with-pdo-mysql=/opt/mysql --with-mysqli=/opt/mysql/bin/mysql_config --enable-fpm --enable-phar --enable-bcmath --with-zlib --enable-zip --enable-ftp --with-gettext --enable-sockets --with-freetype-dir --with-config-file-path=/opt/php/etc/php.ini --with-config-file-scan-dir=/opt/php/etc/conf.d --with-apxs2=/opt/apache/bin/apxs sudo make sudo make install sudo cp php.ini-production /opt/php/etc/php.ini 检查php是否支持mysql: /opt/php/bin/php -m | grep mysql

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/8f3e1d3a0f83508e917b4cfa52f9b7b5.html