Install PHP5 on Ubuntu 18.04How can I downgrade from PHP 7 to PHP 5.6 on Ubuntu 16.04?cannot install...

What is better: yes / no radio, or simple checkbox?

What's the difference between a cart and a wagon?

"Murder!" The knight said

Did 5.25" floppies undergo a change in magnetic coating?

Called into a meeting and told we are being made redundant (laid off) and "not to share outside". Can I tell my partner?

Linear regression when Y is bounded and discrete

Where was Karl Mordo in Infinity War?

I encountered my boss during an on-site interview at another company. Should I bring it up when seeing him next time?

Has the Isbell–Freyd criterion ever been used to check that a category is concretisable?

How to count words in a line

Make me a metasequence

Where is this triangular-shaped space station from?

Is my plan for fixing my water heater leak bad?

Can you use a beast's innate abilities while polymorphed?

How can I handle a player who pre-plans arguments about my rulings on RAW?

Does music exist in Panem? And if so, what kinds of music?

What to do when being responsible for data protection in your lab, yet advice is ignored?

Use comma instead of & in table

Reason Why Dimensional Travelling Would be Restricted

What is the difference between ashamed and shamed?

Are small insurances worth it

Where is the fallacy here?

Hacker Rank: Array left rotation

Sometimes a banana is just a banana



Install PHP5 on Ubuntu 18.04


How can I downgrade from PHP 7 to PHP 5.6 on Ubuntu 16.04?cannot install php5-mysqlInstall (Upgrade) php7 on Ubuntu 15.10 apache2Trouble installing PHP5 modulesApache works with php7, but crashes with php5How to install Google App Engine SDK for PHP on Ubuntu 16.04+Unable to install mbstring for PHP 7apache show me php5 but I have already install php7apt-get install php5-imap (missing dependancies)php5-curl not found on webserverhow to install php5.6 on ubuntu 16.04 for box billing













12















I have an old PHP tool running which is not easily adaptable to PHP7. So I have to run PHP5 on my server.



How can I install PHP5 on Ubuntu Bionic Beaver?










