111 发表于 2015-8-19 13:45:51

Centos配置lamp环境

  一、下载相关软件包
  cd /usr/local/src
  Mysql(免编译版本): wget http://syslab.comsenz.com/downloads/linux/mysql-5.1.55-linux-i686-glibc23.tar.gz
  Apache: wget http://syslab.comsenz.com/downloads/linux/httpd-2.2.16.tar.gz
  PHP: wget http://syslab.comsenz.com/downloads/linux/php-5.3.10.tar.bz2
  Zend Guard Loader(for php5.3): http://www.zend.com/en/products/guard/thank-you-zend-guard-loader-optimizer?package=419 PHP5.2及以前版本称为Zend Optimizer
  
  二、安装Mysql
  useradd mysql
  tar -xvzfmysql-5.1.55-linux-i686-glibc23.tar.gz
  mv mysql-5.1.55-linux-i686-glibc23 /usr/local/mysql
  cd /usr/local/mysql
  cp ./support-files/my-small.cnf /etc/my.cnf
  chmod -R mysql:root /usr/local/mysql
  ./scripts/mysql_install_db --basedir=/usr/local/mysql--datadir=/usr/local/mysql/data --user=mysql
  ./bin/mysqld_safe &
  查看是否已经启动 ./bin/mysql -uroot
  二、安装apache
  tar -xvzf httpd-2.2.16.tar.gz
  cd httpd-2.2.16
  ./configure --prefix=/usr/local/apache2 --with-included-apr --enable-so --enable-deflate=shared --enable-expires=shared --enable-rewrite=shared --enable-static-support --disable-userdir > temp.txt
  make > temp.txt
  make install > temp.txt
  cd /usr/lcoal/apache2
  ./bin/apachectl start
  看看有没有启动成功 http://domain/
  三、安装php5.3.10
  首先安装相关的包
  (1)安装re2c
  wget http://sourceforge.net/projects/re2c/files/re2c/0.13.5/re2c-0.13.5.tar.gz/download
     tar -zxvf re2c-0.13.5.tar.gz
    cd re2c-0.13.5
         ./configure && make && make install
  (2)
  yum install libmcrypt libmcrypt-devel
    yum install libjpep*
    yum install libjpeg*
    yum install freetype freetype-devel
  
  tar -xvjfphp-5.3.10.tar.bz2
  cd php-5.3.10
  ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql --with-pdo-mysql=/usr/local/mysql --enable-force-cgi-redirect --with-gd --with-ttf --with-openssl --enable-gd-native-ttf --with-jpeg-dir --with-png-dir --with-freetype-dir --with-zlib --with-gettext --with-curl --with-iconv --with-bz2 --with-mcrypt --enable-soap --enable-sockets --enable-mbstring=all --enable-bcmath --enable-ftp > temp.txt
  make > temp.txt
  make install > temp.txt
  php安装完成,验证是否安装成功
  vim /usr/local/apache2/conf/http.conf

添加 AddType application/x-httpd-php .php .php3
在DirectoryIndex 一行后添加 index.php
/usr/local/apache2/bin/apachectlrestart

echo "<?php phpinfo(); ?>" > /usr/local/apache2/htdocs/index.php

再次访问你的域名,看看是否成功

四、安装
把 ZendGuardLoader.so 拷到 /usr/local/apache2/modules下
在php.ini中加入:
zend_extension=/usr/local/apache2/modules/ZendGuardLoader.so
zend_loader.enable=1
zend_loader.disable_licensing=0
重启apache   /usr/local/apache2/bin/apachectlrestart  
页: [1]
查看完整版本: Centos配置lamp环境