学习啦 > 学习电脑 > 电脑知识大全 > CentOS6.5系统中的yum如何安装LAMP

CentOS6.5系统中的yum如何安装LAMP

时间: 家辉661 分享

CentOS6.5系统中的yum如何安装LAMP

  CentOS6.5系统中LAMP是yum的一种常用环境,在CentOS6.5系统中的yum安装LAMP的方法也是很简单的,下面学习啦小编就来为大家介绍一下CentOS6.5系统中的yum如何安装LAMP,欢迎大家参考和学习。

  具体的安装方法如下:

  1、安装源

  rpm -Uvh http://mirrors.yun-idc.com/epel/6/x86_64/epel-release-6-8.noarch.rpm

  rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

  2、更新并安装基本库

  yum -y update

  yum -y install gcc gcc-c++ autoconf automake zlib zlib-devel openssl openssl-devel pcre pcre-devel

  3、安装Apache和mysql

  yum --enablerepo=remi -y install mysql mysql-server mysql-devel httpd httpd-devel

  chkconfig httpd on

  chkconfig mysqld on

  service mysqld start

  mysql安全设置

  mysql_secure_installation

  mysql -u root -p 输入密码

  建立你要用数据库。。。

  4、安装php

  yum --enablerepo=remi -y install php php-mysql php-common php-devel php-gd libjpeg* php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-mcrypt php-bcmath php-mhash libmcrypt libmcrypt-devel

  加密模块

  wget http://www.dmasoftlab.com/cont/download/ioncube_loaders_lin_x86-64.tar.gz

  tar zxvf ioncube_loaders_lin_x86-64.tar.gz

  cp -rf ioncube /usr/local/

  sed -i ‘s/post_max_size = 8M/post_max_size = 50M/g’ /etc/php.ini

  sed -i ‘s/upload_max_filesize = 2M/upload_max_filesize = 50M/g’ /etc/php.ini

  sed -i ‘s/;date.timezone =/date.timezone = PRC/g’ /etc/php.ini

  sed -i ‘s/; cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/g’ /etc/php.ini

  sed -i ‘s/max_execution_time = 30/max_execution_time = 300/g’ /etc/php.ini

  sed -i ‘s/disable_functions =.*/disable_functions =passthru,exec,system,chroot,scandir,chgrp,chown,shell_exec,proc_open,proc_get_status,popen,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server/g’ /etc/php.ini

  echo “zend_extension=/usr/local/ioncube/ioncube_loader_lin_5.4.so” 》》 /etc/php.ini

  php加速模块

  wget http://xcache.lighttpd.net/pub/Releases/3.2.0/xcache-3.2.0.tar.gz

  tar -zxvf xcache-3.2.0.tar.gz

  cd xcache-3.2.0

  phpize --clean

  phpize

  ./configure --enable-xcache

  make && make install

  cat xcache.ini 》》 /etc/php.ini

  vi /etc/httpd/conf/httpd.conf

  将DirectoryIndex后添加index.php

  service httpd start

  5、测试

  vi /var/www/html/index.php

  phpinfo();

  ?>

  在浏览器输入http://yourserverip/,看到phpinfo信息就OK。

  以上就是学习啦小编为大家整理的CentOS6.5系统中的yum如何安装LAMP的全部内容了,希望对大家有所帮助。

363433