share|improve this question



























    12















    I have an old PHP tool running which is not easily adaptable to PHP7. So I have to run PHP5 on my server.



    How can I install PHP5 on Ubuntu Bionic Beaver?










    share|improve this question

























      12












      12








      12


      1






      I have an old PHP tool running which is not easily adaptable to PHP7. So I have to run PHP5 on my server.



      How can I install PHP5 on Ubuntu Bionic Beaver?










      share|improve this question














      I have an old PHP tool running which is not easily adaptable to PHP7. So I have to run PHP5 on my server.



      How can I install PHP5 on Ubuntu Bionic Beaver?







      18.04 php






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jun 21 '18 at 16:33









      rubo77rubo77

      15.1k3195201




      15.1k3195201






















          3 Answers
          3






          active

          oldest

          votes


















          24














          You can install PHP5.6 from a PPA:



          sudo add-apt-repository -y ppa:ondrej/php
          sudo apt update
          sudo apt install php5.6


          source: https://askubuntu.com/a/762161/34298






          share|improve this answer


























          • first you need to install "sudo apt install software-properties-commo" to get the "add-apt-repository"command

            – ZFNerd
            Jan 28 at 8:35





















          1














          You may want to consider running your PHP 5 tool in a container, e.g. Docker. PHP 5 is nearing End-of-life and if you use PHP 7 on the same machine you may run in to conflicts.



          There are several official Docker images available for PHP 5: https://hub.docker.com/_/php/






          share|improve this answer
























          • Is this any more secure than just install PHP 5? I don't need PHP 7 on that mashine

            – rubo77
            Aug 13 '18 at 12:42











          • You don't need a container environment if you do not need PHP 7 at all, just uninstall PHP 7 and install PHP 5 from the ondrej repo in the other answer in that case.

            – RedScourge
            30 mins ago



















          0














          Several choices, as mentioned by the other answers:




          • Use the Ondrej/php PPA repo to install PHP 5.6:


          Like this:



          sudo add-apt-repository -y ppa:ondrej/php
          sudo apt update
          sudo apt install php5.6



          • Use Docker or LXD container systems to build a small PHP 5 environment, run it inside Ubuntu 18.04, and forward all web requests requiring PHP 5 to it. I hear you can actually convert an entire VM of Ubuntu 12.04 or 14.04 to a container with lxd-p2c and run it inside Ubuntu 18.04, kind of like they do in this presentation: "Turning physical systems into containers Migrating to system containers"


          • You can also set up a second server (or VM) and just have Apache on the 18.04 main system to proxy requests for sites requiring PHP 5 to it. That system does not need to be web accessible, as the 18.04 system will be the one exposed to the outside world. If you require register_globals, you can either use Ubuntu 12.04 with PHP 5.3.2 which is no longer officially supported, or Ubuntu 14.04 with PHP 5.5.9 with a code snippet at the start of all your files to emulate register_globals. I forget the code snippet but you can look it up. Here's the relevant config files that should probably work for proxying an SSL site from one server to another, assuming the rest of your config is proper and the requred mods are enabled:



          On Ubuntu 18.04 Apache server doing the proxying at 192.168.1.2:



          #requires mod_remoteip and mod_proxy
          RemoteIPHeader X-Forwarded-For
          TrustedProxy 192.168.1.2

          SSLProxyEngine On
          ProxyPreserveHost On
          ProxyPass / https://example.org/ retry=0
          ProxyPassReverse https://example.org/ retry=0


          On Ubuntu 14.04 server being proxied to at 192.168.1.3:



          #requires mod_proxy
          RemoteIPHeader X-Forwarded-For
          RemoteIPInternalProxy 192.168.1.2
          RemoteIPInternalProxy 192.168.1.1 #assuming your router IP is 1.1




          share























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "89"
            };
            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: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            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%2faskubuntu.com%2fquestions%2f1048581%2finstall-php5-on-ubuntu-18-04%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            3 Answers
            3






            active

            oldest

            votes








            3 Answers
            3






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            24














            You can install PHP5.6 from a PPA:



            sudo add-apt-repository -y ppa:ondrej/php
            sudo apt update
            sudo apt install php5.6


            source: https://askubuntu.com/a/762161/34298






            share|improve this answer


























            • first you need to install "sudo apt install software-properties-commo" to get the "add-apt-repository"command

              – ZFNerd
              Jan 28 at 8:35


















            24














            You can install PHP5.6 from a PPA:



            sudo add-apt-repository -y ppa:ondrej/php
            sudo apt update
            sudo apt install php5.6


            source: https://askubuntu.com/a/762161/34298






            share|improve this answer


























            • first you need to install "sudo apt install software-properties-commo" to get the "add-apt-repository"command

              – ZFNerd
              Jan 28 at 8:35
















            24












            24








            24







            You can install PHP5.6 from a PPA:



            sudo add-apt-repository -y ppa:ondrej/php
            sudo apt update
            sudo apt install php5.6


            source: https://askubuntu.com/a/762161/34298






            share|improve this answer















            You can install PHP5.6 from a PPA:



            sudo add-apt-repository -y ppa:ondrej/php
            sudo apt update
            sudo apt install php5.6


            source: https://askubuntu.com/a/762161/34298







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Jun 21 '18 at 19:02

























            answered Jun 21 '18 at 17:11









            rubo77rubo77

            15.1k3195201




            15.1k3195201













            • first you need to install "sudo apt install software-properties-commo" to get the "add-apt-repository"command

              – ZFNerd
              Jan 28 at 8:35





















            • first you need to install "sudo apt install software-properties-commo" to get the "add-apt-repository"command

              – ZFNerd
              Jan 28 at 8:35



















            first you need to install "sudo apt install software-properties-commo" to get the "add-apt-repository"command

            – ZFNerd
            Jan 28 at 8:35







            first you need to install "sudo apt install software-properties-commo" to get the "add-apt-repository"command

            – ZFNerd
            Jan 28 at 8:35















            1














            You may want to consider running your PHP 5 tool in a container, e.g. Docker. PHP 5 is nearing End-of-life and if you use PHP 7 on the same machine you may run in to conflicts.



            There are several official Docker images available for PHP 5: https://hub.docker.com/_/php/






            share|improve this answer
























            • Is this any more secure than just install PHP 5? I don't need PHP 7 on that mashine

              – rubo77
              Aug 13 '18 at 12:42











            • You don't need a container environment if you do not need PHP 7 at all, just uninstall PHP 7 and install PHP 5 from the ondrej repo in the other answer in that case.

              – RedScourge
              30 mins ago
















            1














            You may want to consider running your PHP 5 tool in a container, e.g. Docker. PHP 5 is nearing End-of-life and if you use PHP 7 on the same machine you may run in to conflicts.



            There are several official Docker images available for PHP 5: https://hub.docker.com/_/php/






            share|improve this answer
























            • Is this any more secure than just install PHP 5? I don't need PHP 7 on that mashine

              – rubo77
              Aug 13 '18 at 12:42











            • You don't need a container environment if you do not need PHP 7 at all, just uninstall PHP 7 and install PHP 5 from the ondrej repo in the other answer in that case.

              – RedScourge
              30 mins ago














            1












            1








            1







            You may want to consider running your PHP 5 tool in a container, e.g. Docker. PHP 5 is nearing End-of-life and if you use PHP 7 on the same machine you may run in to conflicts.



            There are several official Docker images available for PHP 5: https://hub.docker.com/_/php/






            share|improve this answer













            You may want to consider running your PHP 5 tool in a container, e.g. Docker. PHP 5 is nearing End-of-life and if you use PHP 7 on the same machine you may run in to conflicts.



            There are several official Docker images available for PHP 5: https://hub.docker.com/_/php/







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Jun 21 '18 at 16:57









            Abry RathAbry Rath

            111




            111













            • Is this any more secure than just install PHP 5? I don't need PHP 7 on that mashine

              – rubo77
              Aug 13 '18 at 12:42











            • You don't need a container environment if you do not need PHP 7 at all, just uninstall PHP 7 and install PHP 5 from the ondrej repo in the other answer in that case.

              – RedScourge
              30 mins ago



















            • Is this any more secure than just install PHP 5? I don't need PHP 7 on that mashine

              – rubo77
              Aug 13 '18 at 12:42











            • You don't need a container environment if you do not need PHP 7 at all, just uninstall PHP 7 and install PHP 5 from the ondrej repo in the other answer in that case.

              – RedScourge
              30 mins ago

















            Is this any more secure than just install PHP 5? I don't need PHP 7 on that mashine

            – rubo77
            Aug 13 '18 at 12:42





            Is this any more secure than just install PHP 5? I don't need PHP 7 on that mashine

            – rubo77
            Aug 13 '18 at 12:42













            You don't need a container environment if you do not need PHP 7 at all, just uninstall PHP 7 and install PHP 5 from the ondrej repo in the other answer in that case.

            – RedScourge
            30 mins ago





            You don't need a container environment if you do not need PHP 7 at all, just uninstall PHP 7 and install PHP 5 from the ondrej repo in the other answer in that case.

            – RedScourge
            30 mins ago











            0














            Several choices, as mentioned by the other answers:




            • Use the Ondrej/php PPA repo to install PHP 5.6:


            Like this:



            sudo add-apt-repository -y ppa:ondrej/php
            sudo apt update
            sudo apt install php5.6



            • Use Docker or LXD container systems to build a small PHP 5 environment, run it inside Ubuntu 18.04, and forward all web requests requiring PHP 5 to it. I hear you can actually convert an entire VM of Ubuntu 12.04 or 14.04 to a container with lxd-p2c and run it inside Ubuntu 18.04, kind of like they do in this presentation: "Turning physical systems into containers Migrating to system containers"


            • You can also set up a second server (or VM) and just have Apache on the 18.04 main system to proxy requests for sites requiring PHP 5 to it. That system does not need to be web accessible, as the 18.04 system will be the one exposed to the outside world. If you require register_globals, you can either use Ubuntu 12.04 with PHP 5.3.2 which is no longer officially supported, or Ubuntu 14.04 with PHP 5.5.9 with a code snippet at the start of all your files to emulate register_globals. I forget the code snippet but you can look it up. Here's the relevant config files that should probably work for proxying an SSL site from one server to another, assuming the rest of your config is proper and the requred mods are enabled:



            On Ubuntu 18.04 Apache server doing the proxying at 192.168.1.2:



            #requires mod_remoteip and mod_proxy
            RemoteIPHeader X-Forwarded-For
            TrustedProxy 192.168.1.2

            SSLProxyEngine On
            ProxyPreserveHost On
            ProxyPass / https://example.org/ retry=0
            ProxyPassReverse https://example.org/ retry=0


            On Ubuntu 14.04 server being proxied to at 192.168.1.3:



            #requires mod_proxy
            RemoteIPHeader X-Forwarded-For
            RemoteIPInternalProxy 192.168.1.2
            RemoteIPInternalProxy 192.168.1.1 #assuming your router IP is 1.1




            share




























              0














              Several choices, as mentioned by the other answers:




              • Use the Ondrej/php PPA repo to install PHP 5.6:


              Like this:



              sudo add-apt-repository -y ppa:ondrej/php
              sudo apt update
              sudo apt install php5.6



              • Use Docker or LXD container systems to build a small PHP 5 environment, run it inside Ubuntu 18.04, and forward all web requests requiring PHP 5 to it. I hear you can actually convert an entire VM of Ubuntu 12.04 or 14.04 to a container with lxd-p2c and run it inside Ubuntu 18.04, kind of like they do in this presentation: "Turning physical systems into containers Migrating to system containers"


              • You can also set up a second server (or VM) and just have Apache on the 18.04 main system to proxy requests for sites requiring PHP 5 to it. That system does not need to be web accessible, as the 18.04 system will be the one exposed to the outside world. If you require register_globals, you can either use Ubuntu 12.04 with PHP 5.3.2 which is no longer officially supported, or Ubuntu 14.04 with PHP 5.5.9 with a code snippet at the start of all your files to emulate register_globals. I forget the code snippet but you can look it up. Here's the relevant config files that should probably work for proxying an SSL site from one server to another, assuming the rest of your config is proper and the requred mods are enabled:



              On Ubuntu 18.04 Apache server doing the proxying at 192.168.1.2:



              #requires mod_remoteip and mod_proxy
              RemoteIPHeader X-Forwarded-For
              TrustedProxy 192.168.1.2

              SSLProxyEngine On
              ProxyPreserveHost On
              ProxyPass / https://example.org/ retry=0
              ProxyPassReverse https://example.org/ retry=0


              On Ubuntu 14.04 server being proxied to at 192.168.1.3:



              #requires mod_proxy
              RemoteIPHeader X-Forwarded-For
              RemoteIPInternalProxy 192.168.1.2
              RemoteIPInternalProxy 192.168.1.1 #assuming your router IP is 1.1




              share


























                0












                0








                0







                Several choices, as mentioned by the other answers:




                • Use the Ondrej/php PPA repo to install PHP 5.6:


                Like this:



                sudo add-apt-repository -y ppa:ondrej/php
                sudo apt update
                sudo apt install php5.6



                • Use Docker or LXD container systems to build a small PHP 5 environment, run it inside Ubuntu 18.04, and forward all web requests requiring PHP 5 to it. I hear you can actually convert an entire VM of Ubuntu 12.04 or 14.04 to a container with lxd-p2c and run it inside Ubuntu 18.04, kind of like they do in this presentation: "Turning physical systems into containers Migrating to system containers"


                • You can also set up a second server (or VM) and just have Apache on the 18.04 main system to proxy requests for sites requiring PHP 5 to it. That system does not need to be web accessible, as the 18.04 system will be the one exposed to the outside world. If you require register_globals, you can either use Ubuntu 12.04 with PHP 5.3.2 which is no longer officially supported, or Ubuntu 14.04 with PHP 5.5.9 with a code snippet at the start of all your files to emulate register_globals. I forget the code snippet but you can look it up. Here's the relevant config files that should probably work for proxying an SSL site from one server to another, assuming the rest of your config is proper and the requred mods are enabled:



                On Ubuntu 18.04 Apache server doing the proxying at 192.168.1.2:



                #requires mod_remoteip and mod_proxy
                RemoteIPHeader X-Forwarded-For
                TrustedProxy 192.168.1.2

                SSLProxyEngine On
                ProxyPreserveHost On
                ProxyPass / https://example.org/ retry=0
                ProxyPassReverse https://example.org/ retry=0


                On Ubuntu 14.04 server being proxied to at 192.168.1.3:



                #requires mod_proxy
                RemoteIPHeader X-Forwarded-For
                RemoteIPInternalProxy 192.168.1.2
                RemoteIPInternalProxy 192.168.1.1 #assuming your router IP is 1.1




                share













                Several choices, as mentioned by the other answers:




                • Use the Ondrej/php PPA repo to install PHP 5.6:


                Like this:



                sudo add-apt-repository -y ppa:ondrej/php
                sudo apt update
                sudo apt install php5.6



                • Use Docker or LXD container systems to build a small PHP 5 environment, run it inside Ubuntu 18.04, and forward all web requests requiring PHP 5 to it. I hear you can actually convert an entire VM of Ubuntu 12.04 or 14.04 to a container with lxd-p2c and run it inside Ubuntu 18.04, kind of like they do in this presentation: "Turning physical systems into containers Migrating to system containers"


                • You can also set up a second server (or VM) and just have Apache on the 18.04 main system to proxy requests for sites requiring PHP 5 to it. That system does not need to be web accessible, as the 18.04 system will be the one exposed to the outside world. If you require register_globals, you can either use Ubuntu 12.04 with PHP 5.3.2 which is no longer officially supported, or Ubuntu 14.04 with PHP 5.5.9 with a code snippet at the start of all your files to emulate register_globals. I forget the code snippet but you can look it up. Here's the relevant config files that should probably work for proxying an SSL site from one server to another, assuming the rest of your config is proper and the requred mods are enabled:



                On Ubuntu 18.04 Apache server doing the proxying at 192.168.1.2:



                #requires mod_remoteip and mod_proxy
                RemoteIPHeader X-Forwarded-For
                TrustedProxy 192.168.1.2

                SSLProxyEngine On
                ProxyPreserveHost On
                ProxyPass / https://example.org/ retry=0
                ProxyPassReverse https://example.org/ retry=0


                On Ubuntu 14.04 server being proxied to at 192.168.1.3:



                #requires mod_proxy
                RemoteIPHeader X-Forwarded-For
                RemoteIPInternalProxy 192.168.1.2
                RemoteIPInternalProxy 192.168.1.1 #assuming your router IP is 1.1





                share











                share


                share










                answered 6 mins ago









                RedScourgeRedScourge

                101




                101






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Ask Ubuntu!


                    • 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%2faskubuntu.com%2fquestions%2f1048581%2finstall-php5-on-ubuntu-18-04%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

                    Why do type traits not work with types in namespace scope?What are POD types in C++?Why can templates only be...

                    Will tsunami waves travel forever if there was no land?Why do tsunami waves begin with the water flowing away...

                    Should I use Docker or LXD?How to cache (more) data on SSD/RAM to avoid spin up?Unable to get Windows File...