简体   繁体   中英

how to install php 5.5.12 on ubuntu while installing lampstack?

我已按本教程安装Apache和MySQL,但我需要安装PHP 5.5.12 $ sudo apt-get install php libapache2-mod-php php-mcrypt php-mysql安装PHP 7 *

I think this will answer your question. https://askubuntu.com/a/756901/636504

extract:

Using PHP PPA to coinstall PHP 5.6 with PHP 7.0

There's an option to co-install PHP 5.6 packages using ppa:ondrej/php .

For more information, please see that answer: https://askubuntu.com/a/762161/309221

Extracted from link above:

Assuming libapache2-mod-php is a suitable way to enable PHP in Apache for you, you can proceed in this way:

sudo add-apt-repository ppa:ondrej/php

sudo apt-get update

sudo apt-get install php7.0 php5.6 php5.6-mysql php-gettext php5.6-mbstring php-xdebug libapache2-mod-php5.6 libapache2-mod-php7.0

Switch PHP version ( Apache ):

  • from php5.6 to php7.0:
    sudo a2dismod php5.6 ; sudo a2enmod php7.0 ; sudo service apache2 restart

  • from php7.0 to php5.6:
    sudo a2dismod php7.0 ; sudo a2enmod php5.6 ; sudo service apache2 restart

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM