Skip to content

Instantly share code, notes, and snippets.

@full-stack-king
Last active November 15, 2019 04:10
Show Gist options
  • Save full-stack-king/ea88aee90485260b6d7f182053a862f9 to your computer and use it in GitHub Desktop.
Save full-stack-king/ea88aee90485260b6d7f182053a862f9 to your computer and use it in GitHub Desktop.

Revisions

  1. @Rajakannan Rajakannan revised this gist Nov 15, 2019. 1 changed file with 11 additions and 0 deletions.
    11 changes: 11 additions & 0 deletions ubuntu-php-version-switch.md
    Original file line number Diff line number Diff line change
    @@ -5,23 +5,34 @@
    ## From php5.6 to php7.0 :

    ### Apache:
    >Changing php version for Aapche server
    ```bash
    sudo a2dismod php5.6 ; sudo a2enmod php7.0 ; sudo service apache2 restart
    ```

    ### CLI:
    >Changing php version for command line usage
    ```bash
    sudo ln -sfn /usr/bin/php7.0 /etc/alternatives/php
    ```

    ### Issue
    if it is not working still, you may need to disable the proxy_fcgi apache module and give it a try again

    ```bash
    sudo a2dismod proxy_fcgi proxy; sudo service apache2 restart
    ```

    ## From php7.0 to php5.6:

    ### Apache:
    >Changing php version for Aapche server
    ```bash
    sudo a2dismod php7.0 ; sudo a2enmod php5.6 ; sudo service apache2 restart
    ```

    ### CLI:
    >Changing php version for command line usage
    ```bash
    sudo ln -sfn /usr/bin/php5.6 /etc/alternatives/php
    ```
  2. @Rajakannan Rajakannan revised this gist Nov 15, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion ubuntu-php-version-switch.md
    Original file line number Diff line number Diff line change
    @@ -26,7 +26,7 @@ sudo a2dismod php7.0 ; sudo a2enmod php5.6 ; sudo service apache2 restart
    sudo ln -sfn /usr/bin/php5.6 /etc/alternatives/php
    ```

    ### Patch
    ### Issue
    if it is not working still, you may need to disable the proxy_fcgi apache module and give it a try again

    ```bash
  3. @Rajakannan Rajakannan revised this gist Nov 15, 2019. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions ubuntu-php-version-switch.md
    Original file line number Diff line number Diff line change
    @@ -26,6 +26,7 @@ sudo a2dismod php7.0 ; sudo a2enmod php5.6 ; sudo service apache2 restart
    sudo ln -sfn /usr/bin/php5.6 /etc/alternatives/php
    ```

    ### Patch
    if it is not working still, you may need to disable the proxy_fcgi apache module and give it a try again

    ```bash
  4. @Rajakannan Rajakannan revised this gist Nov 15, 2019. No changes.
  5. @Rajakannan Rajakannan revised this gist Nov 15, 2019. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions ubuntu-php-version-switch.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,7 @@
    # Switch PHP version:

    >Note: change PHP version numbers to match your requirement. I have used 5.6 and 7.0
    ## From php5.6 to php7.0 :

    ### Apache:
  6. @Rajakannan Rajakannan revised this gist Nov 15, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion ubuntu-php-version-switch.md
    Original file line number Diff line number Diff line change
    @@ -24,7 +24,7 @@ sudo a2dismod php7.0 ; sudo a2enmod php5.6 ; sudo service apache2 restart
    sudo ln -sfn /usr/bin/php5.6 /etc/alternatives/php
    ```

    if you it is not working still, you may need to disable the proxy_fcgi apache module and give it a try again
    if it is not working still, you may need to disable the proxy_fcgi apache module and give it a try again

    ```bash
    sudo a2dismod proxy_fcgi proxy; sudo service apache2 restart
  7. @Rajakannan Rajakannan revised this gist Nov 15, 2019. 1 changed file with 11 additions and 1 deletion.
    12 changes: 11 additions & 1 deletion ubuntu-php-version-switch.md
    Original file line number Diff line number Diff line change
    @@ -3,19 +3,29 @@
    ## From php5.6 to php7.0 :

    ### Apache:
    ```bash
    sudo a2dismod php5.6 ; sudo a2enmod php7.0 ; sudo service apache2 restart
    ```

    ### CLI:
    ```bash
    sudo ln -sfn /usr/bin/php7.0 /etc/alternatives/php
    ```

    ## From php7.0 to php5.6:

    ### Apache:
    ```bash
    sudo a2dismod php7.0 ; sudo a2enmod php5.6 ; sudo service apache2 restart
    ```

    ### CLI:
    ```bash
    sudo ln -sfn /usr/bin/php5.6 /etc/alternatives/php
    ```

    if you it is not working still, you may need to disable the proxy_fcgi apache module and give it a try again

    sudo a2dismod proxy_fcgi proxy; sudo service apache2 restart
    ```bash
    sudo a2dismod proxy_fcgi proxy; sudo service apache2 restart
    ```
  8. @Rajakannan Rajakannan revised this gist Nov 15, 2019. 1 changed file with 8 additions and 8 deletions.
    16 changes: 8 additions & 8 deletions ubuntu-php-version-switch.md
    Original file line number Diff line number Diff line change
    @@ -1,21 +1,21 @@
    #Switch PHP version:
    # Switch PHP version:

    ##From php5.6 to php7.0 :
    ## From php5.6 to php7.0 :

    ###Apache:
    ### Apache:
    sudo a2dismod php5.6 ; sudo a2enmod php7.0 ; sudo service apache2 restart

    ###CLI:
    ### CLI:
    sudo ln -sfn /usr/bin/php7.0 /etc/alternatives/php

    ##From php7.0 to php5.6:
    ## From php7.0 to php5.6:

    ###Apache:
    ### Apache:
    sudo a2dismod php7.0 ; sudo a2enmod php5.6 ; sudo service apache2 restart

    ###CLI:
    ### CLI:
    sudo ln -sfn /usr/bin/php5.6 /etc/alternatives/php

    if you it is not working still, you may need to disable the proxy_fcgi apache module and give it a try again

    sudo a2dismod proxy_fcgi proxy; sudo service apache2 restart
    sudo a2dismod proxy_fcgi proxy; sudo service apache2 restart
  9. @Rajakannan Rajakannan renamed this gist Nov 15, 2019. 1 changed file with 7 additions and 7 deletions.
    14 changes: 7 additions & 7 deletions ubuntu-php-version-switch.txt → ubuntu-php-version-switch.md
    Original file line number Diff line number Diff line change
    @@ -1,19 +1,19 @@
    Switch PHP version:
    #Switch PHP version:

    From php5.6 to php7.0 :
    ##From php5.6 to php7.0 :

    Apache:
    ###Apache:
    sudo a2dismod php5.6 ; sudo a2enmod php7.0 ; sudo service apache2 restart

    CLI:
    ###CLI:
    sudo ln -sfn /usr/bin/php7.0 /etc/alternatives/php

    From php7.0 to php5.6:
    ##From php7.0 to php5.6:

    Apache:
    ###Apache:
    sudo a2dismod php7.0 ; sudo a2enmod php5.6 ; sudo service apache2 restart

    CLI:
    ###CLI:
    sudo ln -sfn /usr/bin/php5.6 /etc/alternatives/php

    if you it is not working still, you may need to disable the proxy_fcgi apache module and give it a try again
  10. @Rajakannan Rajakannan revised this gist Nov 15, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion ubuntu-php-version-switch.txt
    Original file line number Diff line number Diff line change
    @@ -16,6 +16,6 @@ sudo a2dismod php7.0 ; sudo a2enmod php5.6 ; sudo service apache2 restart
    CLI:
    sudo ln -sfn /usr/bin/php5.6 /etc/alternatives/php

    if after you follow the below instructions you face this situation, you may need to disable the proxy_fcgi apache module:
    if you it is not working still, you may need to disable the proxy_fcgi apache module and give it a try again

    sudo a2dismod proxy_fcgi proxy; sudo service apache2 restart
  11. @Rajakannan Rajakannan revised this gist Oct 2, 2016. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion ubuntu-php-version-switch.txt
    Original file line number Diff line number Diff line change
    @@ -14,4 +14,8 @@ Apache:
    sudo a2dismod php7.0 ; sudo a2enmod php5.6 ; sudo service apache2 restart

    CLI:
    sudo ln -sfn /usr/bin/php5.6 /etc/alternatives/php
    sudo ln -sfn /usr/bin/php5.6 /etc/alternatives/php

    if after you follow the below instructions you face this situation, you may need to disable the proxy_fcgi apache module:

    sudo a2dismod proxy_fcgi proxy; sudo service apache2 restart
  12. @Rajakannan Rajakannan created this gist Oct 2, 2016.
    17 changes: 17 additions & 0 deletions ubuntu-php-version-switch.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    Switch PHP version:

    From php5.6 to php7.0 :

    Apache:
    sudo a2dismod php5.6 ; sudo a2enmod php7.0 ; sudo service apache2 restart

    CLI:
    sudo ln -sfn /usr/bin/php7.0 /etc/alternatives/php

    From php7.0 to php5.6:

    Apache:
    sudo a2dismod php7.0 ; sudo a2enmod php5.6 ; sudo service apache2 restart

    CLI:
    sudo ln -sfn /usr/bin/php5.6 /etc/alternatives/php