PHP shows up as plain text after upgrade to 18.04

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








up vote
4
down vote

favorite
1












I've just upgraded to Ubuntu 18.04. Now apache serves my website's php as plaintext php. I've already tried:
Why are my PHP files showing as plain text? (on Stack Overflow) and PHP 7 and apache displays plain text and cannot be restarted. The installed php packages are:



php php7.2-cli php7.2-fpm php7.2-mbstring php7.2-pgsql php7.2-sqlite3 php7.2-zip php-curl php-igbinary php-pgsql php-xml
php7.2 php7.2-common php7.2-gd php7.2-mysql php7.2-readline php7.2-xml php-bz2 php-fpm php-mbstring php-soap php-xmlrpc
php7.2-bz2 php7.2-curl php7.2-json php7.2-opcache php7.2-soap php7.2-xmlrpc php-common php-gd php-mysql php-sqlite3 php-zip


One of the websites in question can be seen here.



The apache error.log:



[Thu Apr 26 16:02:12.740886 2018] [mpm_prefork:notice] [pid 6504] AH00169: caught SIGTERM, shutting down

[Thu Apr 26 16:02:13.001806 2018] [mpm_prefork:notice] [pid 7704] AH00163: Apache/2.4.29 (Ubuntu) OpenSSL/1.1.0g configured -- resuming normal operations

[Thu Apr 26 16:02:13.001900 2018] [core:notice] [pid 7704] AH00094: Command line: '/usr/sbin/apache2'


And the access.log:



<MYIP> - - [26/Apr/2018:16:02:40 +0200] "-" 408 3435 "-" "-"

<MYIP> - - [26/Apr/2018:16:02:40 +0200] "-" 408 3435 "-" "-"

<MYIP> - - [26/Apr/2018:16:02:40 +0200] "-" 408 3435 "-" "-"






share|improve this question






















  • Probably you should install and enable the right Apache's php module libapache2-mod-php7.2 (and purge the old one).
    – pa4080
    Apr 26 at 14:14










  • libapache2-mod-php7.2 is already the newest version. :(
    – Benedikt Wutzi
    Apr 26 at 14:15










  • Maybe you should enable it: sudo a2enmod php7.2.
    – pa4080
    Apr 26 at 14:16






  • 1




    Module php7.2 already enabled. ;)
    – Benedikt Wutzi
    Apr 26 at 14:17






  • 1




    Could you write the answer as an answer then please? It would be helpful if other people stumble upon the same situation
    – Yann Bergonzat
    Apr 26 at 15:05














up vote
4
down vote

favorite
1












I've just upgraded to Ubuntu 18.04. Now apache serves my website's php as plaintext php. I've already tried:
Why are my PHP files showing as plain text? (on Stack Overflow) and PHP 7 and apache displays plain text and cannot be restarted. The installed php packages are:



php php7.2-cli php7.2-fpm php7.2-mbstring php7.2-pgsql php7.2-sqlite3 php7.2-zip php-curl php-igbinary php-pgsql php-xml
php7.2 php7.2-common php7.2-gd php7.2-mysql php7.2-readline php7.2-xml php-bz2 php-fpm php-mbstring php-soap php-xmlrpc
php7.2-bz2 php7.2-curl php7.2-json php7.2-opcache php7.2-soap php7.2-xmlrpc php-common php-gd php-mysql php-sqlite3 php-zip


One of the websites in question can be seen here.



The apache error.log:



[Thu Apr 26 16:02:12.740886 2018] [mpm_prefork:notice] [pid 6504] AH00169: caught SIGTERM, shutting down

[Thu Apr 26 16:02:13.001806 2018] [mpm_prefork:notice] [pid 7704] AH00163: Apache/2.4.29 (Ubuntu) OpenSSL/1.1.0g configured -- resuming normal operations

[Thu Apr 26 16:02:13.001900 2018] [core:notice] [pid 7704] AH00094: Command line: '/usr/sbin/apache2'


And the access.log:



<MYIP> - - [26/Apr/2018:16:02:40 +0200] "-" 408 3435 "-" "-"

<MYIP> - - [26/Apr/2018:16:02:40 +0200] "-" 408 3435 "-" "-"

<MYIP> - - [26/Apr/2018:16:02:40 +0200] "-" 408 3435 "-" "-"






