白兔赤乌

月亮太阳
    <<  php5.3 phpMyAdmin-3.2.2.1-all-languages小问题 | 首页 | Apache 限速模块安装笔记  >>
  • 2009-10-27

    php 编译安装笔记 - [电脑相关]

    10/23/2009  centos 5.3
    jpeg6
    # ./configure --prefix=/usr/local/jpeg6/ --enable-shared --enable-static
    # make
    
    # mkdir /usr/local/jpeg6
    # mkdir /usr/local/jpeg6/bin
    # mkdir /usr/local/jpeg6/lib
    # mkdir /usr/local/jpeg6/include
    # mkdir /usr/local/jpeg6/man
    # mkdir /usr/local/jpeg6/man1
    # mkdir /usr/local/jpeg6/man/man1
    
    # make install
    
    
    libpng
    # tar zxf libpng-1.2.40.tar.gz
    # cd libpng-1.2.40
    # ./configure --prefix=/usr/local/libpng
    # make
    # make install
    
    
    freetype
    # tar zxf freetype-2.3.11.tar.gz
    # cd freetype-2.3.11
    # ./configure --prefix=/usr/local/freetype
    # make
    # make install
    
    
    
    zlib
    # tar zxf zlib-1.2.3.tar.gz
    # cd zlib-1.2.3
    # ./configure --prefix=/usr/local/zlib
    # make
    # make install
    
    
    
    libxml2
    # tar zxf libxml2-2.7.2.tar.gz
    # cd libxml2-2.7.2
    # ./configure --prefix=/usr/local/libxml2
    # make
    # make install
    
    
    
    
    fontconfig
    # tar zxf fontconfig-2.7.3.tar.gz
    # cd fontconfig-2.7.3
    # ./configure --prefix=/usr/local/fontconfig --with-freetype-config=/usr/local/freetype/bin/freetype-config
    #
    
    出现
    checking for LIBXML2... configure: error: Package requirements (libxml-2.0 >= 2.6) were not met:
    
    No package 'libxml-2.0' found
    
    Consider adjusting the PKG_CONFIG_PATH environment variable if you
    installed software in a non-standard prefix.
    
    Alternatively, you may set the environment variables LIBXML2_CFLAGS
    and LIBXML2_LIBS to avoid the need to call pkg-config.
    See the pkg-config man page for more details.
    
    
    如下操作
    #export PKG_CONFIG_PATH=/usr/local/libxml2/lib/pkgconfig:$PKG_CONFIG_PATH
    
    再继续
    # ./configure --prefix=/usr/local/fontconfig --with-freetype-config=/usr/local/freetype/bin/freetype-config --enable-libxml2
    # make
    # make install
    
    
    
    
    libmcrypt
    # tar zxf libmcrypt-2.5.7.tar.gz
    # cd libmcrypt-2.5.7
    # ./configure
    # make
    # make install
    
    
    
    
    gd 
    
    # tar zxf gd-2.0.36RC1.tar.gz
    # cd gd-2.0.36RC1
    # ./configure --prefix=/usr/local/libgd --with-jpeg=/usr/local/jpeg6 --with-zlib-dir=/usr/local/zlib --with-png=/usr/local/libpng --with-freetype=/usr/local/freetype --with-fontconfig=/usr/local/fontconfig
    # make
    # make install
    
    
    
    curl
    # tar zxf curl-7.19.6.tar.gz
    # cd curl-7.19.6
    # ./configure --prefix=/usr/local/curl
    # make
    # make install
    
    
    
    
    libxslt
    # tar zxf libxslt-1.1.22.tar.gz
    # cd libxslt-1.1.22
    # ./configure --prefix=/usr/local/libxslt --with-libxml-prefix=/usr/local/libxml2
    # make
    # make install
    
    
    
    
    php5
    # tar zxf php-5.2.11.tar.gz
    # cd php-5.2.11
    #  ./configure --prefix=/usr/local/php5 --with-apxs2=/usr/local/apache/bin/apxs --with-mysql=/usr/lib/mysql --with-gd=/usr/local/libgd --enable-gd-native-ttf --with-jpeg-dir=/usr/local/jpeg6 --with-zlib-dir=/usr/local/zlib --with-png-dir=/usr/local/libpng --with-freetype-dir=/usr/local/freetype  --enable-mbstring=all --with-curl=/usr/local/curl --enable-mbregex --with-config-file-path=/usr/local/php5 --enable-ftp --enable-soap --with-xsl=/usr/local/libxslt --enable-gd-jis-conv -with-libxml-dir=/usr/local/libxml2 --enable-xml --enable-sockets
    
    # make
    # make test
    # make install
    
    出现
    Warning: Cannot use a scalar value as an array in phar://install-pear-nozlib.phar/PEAR/ChannelFile.php on line
    
     
    这样之后可以解决
    mv /usr/local/lib/php/.channels /usr/local/lib/php/.channels-old
    /usr/local/php/bin/pecl update-channels
    
    装完了 出现如下信息
    Wrote PEAR system config file at: /usr/local/php5/etc/pear.conf
    You may want to add: /usr/local/php5/lib/php to your php.ini include_path
    Installing PDO headers:          /usr/local/php5/include/php/ext/pdo/
    
    
    # cp php.ini-dist /usr/local/php5/lib/php/php.ini
    
    
    # vi /usr/local/apache/conf/httpd.conf
    加入
    AddType application/x-httpd-php .php .phtml
    AddType application/x-httpd-php-source .phps
    
    
    重启Apache出现
    # httpd: Syntax error on line 53 of /usr/local/apache/conf/httpd.conf: Cannot load /usr/local/apache/modules/libphp5.so into server: /usr/local/apache/modules/libphp5.so: cannot restore segment prot after reloc: Permission denied
    
    # vi /etc/selinux/config
    注释掉:#SELINUX=enforcing ,然后新加一行为:
    SELINUX=disabled
    
    重启系统 就好了
    
    
    装ZendOptimizer
    
    # tar zxfv ZendOptimizer-3.3.9-linux-glibc23-i386.tar.gz
    # cd ZendOptimizer-3.3.9-linux-glibc23-i386
    # cp data/5_2_x_comp/ZendOptimizer.so /usr/lib
    
     vi /usr/local/php5/lib/php/php.ini
     zend_extension=/usr/lib/ZendOptimizer.so
    
    没有效果,ZendOptimizer没装成
    看了phpinfo之后
    # mv /usr/local/php5/lib/php/php.ini /usr/local/php5/php.ini
    才行,原来php.ini应该放在/usr/local/php5/php.ini这个位置。
    
    
    
    
    -----------091106--后续------
    未支持msqli
    编译时加上--with-mysqli=/usr/local/bin/mysql_config 
    错误,configure: error: wrong mysql library version or lib not found. Check config.log for more information.
    
    
    之前也见过滴
    # cd /usr/local/src/php/php-5.2.11/ext/mysqli
    # /usr/local/php5/bin/phpize
    # ./configure --prefix=/usr/local/lib/mysql/ --with-php-config=/usr/local/php5/bin/php-config --with-mysqli=/usr/local/bin/mysql_config
    # make
    # make test
    # make install
    然后出现Installing shared extensions:     /usr/local/php5/lib/php/extensions/no-debug-non-zts-20060613/
    # vi  vi /usr/local/php5/php.ini
    加入
    extension=/usr/local/php5/lib/php/extensions/no-debug-non-zts-20060613/mysqli.so
    应用过程中
    Warning: Cannot modify header information - headers already sent by
    后来打开 php.ini 然后把 output_buffering 设为 on 。重起appache,OK。

    历史上的今天:

    一张老照片 2007-10-27

    随机文章:

    mysql-5.4.1-beta php-5.3.0安装小记 2009-07-13
    php5.3 phpMyAdmin-3.2.2.1-all-languages小问题 2009-10-26
    /etc/resolv.conf 重启电脑后又恢复 2009-10-01
    apache2 autoindex 笔记(让下载的时候看的顺眼一点) 2009-09-20
    ssh连接过去,里面的中文乱码 2009-09-18

    收藏到:Del.icio.us




    Tag:php centos
    引用地址:
    发表于21:21:25 | 编辑 | 继续话题 | 转发 | 分享 0

搜 索

分 类

  • 随便写写[18]
  • 花花草草[1]
  • 可爱宠物[10]
  • 自然风光[3]
  • 图片图片[4]
  • 电脑相关[35]
  • 与¥相关[8]
  • 其他东东[6]

广 告

Tag

  • 学习[27]
  • 照片[15]
  • 网络[9]
  • 宠物[9]
  • centos[8]
  • ubuntu[8]
  • 仓鼠[6]
  • 话题营销[5]
更多...

存 档

  • 2006/01/01-2007/01/01
  • 2007/01/02-2008/01/01

链 接

  • 深谷幽灵
  • 跳跳涂鸦鱼儿
  • 奥运青啤
  • 旷 野
  • Popspa
  • Logo
  • 白兔赤乌Logo
除非特别声明, 本站内容采用知识共享署名-非商业性使用-相同方式共享 3.0 许可协议 | Powered By Blogbus