apt: Install latest stable php and all its extensions

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP












2















The following question is a follow up to this question.



Each time I create a Debian server environment to host my own websites on I install latest yet stable php with different extensions (subpackages); these extensions are needed for some GUIs like PHPMyAdmin or some CMSs like Drupal.



I'm fed up with tracking packages for any latest php install (sometimes some packages are added and some are deprecated).



How could I install only the latest php with all its available packages whatsoever?










share|improve this question
























  • As you put emphasis on latest – which bleeding edge repository are you using? In pure Debian, php-mbstring is a redirection to php7.3-mbstring, which represents the latest version packaged for you.

    – Hermann
    Mar 2 at 10:09












  • I mean to latest-stable versions; I added a link to the question that the current question aims to follow, to better explain what I aspire to have. I just desire to install a latest-stable php package (7.x.x now or 8.x.x at the time when it comes out) but with all its possible extensions).

    – JohnDoea
    Mar 2 at 10:14











  • Out of ignorance, are the dependent packages/extensions not declared as requisites for the phpmyadmin or drupal packages? Just want to rule out the simplest idea of apt install drupal phpmyadmin

    – Jeff Schaller
    Mar 2 at 12:39











  • Some are declared as requisites, but given it changes and I prefer not to follow the changes for PHP extensions, I just want to install all of them, as I have 40GB drive it should be okay as long as security is part of the picture. I guess.

    – JohnDoea
    Mar 2 at 15:48















2















The following question is a follow up to this question.



Each time I create a Debian server environment to host my own websites on I install latest yet stable php with different extensions (subpackages); these extensions are needed for some GUIs like PHPMyAdmin or some CMSs like Drupal.



I'm fed up with tracking packages for any latest php install (sometimes some packages are added and some are deprecated).



How could I install only the latest php with all its available packages whatsoever?










share|improve this question
























  • As you put emphasis on latest – which bleeding edge repository are you using? In pure Debian, php-mbstring is a redirection to php7.3-mbstring, which represents the latest version packaged for you.

    – Hermann
    Mar 2 at 10:09












  • I mean to latest-stable versions; I added a link to the question that the current question aims to follow, to better explain what I aspire to have. I just desire to install a latest-stable php package (7.x.x now or 8.x.x at the time when it comes out) but with all its possible extensions).

    – JohnDoea
    Mar 2 at 10:14











  • Out of ignorance, are the dependent packages/extensions not declared as requisites for the phpmyadmin or drupal packages? Just want to rule out the simplest idea of apt install drupal phpmyadmin

    – Jeff Schaller
    Mar 2 at 12:39











  • Some are declared as requisites, but given it changes and I prefer not to follow the changes for PHP extensions, I just want to install all of them, as I have 40GB drive it should be okay as long as security is part of the picture. I guess.

    – JohnDoea
    Mar 2 at 15:48













2












2








2


0






The following question is a follow up to this question.



Each time I create a Debian server environment to host my own websites on I install latest yet stable php with different extensions (subpackages); these extensions are needed for some GUIs like PHPMyAdmin or some CMSs like Drupal.



I'm fed up with tracking packages for any latest php install (sometimes some packages are added and some are deprecated).



How could I install only the latest php with all its available packages whatsoever?










share|improve this question
















The following question is a follow up to this question.



Each time I create a Debian server environment to host my own websites on I install latest yet stable php with different extensions (subpackages); these extensions are needed for some GUIs like PHPMyAdmin or some CMSs like Drupal.



I'm fed up with tracking packages for any latest php install (sometimes some packages are added and some are deprecated).



How could I install only the latest php with all its available packages whatsoever?







debian ubuntu package-management apache-httpd php






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 6 at 14:12









GAD3R

27.7k1858114




27.7k1858114










asked Mar 2 at 9:39









JohnDoeaJohnDoea

6711137




