dpkg --get-selections
sudo apt-get remove --purge
http://php.net/downloads.php
PHP 5.3.3
Complete Source Code
■PHP 5.3.3 (tar.bz2) [10,412Kb] - 22 July 2010
md5: 21ceeeb232813c10283a5ca1b4c87b48
■PHP 5.3.3 (tar.gz) [13,595Kb] - 22 July 2010
md5: 5adf1a537895c2ec933fddd48e78d8a2
http://hublog.hubmed.org/archives/001924.html
Installing PHP 5.3 etc on Ubuntu Karmic (9.10)
Fetch and extract the latest version of PHP.
sudo apt-get build-dep php5
./configure --prefix=/opt/php5.3 \
--enable-mbstring \
--enable-soap \
--enable-sqlite-utf8 \
--enable-zip \
--with-bz2 \
--with-curl \
--with-gd \
--with-gettext \
--with-gmp \
--with-ldap \
--with-openssl \
--with-xmlrpc \
--with-zlib \
--with-xsl \
--with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-apxs2=/usr/bin/apxs2
make
sudo make -i install
(-i to ignore the error about httpd.conf)
sudo ln -s /etc/php5/apache2/php.ini /opt/php5.3/lib/php.ini
Optional: install APCsudo /opt/php5.3/bin/pecl install apc-beta
sudo nano /opt/php5.3/lib/php.ini
extension_dir = "/opt/php5.3/lib/php/extensions/no-debug-non-zts-20090626"
extension=apc.so
Optional: install FirePHPsudo /opt/php5.3/bin/pear channel-discover pear.firephp.org
sudo /opt/php5.3/bin/pear install firephp/FirePHPCore
sudo apache2ctl restart
http://thirdpartycode.com/2009/08/building-php-5-3-packages-on-ubuntu-9-04-jaunty-for-apache-2/
Prep your system
Setup your development server to be able to compile things. By default, most installations will not come with compilers installed.
view sourceprint?
1 apt-get install checkinstall
Say yes, and let it follow the dependencies as needed.
Get the development headers for some of the extensions you’ll be compiling in.
view sourceprint?
1 apt-get install postgresql-8.3 postgresql-client-8.3 postgresql-client-common postgresql-common postgresql-server-dev-8.3
2 aptitude install mysql-client mysql-client-5.0 mysql-common mysql-server mysql-server-5.0 mysql-server-core-5.0
3
4 apt-get install libtidy-dev curl libcurl4-openssl-dev libcurl3 libcurl3-gnutls zlib1g zlib1g-dev libxslt1-dev libzip-dev libzip1 libxml2 libsnmp-base libsnmp15 libxml2-dev libsnmp-dev libjpeg62 libjpeg62-dev libpng12-0 libpng12-dev zlib1g zlib1g-dev libfreetype6 libfreetype6-dev libbz2-dev libxpm4-dev libmcrypt-dev libmcrypt4
Download PHP and Compile it
view sourceprint?
mkdir ~/srcs
cd ~/srcs
wget http://us3.php.net/get/php-5.3.0.tar.gz/from/this/mirror
tar xvfz php-5-3-0.tar.gz
cd php-5.3.0
Now, you can either do the ./configure –help and pick your options, or you can use my configure options for PHP 5.3
./configure --prefix=/opt/php5.3 \
--enable-mbstring \
--enable-soap \
--enable-sqlite-utf8 \
--enable-zip \
--with-bz2 \
--with-curl \
--with-gd \
--with-gettext \
--with-gmp \
--with-ldap \
--with-openssl \
--with-xmlrpc \
--with-zlib \
--with-xsl \
--with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-apxs2=/usr/bin/apxs2
View sourceprint?
make
make test
checkinstall
checkinstall will ask you some basic questions about the package, answer and let it build the package for you. You will run into an interesting issue at first, apxs2 will complain about a LoadModule not being in the httpd.conf file. This is an artifact of how Ubuntu/Debian likes to handle it’s configuration files. The simplest thing is to add a line at the bottom of your httpd.conf that loads a benign module. Mod Pony seems cute .
Configure your PHP like any normal apache server. Reload apache, put the handy phpinfo(); in your documentroot, and then have fun.
Be sure to remove the phpinfo(); from your production servers.
If you want MySQL 5.1, just do apt-get install mysql-server-5.1 , be sure to change the dev header packages to the same version as well.
I got this error when trying to configure php 5.2.6:
configure: error: xml2-config not found. Please check your libxml2 installation.
I’m using Debian and it showed that I had libxml2 installed (and it was the latest version).
It turns out that the latest stable version of libxml2 doesn’t include a file named xml2-config. I suppose I could have linked that file to the config file that the stable version of libxml2 uses, but the easy fix is to just install the newer development version of libxml2 using the following command:
apt-get install libxml2-dev
ไม่มีความคิดเห็น:
แสดงความคิดเห็น