Q: How to upgrade PHP 7.0 to 7.1 in Ubuntu (offline server)? 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?

A: 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

A: 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

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


*

*Open directory
sudo nano /etc/apt/apt.conf

*Enter proxy server url setting
Acquire::http::Proxy "http://username:password@proxy_url:port";

*Open directory
sudo nano /etc/environment

*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.