share|improve this question






















  • Probably you should install and enable the right Apache's php module libapache2-mod-php7.2 (and purge the old one).
    – pa4080
    Apr 26 at 14:14










  • libapache2-mod-php7.2 is already the newest version. :(
    – Benedikt Wutzi
    Apr 26 at 14:15










  • Maybe you should enable it: sudo a2enmod php7.2.
    – pa4080
    Apr 26 at 14:16






  • 1




    Module php7.2 already enabled. ;)
    – Benedikt Wutzi
    Apr 26 at 14:17






  • 1




    Could you write the answer as an answer then please? It would be helpful if other people stumble upon the same situation
    – Yann Bergonzat
    Apr 26 at 15:05












up vote
4
down vote

favorite
1









up vote
4
down vote

favorite
1






1





I've just upgraded to Ubuntu 18.04. Now apache serves my website's php as plaintext php. I've already tried:
Why are my PHP files showing as plain text? (on Stack Overflow) and PHP 7 and apache displays plain text and cannot be restarted. The installed php packages are:



php php7.2-cli php7.2-fpm php7.2-mbstring php7.2-pgsql php7.2-sqlite3 php7.2-zip php-curl php-igbinary php-pgsql php-xml
php7.2 php7.2-common php7.2-gd php7.2-mysql php7.2-readline php7.2-xml php-bz2 php-fpm php-mbstring php-soap php-xmlrpc
php7.2-bz2 php7.2-curl php7.2-json php7.2-opcache php7.2-soap php7.2-xmlrpc php-common php-gd php-mysql php-sqlite3 php-zip


One of the websites in question can be seen here.



The apache error.log:



[Thu Apr 26 16:02:12.740886 2018] [mpm_prefork:notice] [pid 6504] AH00169: caught SIGTERM, shutting down

[Thu Apr 26 16:02:13.001806 2018] [mpm_prefork:notice] [pid 7704] AH00163: Apache/2.4.29 (Ubuntu) OpenSSL/1.1.0g configured -- resuming normal operations

[Thu Apr 26 16:02:13.001900 2018] [core:notice] [pid 7704] AH00094: Command line: '/usr/sbin/apache2'


And the access.log:



<MYIP> - - [26/Apr/2018:16:02:40 +0200] "-" 408 3435 "-" "-"

<MYIP> - - [26/Apr/2018:16:02:40 +0200] "-" 408 3435 "-" "-"

<MYIP> - - [26/Apr/2018:16:02:40 +0200] "-" 408 3435 "-" "-"






share|improve this question














I've just upgraded to Ubuntu 18.04. Now apache serves my website's php as plaintext php. I've already tried:
Why are my PHP files showing as plain text? (on Stack Overflow) and PHP 7 and apache displays plain text and cannot be restarted. The installed php packages are:



php php7.2-cli php7.2-fpm php7.2-mbstring php7.2-pgsql php7.2-sqlite3 php7.2-zip php-curl php-igbinary php-pgsql php-xml
php7.2 php7.2-common php7.2-gd php7.2-mysql php7.2-readline php7.2-xml php-bz2 php-fpm php-mbstring php-soap php-xmlrpc
php7.2-bz2 php7.2-curl php7.2-json php7.2-opcache php7.2-soap php7.2-xmlrpc php-common php-gd php-mysql php-sqlite3 php-zip


One of the websites in question can be seen here.



The apache error.log:



[Thu Apr 26 16:02:12.740886 2018] [mpm_prefork:notice] [pid 6504] AH00169: caught SIGTERM, shutting down

[Thu Apr 26 16:02:13.001806 2018] [mpm_prefork:notice] [pid 7704] AH00163: Apache/2.4.29 (Ubuntu) OpenSSL/1.1.0g configured -- resuming normal operations

[Thu Apr 26 16:02:13.001900 2018] [core:notice] [pid 7704] AH00094: Command line: '/usr/sbin/apache2'


And the access.log:



<MYIP> - - [26/Apr/2018:16:02:40 +0200] "-" 408 3435 "-" "-"

<MYIP> - - [26/Apr/2018:16:02:40 +0200] "-" 408 3435 "-" "-"

<MYIP> - - [26/Apr/2018:16:02:40 +0200] "-" 408 3435 "-" "-"








share|improve this question













