0

I need to upgrade PHP 7.0 to 7.1. I am using Ubuntu 16.04 in Linux server. I searched that need to use ondrej package to upgrade. But my trial failed. Is it because my server is not connected to internet? If yes, is there any way to do it offline?

I had download these files as suggested: downloaded files

Is this the right files to be used? Where to put this files in the server? Is there any specific directory?

joun
  • 153

3 Answers3

1

You can try this out:

  • Add ppa

    sudo add-apt-repository ppa:ondrej/php
    
  • Update apt list

    sudo apt update
    
  • Install php 7.1

    sudo apt install php7.1 php7.1-common
    
  • Remove Php 7.0

    sudo apt purge php7.0 php7.0-common
    

Note: Before doing anything if you have apache server running then make sure to stop its service. To stop its service use the command service apache2 stop

Zanna
  • 70,465
0

Basically, you can download all required deb packages from this URL (I assumed that you are using 16.04 64 bits).

https://launchpad.net/~ondrej/+archive/ubuntu/php/+build/16264601

To know which packages to download, you can use this command to display all php7.0 packages installed on the server.

dpkg -l | grep php7.0

Copy the files on to an USB drive, mount the drive on the offline server, and then use the following command (don't use dpkg):

apt install ./php7.1_vvv.deb ./php7.1-common_vvv.deb  ./php7.1-mmm_vvv.deb ...

Replace vvv by the version and mmm by module name, use tab to use the auto-completion. Here an example with php7.1 and mysql.

apt install ./php7.1_7.1.26-1+ubuntu18.04.1+deb.sury.org+1_all.deb ./php7.1-common_7.1.26-1+ubuntu18.04.1+deb.sury.org+1_amd64.deb ./php7.1-mysql_7.1.26-1+ubuntu18.04.1+deb.sury.org+1_amd64.deb

ob2
  • 3,553
  • i see that the ubuntu version is 18.04..can it be used for ubuntu 16.04? – joun Jan 17 '19 at 00:56
  • I just found this package..https://launchpad.net/~ondrej/+archive/ubuntu/php/+packages?field.name_filter=&field.status_filter=published&field.series_filter=xenial. Is this the right one to be downloaded? It contains a long list of files..do I need to download all? – joun Jan 28 '19 at 01:47
  • I just edited my question according to @olivierb2 suggestion, how to proceed to the next step, to install in server? – joun Jan 28 '19 at 02:04
  • I stored in /etc/php and write command apt install but get segmentation fault error – joun Jan 28 '19 at 03:42
0

After days of searching, trying with errors using various sources with others' help, I managed to solve the problem using this solution:

  1. Open directory

    sudo nano /etc/apt/apt.conf

  2. Enter proxy server url setting

    Acquire::http::Proxy “http://username:password@proxy_url:port”;

  3. Open directory

    sudo nano /etc/environment

  4. Type in proxies:

    http_proxy=http://username:password@proxy_url:port/ httsp_proxy=https://username:password@proxy_url:port/ ftp_proxy=”http://username:password@proxy_url:port/

After configuring the proxies setting, I manage to update php using normal command using ondrej.

Thank you to all of you for your suggestions and solutions.

joun
  • 153