Install ZendOptimizer on Ubuntu10.10 (PHP installed in apt-get mode is supported)

Source: Internet
Author: User
Reference: blog. csdn. netkings6681988articledetails6334087Ubuntu10.10 the default PHP version of apt-get is 5.3. Currently, ZendOptimizer supports php up to 5.2. Therefore, to support ZendOptimizer, you must downgrade the PHP version to 5.2, while the apt package management tool is

Reference: http://blog.csdn.net/kings6681988/article/details/6334087 Ubuntu 10.10 default apt-get PHP version is 5.3, and currently ZendOptimizer supports php version up to 5.2. Therefore, to support ZendOptimizer, you must downgrade the PHP version to 5.2, while the apt package management tool is

Reference:
Http://blog.csdn.net/kings6681988/article/details/6334087

The default PHP version of apt-get In Ubuntu 10.10 is 5.3. Currently, ZendOptimizer supports up to 5.2 php versions.
Therefore, to support ZendOptimizer, you must downgrade the PHP version to version 5.2, and the apt package management tool supports downgrading the version of a specific package.

For example, we found that Karmic Koala is the default PHP version of Ubuntu 9.10 is 5.2, so we can downgrade the 5 software packages we need php5-cli libapache2-mod-php5 php5-gd php5-mysql php5-common to 5.2 in the following way.

First, delete all currently installed php related suites.
$ Sudo apt-get purge 'dpkg-l | grep php | awk '{print $2 }'

Switch to root identity
$ Sudo-I

PHP downgrade is supported for creating dependency files
# Echo-e "Package: php5/nPin: release a = karmic/nPin-Priority: 991/n">/etc/apt/preferences. d/php
# Apt-cache search php5-| grep php5-| awk '{print "Package:", $1, "/nPin: release a = karmic/nPin-Priority: 991/n "} '>/etc/apt/preferences. d/php
# Apt-cache search-n libapache2-mod-php5 | awk '{print "Package:", $1, "/nPin: release a = karmic/nPin-Priority: 991/n "} '>/etc/apt/preferences. d/php
# Apt-cache search-n php5-mysql | awk '{print "Package:", $1, "/nPin: release a = karmic/nPin-Priority: 991/n "} '>/etc/apt/preferences. d/php
# Apt-cache search-n php5-gd | awk '{print "Package:", $1, "/nPin: release a = karmic/nPin-Priority: 991/n "} '>/etc/apt/preferences. d/php

Exit root identity
# Exit

Create APT Source for Karmic (Ubuntu 9.10)
$ Sudo vim/etc/apt/sources. list. d/karmic. list
Deb http://old-releases.ubuntu.com/ubuntu karmic main restricted universe multiverse
Deb-src http://old-releases.ubuntu.com/ubuntu karmic main restricted universe multiverse
Deb http://old-releases.ubuntu.com/ubuntu karmic-updates main restricted universe multiverse
Deb-src http://old-releases.ubuntu.com/ubuntu karmic-updates main restricted universe multiverse
Deb http://old-releases.ubuntu.com/ubuntu karmic-security main restricted universe multiverse
The deb-src http://old-releases.ubuntu.com/ubuntu karmic-security main restricted universe multiverse

Update APT data
$ Sudo apt-get update

Install php5-cli libapache2-mod-php5 php5-gd php5-mysql php5-common these 5 software packages
$ Sudo apt-get install-t karmic php5-cli libapache2-mod-php5 php5-gd php5-mysql php5-common

Check the PHP version. We can see that the version has been successfully downgraded to 5.2.
$ Sudo php -- version
PHP 5.2.10-2ubuntu6. 10 with Suhosin-Patch 0.9.7 (cli) (built: May 2 2011 23:24:44)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies

Download ZendOptimizer
$ Wget "http://downloads.zend.com/optimizer/3.3.9/ZendOptimizer-3.3.9-linux-glibc23-x86_64.tar.gz"
$ Tar xzvf ZendOptimizer-3.3.9-linux-glibc23-x86_64.tar.gz
$ Cd ZendOptimizer-3.3.9-linux-glibc23-x86_64/

Copy ZendOptimizer. so to the system lib directory.
$ Sudo cp data/5_2_x_comp/ZendOptimizer. so/usr/lib64/php5/libexec/

Configure php. ini to enable PHP to support ZendOptimizer
$ Sudo vim/etc/php5/apache2/php. ini
[ZendOptimizer]
Zend_extension =/usr/lib64/php5/libexec/ZendOptimizer. so

Restart Apache to take effect immediately
$ Sudo/etc/init. d/apache2 restart

Original article address: Install ZendOptimizer on Ubuntu 10.10 (PHP installed in apt-get mode is supported). Thanks to the original author for sharing.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.