share|improve this question




share|improve this question








edited Apr 27 at 8:54









Zanna

48k13119227




48k13119227










asked Apr 26 at 14:10









Benedikt Wutzi

235




235











  • Probably you should install and enable the right Apache's php module libapache2-mod-php7.2 (and purge the old one).
    – pa4080
    Apr 26 at 14:14










  • libapache2-mod-php7.2 is already the newest version. :(
    – Benedikt Wutzi
    Apr 26 at 14:15










  • Maybe you should enable it: sudo a2enmod php7.2.
    – pa4080
    Apr 26 at 14:16






  • 1




    Module php7.2 already enabled. ;)
    – Benedikt Wutzi
    Apr 26 at 14:17






  • 1




    Could you write the answer as an answer then please? It would be helpful if other people stumble upon the same situation
    – Yann Bergonzat
    Apr 26 at 15:05
















  • Probably you should install and enable the right Apache's php module libapache2-mod-php7.2 (and purge the old one).
    – pa4080
    Apr 26 at 14:14










  • libapache2-mod-php7.2 is already the newest version. :(
    – Benedikt Wutzi
    Apr 26 at 14:15










  • Maybe you should enable it: sudo a2enmod php7.2.
    – pa4080
    Apr 26 at 14:16






  • 1




    Module php7.2 already enabled. ;)
    – Benedikt Wutzi
    Apr 26 at 14:17






  • 1




    Could you write the answer as an answer then please? It would be helpful if other people stumble upon the same situation
    – Yann Bergonzat
    Apr 26 at 15:05















Probably you should install and enable the right Apache's php module libapache2-mod-php7.2 (and purge the old one).
– pa4080
Apr 26 at 14:14




Probably you should install and enable the right Apache's php module libapache2-mod-php7.2 (and purge the old one).
– pa4080
Apr 26 at 14:14












libapache2-mod-php7.2 is already the newest version. :(
– Benedikt Wutzi
Apr 26 at 14:15




libapache2-mod-php7.2 is already the newest version. :(
– Benedikt Wutzi
Apr 26 at 14:15












Maybe you should enable it: sudo a2enmod php7.2.
– pa4080
Apr 26 at 14:16




Maybe you should enable it: sudo a2enmod php7.2.
– pa4080
Apr 26 at 14:16




1




1




Module php7.2 already enabled. ;)
– Benedikt Wutzi
Apr 26 at 14:17




Module php7.2 already enabled. ;)
– Benedikt Wutzi
Apr 26 at 14:17




1




1




Could you write the answer as an answer then please? It would be helpful if other people stumble upon the same situation
– Yann Bergonzat
Apr 26 at 15:05




Could you write the answer as an answer then please? It would be helpful if other people stumble upon the same situation
– Yann Bergonzat
Apr 26 at 15:05










3 Answers
3






active

oldest

votes

















up vote
9
down vote



accepted










This is what got my installation sorted



sudo apt install php7.2 php7.2-common php7.2-cli
sudo a2enmod php7.2





share|improve this answer




















  • Thanks, to me enabling php7.2 module worked perfectly,- seems there was conflicts between multiple versions of php
    – Agnius Vasiliauskas
    Aug 28 at 16:13

















up vote
2
down vote













Actually, in addition to the commands in this answer, you need



sudo apt install libapache2-mod-php


as well. Somehow it has disappeared!






