个人工具

UbuntuHelp:ApacheMySQLPHP/AptPhp4Output/zh

来自Ubuntu中文

跳转至: 导航, 搜索
模板:UbuntuHelp

该页中apache表示apache v1.3,apache2表示 apache v2.0。apache2是目前的推荐版本。

目录

  1. PHP4
  2. PHP5
  3. 单独安装php4
  4. 安装PHP4和PHP5
  5. 保留libapache2-mod-php5

PHP4


[email protected]:~$ apt-cache show php4

Package: php4 ... Depends: libapache2-mod-php4 (>= 4:4.4.2-1build1) | libapache-mod-php4 (>= 4:4.4.2-1build1) | php4-cgi (>= 4:4.4.2-1build1), php4-common (>= 4:4.4.2-1build1) ...

PHP4依赖libapache2-mod-php4或libapche-mod-php4。


PHP5


[email protected]:~$ apt-cache show php5

Package: php5 ...

Depends: libapache2-mod-php5 (>= 5.1.2-1ubuntu3) | php5-cgi (>= 5.1.2-1ubuntu3), php5-common (>= 5.1.2-1ubuntu3) ...

php5仅依赖libapache2-mod-php5。没有libapache-mod-php5这个库文件。


单独安装PHP4


[email protected]:~$ sudo apt-get install -s php4

Password:

Reading package lists... Done

Building dependency tree... Done

The following extra packages will be installed:

apache2-common apache2-mpm-prefork apache2-utils libapache2-mod-php4 libapr0 libzzip-0-12 php4-common ssl-cert

Suggested packages:

apache2-doc lynx www-browser php-pear

The following NEW packages will be installed

apache2-common apache2-mpm-prefork apache2-utils libapache2-mod-php4 libapr0 libzzip-0-12 php4 php4-common ssl-cert

0 upgraded, 9 newly installed, 0 to remove and 0 not upgraded. ...

安装PHP4时,将会主动安装libapache2-mod-php4该库文件。


安装PHP4和PHP5


[email protected]:~$ sudo apt-get install -s php4 php5

Reading package lists... Done

Building dependency tree... Done

The following extra packages will be installed:

apache2-common apache2-mpm-prefork apache2-utils libapache2-mod-php4 libapr0 libzzip-0-12 php4-common php5-cgi php5-common ssl-cert

Suggested packages:

apache2-doc lynx www-browser php-pear

The following NEW packages will be installed

apache2-common apache2-mpm-prefork apache2-utils libapache2-mod-php4 libapr0 libzzip-0-12 php4 php4-common php5 php5-cgi php5-common ssl-cert

0 upgraded, 12 newly installed, 0 to remove and 0 not upgraded. ...

安装PHP4和PHP5时,仅会主动安装libapache2-mod-php4该包。


保留libapache2-mod-php5


[email protected]:~$ sudo apt-get install -s php5 libapache2-mod-php5 php4

Reading package lists... Done

Building dependency tree... Done

The following extra packages will be installed:

apache-common apache2-common apache2-mpm-prefork apache2-utils libapache-mod-php4 libapr0 libzzip-0-12 php4-common php5-common ssl-cert

Suggested packages:

apache apache-ssl apache-perl apache2-doc lynx www-browser php-pear

The following NEW packages will be installed

apache-common apache2-common apache2-mpm-prefork apache2-utils libapache-mod-php4 libapache2-mod-php5 libapr0 libzzip-0-12 php4 php4-common php5 php5-common ssl-cert

0 upgraded, 13 newly installed, 0 to remove and 0 not upgraded.

如果libapache2-mod-php5已经安装了,libapache-mod-php4也会安装,该库文件与apache独立运行,但与apache2能很好的运行。