6711137












  • As you put emphasis on latest – which bleeding edge repository are you using? In pure Debian, php-mbstring is a redirection to php7.3-mbstring, which represents the latest version packaged for you.

    – Hermann
    Mar 2 at 10:09












  • I mean to latest-stable versions; I added a link to the question that the current question aims to follow, to better explain what I aspire to have. I just desire to install a latest-stable php package (7.x.x now or 8.x.x at the time when it comes out) but with all its possible extensions).

    – JohnDoea
    Mar 2 at 10:14











  • Out of ignorance, are the dependent packages/extensions not declared as requisites for the phpmyadmin or drupal packages? Just want to rule out the simplest idea of apt install drupal phpmyadmin

    – Jeff Schaller
    Mar 2 at 12:39











  • Some are declared as requisites, but given it changes and I prefer not to follow the changes for PHP extensions, I just want to install all of them, as I have 40GB drive it should be okay as long as security is part of the picture. I guess.

    – JohnDoea
    Mar 2 at 15:48

















  • As you put emphasis on latest – which bleeding edge repository are you using? In pure Debian, php-mbstring is a redirection to php7.3-mbstring, which represents the latest version packaged for you.

    – Hermann
    Mar 2 at 10:09












  • I mean to latest-stable versions; I added a link to the question that the current question aims to follow, to better explain what I aspire to have. I just desire to install a latest-stable php package (7.x.x now or 8.x.x at the time when it comes out) but with all its possible extensions).

    – JohnDoea
    Mar 2 at 10:14











  • Out of ignorance, are the dependent packages/extensions not declared as requisites for the phpmyadmin or drupal packages? Just want to rule out the simplest idea of apt install drupal phpmyadmin

    – Jeff Schaller
    Mar 2 at 12:39











  • Some are declared as requisites, but given it changes and I prefer not to follow the changes for PHP extensions, I just want to install all of them, as I have 40GB drive it should be okay as long as security is part of the picture. I guess.

    – JohnDoea
    Mar 2 at 15:48
















As you put emphasis on latest – which bleeding edge repository are you using? In pure Debian, php-mbstring is a redirection to php7.3-mbstring, which represents the latest version packaged for you.

– Hermann
Mar 2 at 10:09






As you put emphasis on latest – which bleeding edge repository are you using? In pure Debian, php-mbstring is a redirection to php7.3-mbstring, which represents the latest version packaged for you.

– Hermann
Mar 2 at 10:09














I mean to latest-stable versions; I added a link to the question that the current question aims to follow, to better explain what I aspire to have. I just desire to install a latest-stable php package (7.x.x now or 8.x.x at the time when it comes out) but with all its possible extensions).

– JohnDoea
Mar 2 at 10:14





I mean to latest-stable versions; I added a link to the question that the current question aims to follow, to better explain what I aspire to have. I just desire to install a latest-stable php package (7.x.x now or 8.x.x at the time when it comes out) but with all its possible extensions).

– JohnDoea
Mar 2 at 10:14













Out of ignorance, are the dependent packages/extensions not declared as requisites for the phpmyadmin or drupal packages? Just want to rule out the simplest idea of apt install drupal phpmyadmin

– Jeff Schaller
Mar 2 at 12:39





Out of ignorance, are the dependent packages/extensions not declared as requisites for the phpmyadmin or drupal packages? Just want to rule out the simplest idea of apt install drupal phpmyadmin

– Jeff Schaller
Mar 2 at 12:39













Some are declared as requisites, but given it changes and I prefer not to follow the changes for PHP extensions, I just want to install all of them, as I have 40GB drive it should be okay as long as security is part of the picture. I guess.

– JohnDoea
Mar 2 at 15:48





Some are declared as requisites, but given it changes and I prefer not to follow the changes for PHP extensions, I just want to install all of them, as I have 40GB drive it should be okay as long as security is part of the picture. I guess.

– JohnDoea
Mar 2 at 15:48










1 Answer
1






active

oldest

votes


















2





+50









You could use the following to install the current versions of all the PHP packages provided provided by php-defaults:



apt install $(grep-aptavail -S php-defaults -s Package -n)


(You’ll need to install dctrl-tools first.)



This uses two commands:



grep-aptavail -S php-defaults -s Package -n


searches the packages apt knows about, looking for a source package (-S) matching “php-defaults”, and listing matching binary packages (-s Package) without the field name (-n); the result is used, via command substitution, as arguments to



apt install


which installs the packages.



This will install the default version of PHP and all the extensions provided by PHP, and ensure that they are upgraded as new versions become the default (so when you upgrade from Debian 9 to Debian 10, and PHP 7.3 becomes the default instead of PHP 7.0, all your PHP 7.0 extensions will be upgraded to 7.3). However you’d need to re-run the command to pick up new extensions, and clean up obsolete ones separately.



You could adapt this to install every package which depends on php-common, which would bring in all the available PHP extensions, but that ends up installing far more packages than makes sense.