share|improve this answer





























    up vote
    0
    down vote













    It looks like this might be related to having 2 versions of PHP installed and enabled at the same time after the upgrade. Neither of the above worked for me, so I uninstalled Apache, PHP 7.1 and PHP 7.2, reinstalled Apache and PHP 7.2 and things are working now.






    share|improve this answer




















      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',
      convertImagesToLinks: true,
      noModals: false,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      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%2f1028422%2fphp-shows-up-as-plain-text-after-upgrade-to-18-04%23new-answer', 'question_page');

      );

      Post as a guest






























      3 Answers
      3






      active

      oldest

      votes








      3 Answers
      3






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      9
      down vote



      accepted










      This is what got my installation sorted



      sudo apt install php7.2 php7.2-common php7.2-cli
      sudo a2enmod php7.2





      share|improve this answer




















      • Thanks, to me enabling php7.2 module worked perfectly,- seems there was conflicts between multiple versions of php
        – Agnius Vasiliauskas
        Aug 28 at 16:13














      up vote
      9
      down vote



      accepted










      This is what got my installation sorted



      sudo apt install php7.2 php7.2-common php7.2-cli
      sudo a2enmod php7.2





      share|improve this answer




















      • Thanks, to me enabling php7.2 module worked perfectly,- seems there was conflicts between multiple versions of php
        – Agnius Vasiliauskas
        Aug 28 at 16:13












      up vote
      9
      down vote



      accepted







      up vote
      9
      down vote



      accepted






      This is what got my installation sorted



      sudo apt install php7.2 php7.2-common php7.2-cli
      sudo a2enmod php7.2





      share|improve this answer












      This is what got my installation sorted



      sudo apt install php7.2 php7.2-common php7.2-cli
      sudo a2enmod php7.2






      share|improve this answer












      share|improve this answer



      share|improve this answer










      answered Apr 27 at 0:16









      Phippsy

      1214




      1214











      • Thanks, to me enabling php7.2 module worked perfectly,- seems there was conflicts between multiple versions of php
        – Agnius Vasiliauskas
        Aug 28 at 16:13
















      • Thanks, to me enabling php7.2 module worked perfectly,- seems there was conflicts between multiple versions of php
        – Agnius Vasiliauskas
        Aug 28 at 16:13















      Thanks, to me enabling php7.2 module worked perfectly,- seems there was conflicts between multiple versions of php
      – Agnius Vasiliauskas
      Aug 28 at 16:13




      Thanks, to me enabling php7.2 module worked perfectly,- seems there was conflicts between multiple versions of php
      – Agnius Vasiliauskas
      Aug 28 at 16:13












      up vote
      2
      down vote













      Actually, in addition to the commands in this answer, you need



      sudo apt install libapache2-mod-php


      as well. Somehow it has disappeared!






      share|improve this answer


























        up vote
        2
        down vote













        Actually, in addition to the commands in this answer, you need



        sudo apt install libapache2-mod-php


        as well. Somehow it has disappeared!






        share|improve this answer
























          up vote
          2
          down vote










          up vote
          2
          down vote









          Actually, in addition to the commands in this answer, you need



          sudo apt install libapache2-mod-php


          as well. Somehow it has disappeared!






          share|improve this answer














          Actually, in addition to the commands in this answer, you need



          sudo apt install libapache2-mod-php


          as well. Somehow it has disappeared!







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited May 10 at 11:31









          Zanna

          48k13119227




          48k13119227










          answered May 9 at 20:30









          Jarek

          213




          213




















              up vote
              0
              down vote













              It looks like this might be related to having 2 versions of PHP installed and enabled at the same time after the upgrade. Neither of the above worked for me, so I uninstalled Apache, PHP 7.1 and PHP 7.2, reinstalled Apache and PHP 7.2 and things are working now.






              share|improve this answer
























                up vote
                0
                down vote













                It looks like this might be related to having 2 versions of PHP installed and enabled at the same time after the upgrade. Neither of the above worked for me, so I uninstalled Apache, PHP 7.1 and PHP 7.2, reinstalled Apache and PHP 7.2 and things are working now.






                share|improve this answer






















                  up vote
                  0
                  down vote










                  up vote
                  0
                  down vote









                  It looks like this might be related to having 2 versions of PHP installed and enabled at the same time after the upgrade. Neither of the above worked for me, so I uninstalled Apache, PHP 7.1 and PHP 7.2, reinstalled Apache and PHP 7.2 and things are working now.






                  share|improve this answer












                  It looks like this might be related to having 2 versions of PHP installed and enabled at the same time after the upgrade. Neither of the above worked for me, so I uninstalled Apache, PHP 7.1 and PHP 7.2, reinstalled Apache and PHP 7.2 and things are working now.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered May 27 at 17:09









                  Jonathan Bossenger

                  1




                  1



























                       

                      draft saved


                      draft discarded















































                       


                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1028422%2fphp-shows-up-as-plain-text-after-upgrade-to-18-04%23new-answer', 'question_page');

                      );

                      Post as a guest













































































                      Popular posts from this blog

                      pylint3 and pip3 broken

                      Missing snmpget and snmpwalk

                      How to enroll fingerprints to Ubuntu 17.10 with VFS491