Home
Random
Log in
Settings
About Apoyar Wiki
Disclaimers
Apoyar Wiki
Search
Editing
Upgrading Major Versions of PHP
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
PHP UPGRADING ------------------ β’ For checking the version of PHP the command is php βv. β’ root@live:/home/neal # php βv.Now we are using the version of PHP 7.0 but that was last till is 1st jan 2019 for Apoyar_live_test. β’ First we should find the list of modules for that β’ root@live:/home/neal # php βm β’ This above command gives the list of all the php modules which are on php version.There is an list of modules we should have to follow that.Now we should remove all the modules and replace the modules with new one. β’ root@live:/home/neal # dpkg -l grep php. β’ This command gives the modules which are present on php version and in this packages will contain more than one module. β’ Now we need to remove all the packages one by one by using the command. β’ root@live:/home/neal # apt-get purge php7.0 php7.0-common php7.0-curl php7.0-fpm. β’ First we should execute above command and remove this four modules due to the dependencies it will remove more modules.after completion of this. β’ Again execute the below command it will shows which are still available modules. β’ root@live:/home/neal # dpkg -l grep php β’ This shows the remaining modules we should remove them also for that. β’ root@live:/home/neal # apt-get purge php-common. β’ Now we should install the 7.4 β’ root@live:/home/neal # apt-get install php7.4 β’ Now we should see the list for this β’ root@live:/home/neal # dpkg -l grep php β’ There we can see php 7.4.now we should search for list of modules by using this below command. β’ root@live:/home/neal # php βm β’ By this we can see list of modules which are installed with php7.4 now we should compare the modules with the previous version of php and we have install the missing modules. β’ root@live:/home/neal # apt-get install php7.4-curl php7.4-dom php7.4-mbstring php7.4-mysql php7.4-sqlite php7.4-pgsql β’ Now we should remove apache as nginx is already running on the port.For removing apache. β’ root@live:/home/neal # dpkg -l grep apache β’ root@live:/home/neal # apt-get purge apache2 apache2-bin apache2-data apache2-utils. β’ Now we should replace this php7.4 in nginx configurations. β’ root@live:/etc/nginx/sites-available# vi apoyarcloud.conf β’ After going into that file under the location ~ \.php$ { β’ Under that it shows the old version of php for upgrading there we should go to below path β’ root@live:/etc/nginx/sites-available# β’ After going into that path with should run below command. β’ grep -rli 'php7.0' * | xargs -i@ sed -i 's/php7.0/php7.4/g' @
Summary:
Please note that all contributions to Apoyar Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Apoyar Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)