PHP shows up as plain text after upgrade to 18.04
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO9GURib1T8z7lCwjOGLQaGtrueEthgQ8LO42ZX8cOfTqDK4jvDDpKkLFwf2J49kYCMNW7d4ABih_XCb_2UXdq5fPJDkoyg7-8g_YfRUot-XnaXkNYycsNp7lA5_TW9td0FFpLQ2APzKcZ/s1600/1.jpg)
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYQ0N5W1qAOxLP7t7iOM6O6AzbZnkXUy16s7P_CWfOb5UbTQY_aDsc727chyphenhyphen5W4IppVNernMMQeaUFTB_rFzAd95_CDt-tnwN-nBx6JyUp2duGjPaL5-VgNO41AVsA_vu30EJcipdDG409/s400/Clash+Royale+CLAN+TAG%2523URR8PPP.png)
up vote
4
down vote
favorite
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 "-" "-"
apache2 php 18.04
 |Â
show 3 more comments
up vote
4
down vote
favorite
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 "-" "-"
apache2 php 18.04
Probably you should install and enable the right Apache's php modulelibapache2-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
 |Â
show 3 more comments
up vote
4
down vote
favorite
up vote
4
down vote
favorite
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 "-" "-"
apache2 php 18.04
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 "-" "-"
apache2 php 18.04
edited Apr 27 at 8:54
![](https://i.stack.imgur.com/8CW8e.png?s=32&g=1)
![](https://i.stack.imgur.com/8CW8e.png?s=32&g=1)
Zanna
48k13119227
48k13119227
asked Apr 26 at 14:10
Benedikt Wutzi
235
235
Probably you should install and enable the right Apache's php modulelibapache2-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
 |Â
show 3 more comments
Probably you should install and enable the right Apache's php modulelibapache2-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
 |Â
show 3 more comments
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
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
add a comment |Â
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!
add a comment |Â
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.
add a comment |Â
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
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
add a comment |Â
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
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
add a comment |Â
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
This is what got my installation sorted
sudo apt install php7.2 php7.2-common php7.2-cli
sudo a2enmod php7.2
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
add a comment |Â
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
add a comment |Â
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!
add a comment |Â
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!
add a comment |Â
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!
Actually, in addition to the commands in this answer, you need
sudo apt install libapache2-mod-php
as well. Somehow it has disappeared!
edited May 10 at 11:31
![](https://i.stack.imgur.com/8CW8e.png?s=32&g=1)
![](https://i.stack.imgur.com/8CW8e.png?s=32&g=1)
Zanna
48k13119227
48k13119227
answered May 9 at 20:30
![](https://i.stack.imgur.com/T46ul.jpg?s=32&g=1)
![](https://i.stack.imgur.com/T46ul.jpg?s=32&g=1)
Jarek
213
213
add a comment |Â
add a comment |Â
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.
add a comment |Â
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.
add a comment |Â
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.
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.
answered May 27 at 17:09
![](https://lh6.googleusercontent.com/-r0J1PMxaz9Q/AAAAAAAAAAI/AAAAAAAAAA0/wrkRdKVrB2k/photo.jpg?sz=32)
![](https://lh6.googleusercontent.com/-r0J1PMxaz9Q/AAAAAAAAAAI/AAAAAAAAAA0/wrkRdKVrB2k/photo.jpg?sz=32)
Jonathan Bossenger
1
1
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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