Ubuntu linux 安装 PHP5.3.0的命令

 更新时间:2009年09月09日 19:21:05   作者:  
5.3.0 的正式版已经发布有段时间了,看到脚本之家上面有个windows下的安装php5.3的教程,所以想起写一个关于linux的PHP5.3的安装教程。
刚刚手头有台机器刚装了 ubuntu, 编译了一下 LAMP 系统, PHP 5.3.0 改动比较大。 第一眼看到的 php.ini 文件里已经变动了。 感觉比一以前版本的舒服点了。 有了开发环境和生产环境的配置区分了。 详细的以后慢慢了解了。 貌似增强了很多功能。 从 phpinfo() 里看出来的。 放出一张刚测试出的phpinfo()截图, 后面张贴一下本次编译的命令记录。

php-5.3.0-info

看看编译的一堆命令。 有需要的朋友可以拿去参考一下。
 

sudo apt-get install build-essential gcc make autoconf automake1.9 libtool
 
sudo apt-get install zlib1g-dev libdb-dev
 
tar -jxf apr-1.3.5.tar.bz2 -C ../builds/
tar -jxf apr-util-1.3.7.tar.bz2 -C ../builds/
tar -zxf httpd-2.2.11.tar.gz -C ../builds/
 
cd ../builds/
cd apr-1.3.5/
./configure 
make
sudo make install
 
cd ../apr-util-1.3.7/
./configure --with-apr=/usr/local/apr --with-berkeley-db=/usr
make
sudo make install
 
cd ../httpd-2.2.11/
./configure --prefix=/usr/local/apache2 --enable-rewrite=shared --enable-dav=shared --enable-so --with-apr=/usr/local/apr/bin/apr-1-config --with-apr-util=/usr/local/apr/bin/apu-1-config
make
sudo make install
 
 
sudo apt-get install libxml2 libxml2-dev
 
tar -zxf neon-0.28.4.tar.gz -C ../builds/
tar -zxf zlib-1.2.3.tar.gz -C ../builds/
tar -zxf expat-2.0.1.tar.gz -C ../builds/
tar -zxf subversion-1.6.2.tar.gz -C ../builds/
mkdir ../builds/subversion-1.6.2/sqlite-amalgamation
tar -zxf sqlite-amalgamation-3.6.13.tar.gz
cp sqlite-3.6.13/sqlite3.c ../builds/subversion-1.6.2/sqlite-amalgamation/
rm -rf sqlite-3.6.13
 
cd ../builds/neon-0.28.4/
./configure
make
sudo make install
 
cd ../zlib-1.2.3/
./configure --prefix=/usr/local/zlib
make
sudo make install
 
cd ../expat-2.0.1/
./configure
make
sudo make install
 
cd ../subversion-1.6.2/
./configure --prefix=/usr/local/subversion --with-apxs=/usr/local/apache2/bin/apxs --with-apr=/usr/local/apr/bin/apr-1-config --with-apr-util=/usr/local/apr/bin/apu-1-config --with-neon=/usr/local --with-zlib=/usr/local/zlib --with-ssl
make
sudo make install
 
tar -zxf mysql-5.0.83-linux-i686-icc-glibc23.tar.gz
sudo mv mysql-5.0.83-linux-i686-icc-glibc23 /usr/local/mysql
cd /usr/local/mysql/
sudo groupadd mysql
sudo useradd -g mysql mysql
sudo scripts/mysql_install_db --user=mysql
sudo chown -R mysql .
sudo chgrp -R mysql .
sudo chown -R root .
sudo chown -R mysql data
cd support-files/
sudo cp my-medium.cnf /etc/my.cnf
sudo gedit /etc/my.cnf
sudo ./mysql.server start
cd ../bin
./mysqladmin -u root password 'mypassword'
./mysql -u root -p
cd ../support-files/
sudo ./mysql.server stop
 
sudo apt-get install flex libpng12-0 libpng12-dev libltdl3-dev
sudo ln -sf libpng12.so.0 libpng.so
 
tar -zxf curl-7.19.5.tar.gz -C ../builds/
tar -zxf jpegsrc.v6b.tar.gz -C ../builds/
tar -zxf freetype-2.3.9.tar.gz -C ../builds/
tar -zxf libmcrypt-2.5.8.tar.gz -C ../builds/
tar -zxf mhash-0.9.9.9.tar.gz -C ../builds/
tar -zxf php-5.3.0.tar.gz -C ../builds/
 
cd ../builds/curl-7.19.5/
sudo mkdir /usr/local/curl
./configure --prefix=/usr/local/curl --with-ssl
make
sudo make install
 
cd ../jpeg-6b/
sudo mkdir /usr/local/jpeg
sudo mkdir /usr/local/jpeg/bin
sudo mkdir /usr/local/jpeg/lib
sudo mkdir /usr/local/jpeg/include
sudo mkdir /usr/local/jpeg/man
sudo mkdir /usr/local/jpeg/man/man1
./configure --prefix=/usr/local/jpeg --enable-shared --enable-static
make
sudo make install
 
