خرید بک لینک

Vote count: 0

I would like to have php 5.4 on my ubuntu server, even if it's no longer supported.

Then I tried the ppa:ondrej/php5-oldstable repository like this :

sudo add-apt-repository ppa:ondrej/php5-oldstable

But it adds the repository below

[ubuntu@nixmind~]$ cat /etc/apt/sources.list.d/ondrej-php5-oldstable-trusty.list 
    deb http://ppa.launchpad.net/ondrej/php5-oldstable/ubuntu trusty main
    # deb-src http://ppa.launchpad.net/ondrej/php5-oldstable/ubuntu trusty 

main

and was still giving php5.5.9 with apt-cache policy.

[ubuntu@nixmind ~]$ apt-cache policy php5
php5:
  Installed: 5.4.45-3+donate.sury.org~precise+3
  Candidate: 5.5.9+dfsg-1ubuntu4.17
  Version table:
     5.5.9+dfsg-1ubuntu4.17 0
        500 http://eu-west-1.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu/ trusty-security/main amd64 Packages
     5.5.9+dfsg-1ubuntu4 0
        500 http://eu-west-1.ec2.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages

I then add the precise repos manually like this :

[ubuntu@nixmind ~]$ cat /etc/apt/sources.list.d/ondrej-php5-oldstable-trusty.list 
deb http://ppa.launchpad.net/ondrej/php5-oldstable/ubuntu trusty main
deb http://ppa.launchpad.net/ondrej/php5-oldstable/ubuntu precise main 
deb-src http://ppa.launchpad.net/ondrej/php5-oldstable/ubuntu precise main 
# deb-src http://ppa.launchpad.net/ondrej/php5-oldstable/ubuntu trusty main

and had this :

[ubuntu@nixmind ~]$ apt-cache policy php5
php5:
  Installed: (none)
  Candidate: 5.5.9+dfsg-1ubuntu4.17
  Version table:
     5.5.9+dfsg-1ubuntu4.17 0
        500 http://eu-west-1.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu/ trusty-security/main amd64 Packages
     5.5.9+dfsg-1ubuntu4 0
        500 http://eu-west-1.ec2.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
     5.4.45-3+donate.sury.org~precise+3 0
        500 http://ppa.launchpad.net/ondrej/php5-oldstable/ubuntu/ precise/main amd64 Packages

I then installed php5.4 like this :

sudo apt-get install php5=5.4.45-3+donate.sury.org~precise+3

But php is saying that the version is 5.5.9 while apt-cache policy says it's 5.4

[ubuntu@nixmind ~]$ apt-cache policy php5
php5:
  Installed: 5.4.45-3+donate.sury.org~precise+3
  Candidate: 5.5.9+dfsg-1ubuntu4.17
  Version table:
     5.5.9+dfsg-1ubuntu4.17 0
        500 http://eu-west-1.ec2.archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu/ trusty-security/main amd64 Packages
     5.5.9+dfsg-1ubuntu4 0
        500 http://eu-west-1.ec2.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
 *** 5.4.45-3+donate.sury.org~precise+3 0
        500 http://ppa.launchpad.net/ondrej/php5-oldstable/ubuntu/ precise/main amd64 Packages

and

[ubuntu@nixmind ~]$ php -v
PHP 5.5.9-1ubuntu4.17 (cli) (built: May 19 2016 19:05:57) 
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
    with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies

Then my questions are :

  • Why is there a difference between php -v and apt-cache policy outputs?

  • Is it just not possible to install php5.4 on ubuntu trusty actually?

  • Is a good way to have php5?4 ruing on ubuntu trusty without this ambiguity?

Regards.

asked 1 min ago

برچسب: نویسنده: استخدام کار تاريخ: سه شنبه 25 خرداد 1395 ساعت: 23:40

صفحه بندی