Chinaunix

标题: RedHat 9下mysql+apache+php环境的搭建 [打印本页]

作者: liyupeng    时间: 2005-07-15 17:48
标题: RedHat 9下mysql+apache+php环境的搭建
前几天把linux删掉重装了,又重新搭建了mysql+apache+php环境,我把安装过程整理成了文档。
    1.1 安装准备
      
    1.2 安装mysql
      
        
  • 安装mysql服务器端程序:rpm -ivh MySQL-server-4.1.12-1.i386.rpm
            
  • 安装mysql客户端程序:  rpm -ivh MySQL-client-4.1.12-1.i386.rpm
            
  • $mysql,可以看到
             
                Welcome to the MySQL monitor.  Commands end with ; or g.
                Your MySQL connection id is 1 to server version: 4.1.12-standard
                
                Type 'help;' or 'h' for help. Type 'c' to clear the buffer.        
                mysql>
             
            
          
        1.3 安装php
          
            
  • 进入apache的安装文件目录,输入:./configure --prefix=/usr/local/httpd
            
  • 进入php的安装文件目录,输入:./configure --prefix=/usr/local/php --with-mysql --with-apache=../apache_1.3.33
            
  • make && make install
            
  • cp php.ini-dist /usr/local/php/lib/php.ini
            
  • 建立符号链接 ln -s /usr/local/php/bin/php /usr/bin/php
          
        1.4 安装apache
          
            
  • 进入apache的安装文件目录,输入:./configure --prefix=/usr/local/httpd --activate-module=src/modules/php4/libphp4.a --enable-module=so --enable-module=rewrite
            
  • make && make install
            
  • 确保/usr/local/httpd/conf/httpd.conf中有以下内容
             
                DirectoryIndex index.html index.php
                ...
                AddType application/x-httpd-php .php
             
            
            
  • 建立符号链接 ln -s /usr/local/httpd/bin/apachectl /usr/bin/apache
            
  • 重启apache : apache restart
          

    本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/1777/showart_35856.html




    欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2