• lamp


     

    1.图形库安装


    gd库

    1.1.需要的库文件包

    1.1.1.Expat

    # cd expat-2.1.0
    # ./configure --prefix=/usr/local/www/gd
    # make

    可以修改配置后的makefile文档使得软件支持UTF-16readme

    # make install

    1.1.2.Zlib

    # cd zlib-1.2.7
    # ./configure --prefix=/usr/local/www/gd
    # make && make install

    1.1.3.freetype

    # cd freetype-2.3.5
    # ./configure --prefix=/usr/local/www/gd
    # make
    # make install

    1.1.4.Libxml

    # cd libxml2-2.6.30
    # ./configure --prefix=/usr/local/www/gd --with-zlib=/usr/local/www/gd
    # make
    # make install

    1.1.5.Fontconfig

    # cd fontconfig-2.11.0
    # ./autogen.sh --prefix=/usr/local/www/gd/
    --with-expat=/usr/local/www/gd/
    --with-xmldir=/usr/local/www/gd/
    --with-configdir=/usr/local/www/gd/
    # make
    # make install

    1.1.6.LibXpm-3.5.5

    # cd libXpm-3.5.5
    # ./configure --prefix=/usr/local/www/gd
    # make
    # make install

    1.1.7.Libpng-1.2.41

    # cd libpng-1.2.41
    # ./configure --prefix=/usr/local/www/gd
    # make
    # make install

    1.1.8.Jpeg-7

    # cd jpeg-7
    # ./configure --prefix=/usr/local/www/gd
    # make
    # make install

    1.2.安装gd库软件

    # cd gd-2.0.33
    # ./confiure --prefix=/usr/local/www/gd
    --with-png=DIR        #  where to find the png library
    --with-freetype=DIR   #  where to find the freetype 2.x library
    --with-fontconfig=DIR   #  where to find the fontconfig library
    --with-jpeg=DIR   #    where to find the jpeg library
    --with-xpm=DIR    #    where to find the xpm library
    # make
    # make install

     

    2.安装lamp-ver2.0


    2.1.apache

    # cd apr
    # ./configure --prefix=/usr/local/lamp/apr/
    # cd apr-util
    # ./configure --prefix=/usr/local/lamp/apr/ --with-apr=/usr/local/lamp/apr/
    # cd httpd-2.0.65/
    # ./configure --prefix=/usr/local/lamp/ --with-apr=/usr/local/lamp/apr/--with-apr-util=/usr/local/lamp/apr/ --enable-so --enable-deflate --enable-expires --enable-rewrite --enable-static-support --with-z=/usr/local/lamp/gd/ --with-port=80
    # /usr/local/apache2/bin/apachectl -k start | stop | graceful
    # netstat -nltp

    2.2.mysql

     

    # cd mysql-5.1.72/
    # ./configure-prefix=/usr/local/lamp/mysql-5.1.72/ --with-pthread --with-extra-charsets=all--with-tcp-port=3306 --with-mysqld-user=mysql --with-charset=utf8--with-plugins=all--enable-thread-safe-client

     

    参考:

     

    # ./configure 
            --prefix=/usr/local/lamp/mysql-5.1.72 
            --localstatedir=/usr/local/mysql/data 
            --with-unix-socket-path=/usr/local/lamp/mysql-5.1.72/tmp/mysql.sock 
            --with-extra-charsets=all 
            --with-charset=utf8 
            --with-client-ldflags=-all-static 
            --with-mysqld-ldflags=-all-static 
            --with-plugins=all 
            --with-pthread 
            --enable-thread-safe-client

     

    配置 mysql

    # cp support-files/my-medium.cnf /etc/my.cnf

    现在还没有创建数据库的库目录、授权表。

    # cd bin
    # mysql-install-db --user=mysql

    (创建授权表)

     

    设置 mysql 家目录用户、组权限。

    # cd /usr/local/mysql
    # chown -R root .
    # chown -R mysql var
    # chgrp -R mysql .
    # /usr/local/mysql/bin/mysqld_safe --user=mysql & (启动 mysql 服务)
    # netstat -ntlp

    2.3.php

    # cd php-5.4.6/
    # ./configure --prefix=/usr/local/php 
    --with-config-file-path=/usr/local/php/etc 
    --with-apxs2=/usr/local/apache2/bin/apxs  #作为 apache 的模块安装 php
    --with-mysql=/usr/local/mysql 
    --with-libxml-dir=/usr/local/libxml2 
    --with-png-dir=/usr/local/libpng 
    --with-jpeg-dir=/usr/local/jepg6 
    --with-freetype-dir=/usr/local/freetype 
    --with-gd=/usr/local/gd2 
    --with-mcrypt=/usr/local/libmcrypt 
    --with-mysqli=/usr/local/mysql/bin/mysql_config  #支持面向对象的函数
    --enable-soap  # web services 所需要的功能模块
    --enable-mbstring=all  #多字节字符支持
    --enable-sockets
    # make && make install
    # cd ..

    执行的:

    ./configure--prefix=/usr/local/lamp/php-5.4.6/ 
    --with-apxs2=/usr/local/lamp/bin/apxs 
    --with-mysql=/usr/local/lamp/mysql-5.1.72/ 
    --with-libxml-dir=/usr/local/lamp/gd/ 
    --with-png-dir=/usr/local/lamp/gd/ 
    --with-zlib-dir=/usr/local/lamp/gd/ 
    --with-jpeg-dir=/usr/local/lamp/gd/ 
    --with-freetype-dir=/usr/local/lamp/gd/ 
    --with-gd=/usr/local/lamp/gd/ 
    --with-mcrypt=/usr/local/lamp/gd/ 
    --with-mysqli=/usr/local/lamp/mysql-5.1.72/bin/mysql_config 
    --enable-soap 
    --enable-mbstring=all 
    --enable-sockets 
    --enable-zip

     

     参考

     

    cd php-5.2.6
    ./configure --prefix=/usr/local/php5 --with-apxs2=/usr/local/http-2.4.6/bin/apxs --with-mysql=/usr/local/mysql 
    --with-gd=/usr/local/gd 
    --enable-gd-native-ttf 
    --with-ttf 
    --enable-gd-jis-conv 
    --with-freetype-dir=/usr/local/freetype/ 
    --with-jpeg-dir=/usr/local/libjpeg-v6 
    --with-png-dir=/usr/local/libpng 
    --with-libxml-dir=/usr/local/libxml2 
    --with-zlib-dir=/usr/local/zlib 
    --enable-xml 
    --enable-mbstring 
    --enable-sockets
    make
    make test
    make install
    cp php.ini-dist /usr/local/php5/lib/php.ini

     

    2.4.LAMP环境整合

    # cp php.ini-dist /usr/local/php/etc/php.ini

     

    查看 apache 安装情况

    # ls /etc/httpd
    # cd /usr/local/apache2
    # ls

    显示 apache 中添加的 php 模块。

    # cd modules
    # ls

     调用模块(Apache 调用 PAP 模块。 )

    # vi /etc/httpd/httpd.conf

    57 行,已经在配置文件中加载了 php 模块路径。

    添加一行,解释 php 文件时调用模块。添加行如下: (找到 AddType 相同行,...

    AddType application/x-httpd-php .php .html
    AddType application/x-httpd-php-source .phps

    注意将这两行添加在其它 AddType 后面

    确保文件中有下面一段,如果没有的话就添加在所有 LoadModule 之后

     

    LoadModule php*_module modules/libphp*.so

    * 代表版本信息。

    重新启动 apache 服务。

     

    # /usr/lcoal/apache2/bin/apachectl stop
    # /usr/lcoal/apache2/bin/apachectl start

     

     

    打开 IE,测试 php 是否能在 apache 页面得到解释。

    # vi test.php
    <?php
      Phpinfo();
    ?>

    打开 IE,显示 test.php 页。

    修改 php 参数,在做测试。

    编辑(viphp 配置文件,找到 post_max_size 项,重新设定值。

    打开 IE,寻找 post_max_size 的值,验证修改的 php 值的变化情况。

    打开 IE,显示 php 支持。

    phpcore

    apache,dom,gd,libxml,mysql,mysqli,pdo,socket......

    下载一个 php 网页(test.demo) ,测试网页显示。 (上传到服务端)

     

    # chown daemon.daemon test.demo (daemon 是 http 的用户)

    注意,下载网页的扩展名,需要修改 php 配置文件的默认搜索文件名顺序,以便实验成功。

    重新启动 apache 服务。

    # /usr/lcoal/apache2/bin/apachectl stop
    # /usr/lcoal/apache2/bin/apachectl start

     

    2.5.zendoptimizer

     

    # ./install-sh

     

     

    输入目录

    php 的配置文件

    apache 的控制命令

    重新启动 apache 服务。

    # /usr/lcoal/apache2/bin/apachectl stop
    # /usr/lcoal/apache2/bin/apachectl start

     

    测试 zendoptimizer。打开 IEphp.info()函数) ,显示结果。

    2.6.phpmyadmin

    一个用 php 语言编写的管理 mysql 的图形用户客户端。可以远程管理 mysql 库。

    3.安装lamp-ver1.0


    3.1.apache

    # cd apr
    # ./configure --prefix=/usr/local/lamp/apr/
    # cd apr-util
    # ./configure --prefix=/usr/local/lamp/apr/ --with-apr=/usr/local/lamp/apr/
    # cd httpd-2.0.65/
    # ./configure --prefix=/usr/local/lamp/ --with-apr=/usr/local/lamp/apr/--with-apr-util=/usr/local/lamp/apr/ --enable-so --enable-deflate --enable-expires --enable-rewrite --enable-static-support --with-z=/usr/local/lamp/gd/ --with-port=80
    # /usr/local/apache2/bin/apachectl -k start | stop | graceful
    # netstat -nltp

    3.2.mysql

    # cd mysql-5.1.72/
    # ./configure-prefix=/usr/local/lamp/mysql-5.1.72/ --with-pthread --with-extra-charsets=all--with-tcp-port=3306 --with-mysqld-user=mysql --with-charset=utf8--with-plugins=all--enable-thread-safe-client

    下边参考

     

    ./configure 
    --prefix=/usr/local/lamp/mysql-5.1.72 
    --localstatedir=/usr/local/mysql/data 
    --with-unix-socket-path=/usr/local/lamp/mysql-5.1.72/tmp/mysql.sock 
    --with-extra-charsets=all 
    --with-charset=utf8 
    --with-client-ldflags=-all-static 
    --with-mysqld-ldflags=-all-static 
    --with-plugins=all 
    --with-pthread 
    --enable-thread-safe-client

     

     配置 mysql

    # cp support-files/my-medium.cnf /etc/my.cnf

    现在还没有创建数据库的库目录、授权表。

    # cd bin
    # mysql-install-db --user=mysql

    创建授权表

    设置 mysql 家目录用户、组权限。

    # cd /usr/local/mysql
    # chown -R root .
    # chown -R mysql var
    # chgrp -R mysql .
    # /usr/local/mysql/bin/mysqld_safe --user=mysql & 启动 mysql 服务
    # netstat -ntlp

    3.3.php

    # cd php-5.4.6/
    # ./configure --prefix=/usr/local/php 
    --with-config-file-path=/usr/local/php/etc 
    --with-apxs2=/usr/local/apache2/bin/apxs  作为 apache 的模块安装 php
    --with-mysql=/usr/local/mysql 
    --with-libxml-dir=/usr/local/libxml2 
    --with-png-dir=/usr/local/libpng 
    --with-jpeg-dir=/usr/local/jepg6 
    --with-freetype-dir=/usr/local/freetype 
    --with-gd=/usr/local/gd2 
    --with-mcrypt=/usr/local/libmcrypt 
    --with-mysqli=/usr/local/mysql/bin/mysql_config  支持面向对象的函数
    --enable-soap  web services 所需要的功能模块
    --enable-mbstring=all  多字节字符支持
    --enable-sockets
    # make && make install
    # cd ..

     

    执行的

    ./configure--prefix=/usr/local/lamp/php-5.4.6/ 
    --with-apxs2=/usr/local/lamp/bin/apxs 
    --with-mysql=/usr/local/lamp/mysql-5.1.72/ 
    --with-libxml-dir=/usr/local/lamp/gd/ 
    --with-png-dir=/usr/local/lamp/gd/ 
    --with-zlib-dir=/usr/local/lamp/gd/ 
    --with-jpeg-dir=/usr/local/lamp/gd/ 
    --with-freetype-dir=/usr/local/lamp/gd/ 
    --with-gd=/usr/local/lamp/gd/ 
    --with-mcrypt=/usr/local/lamp/gd/ 
    --with-mysqli=/usr/local/lamp/mysql-5.1.72/bin/mysql_config 
    --enable-soap 
    --enable-mbstring=all 
    --enable-sockets 
    --enable-zip

     

     

    参考

    cd php-5.2.6
    ./configure --prefix=/usr/local/php5 --with-apxs2=/usr/local/http-2.4.6/bin/apxs --with-mysql=/usr/local/mysql 
    --with-gd=/usr/local/gd 
    --enable-gd-native-ttf 
    --with-ttf 
    --enable-gd-jis-conv 
    --with-freetype-dir=/usr/local/freetype/ 
    --with-jpeg-dir=/usr/local/libjpeg-v6 
    --with-png-dir=/usr/local/libpng 
    --with-libxml-dir=/usr/local/libxml2 
    --with-zlib-dir=/usr/local/zlib 
    --enable-xml 
    --enable-mbstring 
    --enable-sockets
    make
    make test
    make install
    cp php.ini-dist /usr/local/php5/lib/php.ini

     

    3.4.LAMP环境整合

    # cp php.ini-dist /usr/local/php/etc/php.ini

    查看 apache 安装情况

    # ls /etc/httpd
    # cd /usr/local/apache2
    # ls

    显示 apache 中添加的 php 模块。

    # cd modules
    # ls

    调用模块

    Apache 调用 PAP 模块。

    # vi /etc/httpd/httpd.conf

    57 行已经在配置文件中加载了 php 模块路径。

    添加一行解释 php 文件时调用模块。添加行如下 找到 AddType 相同行...

    AddType application/x-httpd-php .php .html
    AddType application/x-httpd-php-source .phps

    注意将这两行添加在其它 AddType 后面

    确保文件中有下面一段如果没有的话就添加在所有 LoadModule 之后

    LoadModule php*_module modules/libphp*.so

    * 代表版本信息。

     重新启动 apache 服务。

    # /usr/lcoal/apache2/bin/apachectl stop
    # /usr/lcoal/apache2/bin/apachectl start

     

     

    打开 IE测试 php 是否能在 apache 页面得到解释。

    # vi test.php
    <?php
      Phpinfo();
    ?>

     

     打开 IE显示 test.php 页。

    修改 php 参数在做测试。

    编辑viphp 配置文件找到 post_max_size 项重新设定值。

    打开 IE寻找 post_max_size 的值验证修改的 php 值的变化情况。

    打开 IE显示 php 支持。

    phpcore

    apache,dom,gd,libxml,mysql,mysqli,pdo,socket......

    下载一个 php 网页test.demo 测试网页显示。 上传到服务端

    # chown daemon.daemon test.demo daemon http 的用户

    注意下载网页的扩展名需要修改 php 配置文件的默认搜索文件名顺序以便实验成功。

    重新启动 apache 服务。

    # /usr/lcoal/apache2/bin/apachectl stop
    # /usr/lcoal/apache2/bin/apachectl start

     

    3.5.zendoptimizer

     

    # ./install-sh

    输入目录

    php 的配置文件

    apache 的控制命令

    重新启动 apache 服务。

    # /usr/lcoal/apache2/bin/apachectl stop
    # /usr/lcoal/apache2/bin/apachectl start

    测试 zendoptimizer。打开 IEphp.info()函数 显示结果。

    3.6.phpmyadmin

    # cd phpMyAdmin-3.0.11-all-languages/
    
    Requirements
     * PHP
          + You need PHP 5.2.0 or newer, with session support (see FAQ 1.31) and
            the Standard PHP Library (SPL) extension.
          + To support uploading of ZIP files, you need the PHP zip extension.
          + You need GD2 support in PHP to display inline thumbnails of JPEGs
            ("image/jpeg: inline") with their original aspect ratio
          + When using the "cookie" authentication method, the mcrypt extension is
            strongly suggested for most users and is required for 64?bit machines.
            Not using mcrypt will cause phpMyAdmin to load pages significantly
            slower.
    
     * MySQL 5.0 or newer (details);
     * Web browser with cookies enabled.
    
    sol/( aHShrgb(240,240,240); mso-shading:rgb(240,240,240); " >installed Apache 2.2.11 and PHP 5.2.8

    用这个方法确定需要的模块

    模块列表

    $ php -m | grep -v -e Modules] -e ^$ > php-default-modules
    $ php -m

     创建配置脚本

    $ for i in $(cat php-default-modules); do echo -n "--with-$i ">> phpconfigure.sh ;don

    比如报错显示位置选项就使用“./configure --help”参考修改。生成的脚本一直调试到正确运行因为这个“for”循环使用了的修改有可能应该是“--enable-”开头的还可以添加额外的选项

    以下的选项可以供参考

    $ ./configure --with-mcrypt --with-mhash --with-bz2 --enable-calendar 
    --with-curl --enable-dbase --enable-exif --enable-ftp --with-gd 
    --with-gettext --with-gmp --with-iconv --enable-mbstring 
    --with-mime_magic --with-mysql --with-mysqli --with-openssl 
    --enable-pcntl --with-pdo_mysql --with-pdo_sqlite --with-pspell 
    --enable-shmop --enable-sockets --enable-sysvmsg --enable-sysvsem 
    --enable-sysvshm --enable-wddx --with-zlib --enable-safe-mode

     

    php-5.2.9]$ sudo yum install mcrypt libmcrypt mhash libmhash libxml2-devel openssl-devel bzip2-devel curl-devel libjpeg-devel libpng-devel gmp-devel mysql-devel aspell-devel zlib zlib-devel

     

     

    配置脚本configure报错

    $ make
    $ make test

     

    自信自己能解决而且能解决的很漂亮。所以我没有整理。http://php.chinaunix.net/manual/zh/install.unix.apache2.php

    编译后最好做个测试

    一切代码都是为了生活,一切生活都是调剂
  • 相关阅读:
    浅谈IO这件事
    tushare+pandas实现财经数据分析
    大话设计模式Python实现-解释器模式
    大话设计模式Python实现- 享元模式
    大话设计模式Python实现-中介者模式
    大话设计模式Python实现-职责链模式
    大话设计模式Python实现-命令模式
    大话设计模式Python实现-桥接模式
    java之AbstractStringBuilder类详解
    java之Class类详解
  • 原文地址:https://www.cnblogs.com/argor/p/7908505.html
Copyright © 2020-2023  润新知