share|improve this answer

























    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f503940%2fapt-install-latest-stable-php-and-all-its-extensions%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    2





    +50









    You could use the following to install the current versions of all the PHP packages provided provided by php-defaults:



    apt install $(grep-aptavail -S php-defaults -s Package -n)


    (You’ll need to install dctrl-tools first.)



    This uses two commands:



    grep-aptavail -S php-defaults -s Package -n


    searches the packages apt knows about, looking for a source package (-S) matching “php-defaults”, and listing matching binary packages (-s Package) without the field name (-n); the result is used, via command substitution, as arguments to



    apt install


    which installs the packages.



    This will install the default version of PHP and all the extensions provided by PHP, and ensure that they are upgraded as new versions become the default (so when you upgrade from Debian 9 to Debian 10, and PHP 7.3 becomes the default instead of PHP 7.0, all your PHP 7.0 extensions will be upgraded to 7.3). However you’d need to re-run the command to pick up new extensions, and clean up obsolete ones separately.



    You could adapt this to install every package which depends on php-common, which would bring in all the available PHP extensions, but that ends up installing far more packages than makes sense.






    share|improve this answer





























      2





      +50









      You could use the following to install the current versions of all the PHP packages provided provided by php-defaults:



      apt install $(grep-aptavail -S php-defaults -s Package -n)


      (You’ll need to install dctrl-tools first.)



      This uses two commands:



      grep-aptavail -S php-defaults -s Package -n


      searches the packages apt knows about, looking for a source package (-S) matching “php-defaults”, and listing matching binary packages (-s Package) without the field name (-n); the result is used, via command substitution, as arguments to



      apt install


      which installs the packages.



      This will install the default version of PHP and all the extensions provided by PHP, and ensure that they are upgraded as new versions become the default (so when you upgrade from Debian 9 to Debian 10, and PHP 7.3 becomes the default instead of PHP 7.0, all your PHP 7.0 extensions will be upgraded to 7.3). However you’d need to re-run the command to pick up new extensions, and clean up obsolete ones separately.



      You could adapt this to install every package which depends on php-common, which would bring in all the available PHP extensions, but that ends up installing far more packages than makes sense.






      share|improve this answer



























        2





        +50







        2





        +50



        2




        +50





        You could use the following to install the current versions of all the PHP packages provided provided by php-defaults:



        apt install $(grep-aptavail -S php-defaults -s Package -n)


        (You’ll need to install dctrl-tools first.)



        This uses two commands:



        grep-aptavail -S php-defaults -s Package -n


        searches the packages apt knows about, looking for a source package (-S) matching “php-defaults”, and listing matching binary packages (-s Package) without the field name (-n); the result is used, via command substitution, as arguments to



        apt install


        which installs the packages.



        This will install the default version of PHP and all the extensions provided by PHP, and ensure that they are upgraded as new versions become the default (so when you upgrade from Debian 9 to Debian 10, and PHP 7.3 becomes the default instead of PHP 7.0, all your PHP 7.0 extensions will be upgraded to 7.3). However you’d need to re-run the command to pick up new extensions, and clean up obsolete ones separately.



        You could adapt this to install every package which depends on php-common, which would bring in all the available PHP extensions, but that ends up installing far more packages than makes sense.






        share|improve this answer















        You could use the following to install the current versions of all the PHP packages provided provided by php-defaults:



        apt install $(grep-aptavail -S php-defaults -s Package -n)


        (You’ll need to install dctrl-tools first.)



        This uses two commands:



        grep-aptavail -S php-defaults -s Package -n


        searches the packages apt knows about, looking for a source package (-S) matching “php-defaults”, and listing matching binary packages (-s Package) without the field name (-n); the result is used, via command substitution, as arguments to



        apt install


        which installs the packages.



        This will install the default version of PHP and all the extensions provided by PHP, and ensure that they are upgraded as new versions become the default (so when you upgrade from Debian 9 to Debian 10, and PHP 7.3 becomes the default instead of PHP 7.0, all your PHP 7.0 extensions will be upgraded to 7.3). However you’d need to re-run the command to pick up new extensions, and clean up obsolete ones separately.



        You could adapt this to install every package which depends on php-common, which would bring in all the available PHP extensions, but that ends up installing far more packages than makes sense.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Mar 4 at 20:33

























        answered Mar 3 at 19:16









        Stephen KittStephen Kitt

        179k24406484




        179k24406484



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Unix & Linux Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f503940%2fapt-install-latest-stable-php-and-all-its-extensions%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown






            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Displaying single band from multi-band raster using QGIS

            How many registers does an x86_64 CPU actually have?