• 设为首页
  • 加入收藏
  • 联系我们
  • 首页ASP源码 | php源码 | JSP源码 | CGI源码 | .NET源码 | 建站素材 | 工具软件 | 服务器软件 | 电子书籍下载报错
    文章 │ 业内资讯 | 名将说站 | 搜索优化 | 网站编程 | 网页设计 | 图像动画 | 网络应用 | 电脑顾问 | 数据库 | 服务器
    您当前的位置:广安源码下载文章中心服务器 → 文章内容 退出登录 用户管理
    本类热门文章
    相关下载
    linux9.0+apache+php+mysql安装与配置
    作者:佚名  来源:  作者:  发布时间:2008-2-23 13:52:29

    减小字体 增大字体

    经过n个不眠之夜,小弟终于配置成功apache+PHP+mysql [原创]
    到www.mysql.com , www.apache.org , www.PHP.net下载mysql,apache,php的最新源码包
    mysql-standard-5.0.1-alpha-snapshot-pc-linux-i686.tar.gz
    httpd-2.0.52.tar.gz
    PHP-5.0.2.tar.gz

    我们先来安装mysql
    cp mysql-standard-5.0.1-alpha-snapshot-pc-linux-i686.tar.gz /usr/local/
    tar -zxvf mysql-standard-5.0.1-alpha-snapshot-pc-linux-i686.tar.gz
    cd mysql-standard-5.0.1-alpha-pc-linux-i686/
    emacs INSTALL-BINARY  获得安装信息
    groupadd mysql        
    useradd -g mysql mysql 
    cd /usr/local/
    ln -s mysql-standard-5.0.1-alpha-pc-linux-i686/ mysql  建立软链接
    ./scripts/mysql_install_db --user=mysql   
    chown -R root .            
    chown -R mysql data        
    chgrp -R mysql .           
    ./bin/mysqld_safe --user=mysql &   从后台启动mysql,这时会看到
    [1] 3879
    [root--1014--/usr/local/mysql]Starting mysqld daemon with databases from /usr/local/mysql/data
    证明已经成功,可以用ps -aux │ grep mysql 可以看到。
    安装成功

    再来安装apache
    tar -zxvf httpd-2.0.52.tar.gz
    cd httpd-2.0.52
    emacs INSTALL    获得一些安装信息
    ./configure --enable-so   --enable-so 
    make ; make install
    cd /usr/local/apache2/bin
    ./apachectl start
    httpd: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
    这时打开浏览器,输入127.0.0.1或你的电脑名,我的为tian1118,然后你就可以看到漂亮的羽毛,证明apache安装成功,而且可以正确显示出简体中文,真爽。
    再仔细看看,好像有点问题。
    cd /usr/loca/apache2/conf/
    cp httpd.conf beifei 备份一下,免得自己改错了。
    emacs httpd.conf
    找到#ServerName www.example.com:80
    把它改为ServerName 127.0.0.1
    ../bin/apachectl restart  没有出错提示证明成功

    再来安装PHP
    tar -zxvf PHP-5.0.2.tar.gz
    cd PHP-5.0.2
    emacs INSTALL  获得一些安装信息
    ./configure --with-apxs2=/usr/local/httpd/bin/apxs --with-mysql=/usr/local/mysql
    如果出现如下证明快成功了。
    +--------------------------------------------------------------------+   
    │ License:                                                           │
    │ This software is subject to the PHP License, available in this     │
    │ distribution in the file LICENSE.  By continuing this installation │
    │ process, you are bound by the terms of this license agreement.     │
    │ If you do not agree with the terms of this license, you must abort │
    │ the installation process at this point.                            │
    +--------------------------------------------------------------------+
     
    Thank you for using PHP.

    make 
    make install
    cp PHP.ini-dist /usr/local/lib/php.ini
    cp:是否覆盖‘/usr/local/lib/PHP.ini’? y


    PHP与apache整合
    emacs /usr/local/apache2/conf/httpd.conf  找到DirectoryIndex改为如下:
    DirectoryIndex index.html index.PHP index.htm index.html.var
    找到
    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz
    在它后面添加
    AddType application/x-httpd-PHP .php 
    /usr/local/apache2/bin/apachectl restart

    测试PHP
    emacs /usr/local/apache2/htdocs/index.PHP
    添加<? PHPinfo();?>
    打开浏览器,输入
    http://127.0.0.1/index.php
    可以看到关于PHP的信息,证明php安装成功。

    结束语:强烈建议大家在安装软件时用源码安装,虽然很麻烦,但是你知道你都做了什么,知道你把软件包安装到了哪,还有出了问题大家不要着急,先看出错提示,查看出错信息,利用自己所学linxu知识判断是哪出错了,就比如我在安装PHP时,我想先安装apache,然后php,最后mysql,当我在安装php时加了参数--with-mysql=/usr/local/mysql,在安装时就会出错,还有,在安装php时它还提示我的libxm12的版本太低,我的是RD9.0,内核2.4.20-8,我用rpm -qa │ grep libxm12时,版本才1.,然后下载了libxml2-2.6.10.tar.gz,安装后再安装php就成功了,。

    声明:本文只发表于www.xxlinux.com,作者:tian1118,欢迎转载,转载时请保证本文的完整性,并注明出处。

    源码之家收集整理

    [] [返回上一页] [打 印]
    文章评论 (评论内容只代表网友观点,与本站立场无关!)

    用户名: 查看更多评论

    分 值:100分 85分 70分 55分 40分 25分 10分 0分

    内 容:

             (注“”为必填内容。) 验证码: 验证码,看不清楚?请点击刷新验证码

    关于本站 - 网站帮助 - 广告合作 - 下载声明 - 友情连接 - 网站地图 - 管理登陆
    版权所有:广安视窗 联系人:王先生 客服QQ:566533
    Copyright © 2003-2007 www.Guang-an.com. All Rights Reserved .