How to switch between PHP versions on Ubuntu Nginx [closed]Magento 1.9.x php 7 supportPHP 7.0.9/NGINX 1.11.3/Magento 2.0 Setup gives blank pagePHP 7.0.9/NGINX 1.11.3/Magento 2.1.0 Admin 404Magento with Nginx - Ubuntu 16.04how to config to run php 7 in nginx.config magento2 root?Running composer with php7.0magento 2 installation on ubuntu 16.04Ubuntu 18.04, xampp : php shell command using base php version instead of xampp php version 7cannot update php on ubuntu 16.04 from php7.1.2 to php 7.1.3Magento 2.2.7 - PHP Fatal error: Uncaught Error: Class 'DOMDocument' NGINX
Why doesn't Dany protect her dragons better?
Why doesn't a particle exert force on itself?
How is it believable that Euron could so easily pull off this ambush?
Align a table column at a specific symbol
Was Mohammed the most popular first name for boys born in Berlin in 2018?
Why is there a cap on 401k contributions?
Is it possible to do moon sighting in advance for 5 years with 100% accuracy?
Would the rotation of the starfield from a ring station be too disorienting?
Creating Stored Procedure in local db that references tables in linked server
Examples where existence is harder than evaluation
Why does this pattern in powers happen?
How would an instant or sorcery with an effect that targets work with Feather?
Are there vaccine ingredients which may not be disclosed ("hidden", "trade secret", or similar)?
Why is the episode called "The Last of the Starks"?
mini sub panel?
How can I test a shell script in a "safe environment" to avoid harm to my computer?
Does this website provide consistent translation into Wookiee?
I'm attempting to understand my 401k match and how much I need to contribute to maximize the match
Is the tensor product (of vector spaces) commutative?
What are my options legally if NYC company is not paying salary?
I want to write a blog post building upon someone else's paper, how can I properly cite/credit them?
Two (probably) equal real numbers which are not proved to be equal?
Cyclic queue using an array in C#
How could a civilization detect tachyons?
How to switch between PHP versions on Ubuntu Nginx [closed]
Magento 1.9.x php 7 supportPHP 7.0.9/NGINX 1.11.3/Magento 2.0 Setup gives blank pagePHP 7.0.9/NGINX 1.11.3/Magento 2.1.0 Admin 404Magento with Nginx - Ubuntu 16.04how to config to run php 7 in nginx.config magento2 root?Running composer with php7.0magento 2 installation on ubuntu 16.04Ubuntu 18.04, xampp : php shell command using base php version instead of xampp php version 7cannot update php on ubuntu 16.04 from php7.1.2 to php 7.1.3Magento 2.2.7 - PHP Fatal error: Uncaught Error: Class 'DOMDocument' NGINX
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I have PHP 7.0 and 7.2 installed.
For now, I use PHP 7.0.
How can I switch to PHP 7.2?
php-7 nginx ubuntu
closed as off-topic by Keyur Shah, denish vachhani, Mohit Kumar Arora, Manashvi Birla, Muhammad Hasham Apr 29 at 14:01
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Questions about third-party modules are generally off-topic because the scope of functionality and code are not available. For more information, see this meta post/answer." – denish vachhani, Muhammad Hasham
add a comment |
I have PHP 7.0 and 7.2 installed.
For now, I use PHP 7.0.
How can I switch to PHP 7.2?
php-7 nginx ubuntu
closed as off-topic by Keyur Shah, denish vachhani, Mohit Kumar Arora, Manashvi Birla, Muhammad Hasham Apr 29 at 14:01
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Questions about third-party modules are generally off-topic because the scope of functionality and code are not available. For more information, see this meta post/answer." – denish vachhani, Muhammad Hasham
add a comment |
I have PHP 7.0 and 7.2 installed.
For now, I use PHP 7.0.
How can I switch to PHP 7.2?
php-7 nginx ubuntu
I have PHP 7.0 and 7.2 installed.
For now, I use PHP 7.0.
How can I switch to PHP 7.2?
php-7 nginx ubuntu
php-7 nginx ubuntu
asked Apr 29 at 12:42
RufusRufus
1488
1488
closed as off-topic by Keyur Shah, denish vachhani, Mohit Kumar Arora, Manashvi Birla, Muhammad Hasham Apr 29 at 14:01
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Questions about third-party modules are generally off-topic because the scope of functionality and code are not available. For more information, see this meta post/answer." – denish vachhani, Muhammad Hasham
closed as off-topic by Keyur Shah, denish vachhani, Mohit Kumar Arora, Manashvi Birla, Muhammad Hasham Apr 29 at 14:01
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Questions about third-party modules are generally off-topic because the scope of functionality and code are not available. For more information, see this meta post/answer." – denish vachhani, Muhammad Hasham
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
Please use to below command
sudo update-alternatives --config php
After run above command select the PHP version that you need to use.
Press to keep the current choice[*], or type selection number: For example 2
After switching below command used to restart the PHP and Nginx server.
sudo service nginx restart
sudo service php7.1-fpm or php7.2-fpm restart
Please try above code. If you have any help let me know.
If it is helpful then accept answer.
– Kamlesh Solanki
Apr 29 at 13:52
add a comment |
For Nginx, we simply need to update the PHP-FPM socket in its configuration file. But before that make sure that the PHP-FPM is installed for your version and is running as a service.
Take a backup of the default configuration file and then open it up in your favourite text editor.
$ cp /etc/nginx/sites-available/default /etc/nginx/sites-available/default.bak
$ sudo vim /etc/nginx/sites-available/default
Change the FastCGI backend to use the new PHP-FPM socket, save and exit the file
location ~ .php$
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
Run the configuration test
$ nginx -t
Restart the web server
$ sudo service nginx restart
For more information visit here
add a comment |
sudo a2dismod php7.0<br>
sudo a2enmod php7.2<br>
sudo systemctl restart apache2
Reference: Link
add a comment |
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
Please use to below command
sudo update-alternatives --config php
After run above command select the PHP version that you need to use.
Press to keep the current choice[*], or type selection number: For example 2
After switching below command used to restart the PHP and Nginx server.
sudo service nginx restart
sudo service php7.1-fpm or php7.2-fpm restart
Please try above code. If you have any help let me know.
If it is helpful then accept answer.
– Kamlesh Solanki
Apr 29 at 13:52
add a comment |
Please use to below command
sudo update-alternatives --config php
After run above command select the PHP version that you need to use.
Press to keep the current choice[*], or type selection number: For example 2
After switching below command used to restart the PHP and Nginx server.
sudo service nginx restart
sudo service php7.1-fpm or php7.2-fpm restart
Please try above code. If you have any help let me know.
If it is helpful then accept answer.
– Kamlesh Solanki
Apr 29 at 13:52
add a comment |
Please use to below command
sudo update-alternatives --config php
After run above command select the PHP version that you need to use.
Press to keep the current choice[*], or type selection number: For example 2
After switching below command used to restart the PHP and Nginx server.
sudo service nginx restart
sudo service php7.1-fpm or php7.2-fpm restart
Please try above code. If you have any help let me know.
Please use to below command
sudo update-alternatives --config php
After run above command select the PHP version that you need to use.
Press to keep the current choice[*], or type selection number: For example 2
After switching below command used to restart the PHP and Nginx server.
sudo service nginx restart
sudo service php7.1-fpm or php7.2-fpm restart
Please try above code. If you have any help let me know.
edited Apr 29 at 12:52
answered Apr 29 at 12:47
Kamlesh SolankiKamlesh Solanki
26916
26916
If it is helpful then accept answer.
– Kamlesh Solanki
Apr 29 at 13:52
add a comment |
If it is helpful then accept answer.
– Kamlesh Solanki
Apr 29 at 13:52
If it is helpful then accept answer.
– Kamlesh Solanki
Apr 29 at 13:52
If it is helpful then accept answer.
– Kamlesh Solanki
Apr 29 at 13:52
add a comment |
For Nginx, we simply need to update the PHP-FPM socket in its configuration file. But before that make sure that the PHP-FPM is installed for your version and is running as a service.
Take a backup of the default configuration file and then open it up in your favourite text editor.
$ cp /etc/nginx/sites-available/default /etc/nginx/sites-available/default.bak
$ sudo vim /etc/nginx/sites-available/default
Change the FastCGI backend to use the new PHP-FPM socket, save and exit the file
location ~ .php$
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
Run the configuration test
$ nginx -t
Restart the web server
$ sudo service nginx restart
For more information visit here
add a comment |
For Nginx, we simply need to update the PHP-FPM socket in its configuration file. But before that make sure that the PHP-FPM is installed for your version and is running as a service.
Take a backup of the default configuration file and then open it up in your favourite text editor.
$ cp /etc/nginx/sites-available/default /etc/nginx/sites-available/default.bak
$ sudo vim /etc/nginx/sites-available/default
Change the FastCGI backend to use the new PHP-FPM socket, save and exit the file
location ~ .php$
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
Run the configuration test
$ nginx -t
Restart the web server
$ sudo service nginx restart
For more information visit here
add a comment |
For Nginx, we simply need to update the PHP-FPM socket in its configuration file. But before that make sure that the PHP-FPM is installed for your version and is running as a service.
Take a backup of the default configuration file and then open it up in your favourite text editor.
$ cp /etc/nginx/sites-available/default /etc/nginx/sites-available/default.bak
$ sudo vim /etc/nginx/sites-available/default
Change the FastCGI backend to use the new PHP-FPM socket, save and exit the file
location ~ .php$
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
Run the configuration test
$ nginx -t
Restart the web server
$ sudo service nginx restart
For more information visit here
For Nginx, we simply need to update the PHP-FPM socket in its configuration file. But before that make sure that the PHP-FPM is installed for your version and is running as a service.
Take a backup of the default configuration file and then open it up in your favourite text editor.
$ cp /etc/nginx/sites-available/default /etc/nginx/sites-available/default.bak
$ sudo vim /etc/nginx/sites-available/default
Change the FastCGI backend to use the new PHP-FPM socket, save and exit the file
location ~ .php$
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
Run the configuration test
$ nginx -t
Restart the web server
$ sudo service nginx restart
For more information visit here
answered Apr 29 at 12:50
Prathap GunasekaranPrathap Gunasekaran
2,1141720
2,1141720
add a comment |
add a comment |
sudo a2dismod php7.0<br>
sudo a2enmod php7.2<br>
sudo systemctl restart apache2
Reference: Link
add a comment |
sudo a2dismod php7.0<br>
sudo a2enmod php7.2<br>
sudo systemctl restart apache2
Reference: Link
add a comment |
sudo a2dismod php7.0<br>
sudo a2enmod php7.2<br>
sudo systemctl restart apache2
Reference: Link
sudo a2dismod php7.0<br>
sudo a2enmod php7.2<br>
sudo systemctl restart apache2
Reference: Link
edited Apr 29 at 13:23
Rakesh Donga
2,761318
2,761318
answered Apr 29 at 13:14
Hafiz ArslanHafiz Arslan
19013
19013
add a comment |
add a comment |