cd ../freetype-2.3.9/
./configure --prefix=/usr/local/freetype2
make
sudo make install
 
cd ../libmcrypt-2.5.8/
./configure --prefix=/usr/local/libmcrypt
make
sudo make install
 
cd ../mhash-0.9.9.9/
./configure --prefix=/usr/local/libmhash
make
sudo make install
 
cd ../php-5.3.0/
./configure --prefix=/usr/local/php \
--with-apxs2=/usr/local/apache2/bin/apxs \
--with-config-file-path=/usr/local/php \
--with-openssl \
--with-zlib \
--with-zlib-dir=/usr/local/zlib \
--enable-bcmath \
--enable-calendar \
--with-curl=/usr/local/curl \
--with-curlwrappers \
--enable-ftp \
--with-gd \
--with-jpeg-dir=/usr/local/jpeg \
--with-png-dir=/usr \
--with-freetype-dir=/usr/local/freetype2 \
--enable-gd-native-ttf \
--with-gettext \
--with-mcrypt=/usr/local/libmcrypt \
--with-mhash=/usr/local/libmhash \
--enable-mbstring \
--enable-exif \
--with-mysql=/usr/local/mysql \
--with-pdo-mysql=/usr/local/mysql \
--with-mysqli=/usr/local/mysql/bin/mysql_config \
--with-xmlrpc \
--enable-soap \
--enable-sockets \
--enable-zip
 
sudo cp php.ini-development /usr/local/php/php.ini
sudo gedit /usr/local/apache2/conf/httpd.conf

相关文章

  • Centos7系统下搭建.NET Core2.0+Nginx+Supervisor环境

    Centos7系统下搭建.NET Core2.0+Nginx+Supervisor环境

    本文为大家分享了如何在Centos7系统下搭建.NET Core2.0+Nginx+Supervisor环境,部署方法非常详细
    2018-10-10
  • VPS CentOS-6 下 LNMP HTTP web服务器的搭建步骤

    VPS CentOS-6 下 LNMP HTTP web服务器的搭建步骤

    虽然现在很多朋友比较喜欢使用军哥的lnmp一键安装包,但手工配置方法也要会,否则容易技术退步
    2014-06-06
  • Linux中使用NTP保持精确时间的方法详解

    Linux中使用NTP保持精确时间的方法详解

    Linux系统下,一般使用ntp服务来同步不同机器的时间,NTP 是网络时间协议(Network Time Protocol)的简称,下面这篇文章主要给大家介绍了关于Linux中使用NTP保持精确的时间的相关资料,文中通过示例代码介绍的非常详细,需要的朋友可以参考下。
    2018-03-03
  • Linux Socket 编程简介和实现

    Linux Socket 编程简介和实现

    这篇文章主要介绍了Linux Socket 编程简介和实现,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
    2018-02-02
  • centos下samba文件夹共享服务器配置详解

    centos下samba文件夹共享服务器配置详解

    这篇文章主要介绍了centos下samba文件夹共享服务器配置详解,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
    2020-02-02
  • apache日志文件详解和实用分析命令

    apache日志文件详解和实用分析命令

    这篇文章主要介绍了apache日志文件每条数据的请意义,以及一些实用日志分析命令,需要的朋友可以参考下
    2014-03-03
  • Apache Pulsar集群搭建部署详细过程

    Apache Pulsar集群搭建部署详细过程

    这篇文章主要介绍了Apache Pulsar集群搭建过程,搭建Pulsar集群至少需要3个组件:ZooKeeper集群、BookKeeper集群和Broker集群,本文给大家介绍的非常详细,需要的朋友可以参考下
    2022-02-02
  • 阿里云CentOS 7系统挂载SSD云盘的教程

    阿里云CentOS 7系统挂载SSD云盘的教程

    最近在阿里云购买了块云盘,但悲催的发现阿里云购买的第2块云盘默认是不自动挂载的,需要手动配置挂载上。所以只能求助万能的百度了,通过查找网上的资料,和自己的实践终于将云盘挂载成功了,现在将步骤分享给大家,有同样需要的朋友们可以参考借鉴。
    2016-11-11
  • ubuntu20.04设置静态ip地址(包括不同版本)

    ubuntu20.04设置静态ip地址(包括不同版本)

    这篇文章主要介绍了ubuntu20.04设置静态ip地址,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
    2020-06-06
  • linux配置ntp服务器的方法

    linux配置ntp服务器的方法

    下面小编就为大家带来一篇linux配置ntp服务器的方法。小编觉得挺不错的,现在就分享给大家,也给大家做个参考。一起跟随小编过来看看吧
    2016-12-12

最新评论