particular php pages show raw code (hosts.php, graph_view.php)

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
nocactusjokesleft
Posts: 3
Joined: Mon Sep 02, 2024 9:44 am

particular php pages show raw code (hosts.php, graph_view.php)

Post by nocactusjokesleft »

so I casually upgraded linux to 22 LTS and after which no php was working.
turns out i have php 8.1 installed but apache2 mods linked to a non-existant 7.4 folder.
I manually made the symlinks to point to 8.1 php

now php is working, yeah!
phpinfo pages works, yeah!
and I can log into cacti as before, yeah!
I can see most every page except for hosts.php and graph_view.php which show the raw php code.

why would these two pages only be affected? but every other php page functions correctly?
am I missing some php extensions maybe?
User avatar
macan
Cacti Guru User
Posts: 1137
Joined: Tue Mar 18, 2008 2:30 am
Location: Czech

Re: particular php pages show raw code (hosts.php, graph_view.php)

Post by macan »

you can find packages with apt utility:
apt list --installed | grep -i php

Update all to php 8.x, restart webserver
Let the Cacti grow!
nocactusjokesleft
Posts: 3
Joined: Mon Sep 02, 2024 9:44 am

Re: particular php pages show raw code (hosts.php, graph_view.php)

Post by nocactusjokesleft »

thanks for helping, the output of that command is unclear to me:

Code: Select all

libapache2-mod-php8.1/jammy-updates,jammy-security,now 8.1.2-1ubuntu2.18 amd64 [installed,automatic]
libapache2-mod-php/jammy,jammy,now 2:8.1+92ubuntu1 all [installed]
php-cli/jammy,jammy,now 2:8.1+92ubuntu1 all [installed,automatic]
php-common/jammy,jammy,now 2:92ubuntu1 all [installed]
php-curl/jammy,jammy,now 2:8.1+92ubuntu1 all [installed]
php-gd/jammy,jammy,now 2:8.1+92ubuntu1 all [installed]
php-gmp/jammy,jammy,now 2:8.1+92ubuntu1 all [installed]
php-imap/jammy,jammy,now 2:8.1+92ubuntu1 all [installed]
php-intl/jammy,jammy,now 2:8.1+92ubuntu1 all [installed]
php-json/jammy,jammy,now 2:8.1+92ubuntu1 all [installed]
php-ldap/jammy,jammy,now 2:8.1+92ubuntu1 all [installed]
php-mbstring/jammy,jammy,now 2:8.1+92ubuntu1 all [installed]
php-memcache/jammy,now 8.0+4.0.5.2+3.0.9~20170802.e702b5f9+-7 amd64 [installed]
php-mysql/jammy,jammy,now 2:8.1+92ubuntu1 all [installed]
php-net-socket/jammy,jammy,now 1.2.2-2 all [installed]
php-pear/jammy,jammy,now 1:1.10.12+submodules+notgz+20210212-1ubuntu3 all [installed]
php-pspell/jammy,jammy,now 2:8.1+92ubuntu1 all [installed]
php-snmp/jammy,jammy,now 2:8.1+92ubuntu1 all [installed]
php-tidy/jammy,jammy,now 2:8.1+92ubuntu1 all [installed]
php-xml/jammy,jammy,now 2:8.1+92ubuntu1 all [installed]
php-xmlrpc/jammy,now 3:1.0.0~rc3-2 amd64 [installed]
php8.1-cli/jammy-updates,jammy-security,now 8.1.2-1ubuntu2.18 amd64 [installed,automatic]
php8.1-common/jammy-updates,jammy-security,now 8.1.2-1ubuntu2.18 amd64 [installed,automatic]
php8.1-curl/jammy-updates,jammy-security,now 8.1.2-1ubuntu2.18 amd64 [installed,automatic]
php8.1-gd/jammy-updates,jammy-security,now 8.1.2-1ubuntu2.18 amd64 [installed,automatic]
php8.1-gmp/jammy-updates,jammy-security,now 8.1.2-1ubuntu2.18 amd64 [installed,automatic]
php8.1-imap/jammy-updates,jammy-security,now 8.1.2-1ubuntu2.18 amd64 [installed,automatic]
php8.1-intl/jammy-updates,jammy-security,now 8.1.2-1ubuntu2.18 amd64 [installed,automatic]
php8.1-ldap/jammy-updates,jammy-security,now 8.1.2-1ubuntu2.18 amd64 [installed,automatic]
php8.1-mbstring/jammy-updates,jammy-security,now 8.1.2-1ubuntu2.18 amd64 [installed,automatic]
php8.1-memcache/jammy,now 8.0+4.0.5.2+3.0.9~20170802.e702b5f9+-7 amd64 [installed,automatic]
php8.1-mysql/jammy-updates,jammy-security,now 8.1.2-1ubuntu2.18 amd64 [installed,automatic]
php8.1-opcache/jammy-updates,jammy-security,now 8.1.2-1ubuntu2.18 amd64 [installed,automatic]
php8.1-pspell/jammy-updates,jammy-security,now 8.1.2-1ubuntu2.18 amd64 [installed,automatic]
php8.1-readline/jammy-updates,jammy-security,now 8.1.2-1ubuntu2.18 amd64 [installed,automatic]
php8.1-snmp/jammy-updates,jammy-security,now 8.1.2-1ubuntu2.18 amd64 [installed,automatic]
php8.1-tidy/jammy-updates,jammy-security,now 8.1.2-1ubuntu2.18 amd64 [installed,automatic]
php8.1-xml/jammy-updates,jammy-security,now 8.1.2-1ubuntu2.18 amd64 [installed,automatic]
php8.1-xmlrpc/jammy,now 3:1.0.0~rc3-2 amd64 [installed,automatic]
php8.1/jammy-updates,jammy-updates,jammy-security,jammy-security,now 8.1.2-1ubuntu2.18 all [installed,automatic]
php/jammy,jammy,now 2:8.1+92ubuntu1 all [installed]
almost everything seems like it says 8.1 but not completely all, apt --upgradable says 0 packages to update.
does this look normal, why are things listed as php and php8.1
User avatar
macan
Cacti Guru User
Posts: 1137
Joined: Tue Mar 18, 2008 2:30 am
Location: Czech

Re: particular php pages show raw code (hosts.php, graph_view.php)

Post by macan »

weird (for me, but I'm not ubuntu specialist). I have installed only phpX.Y versions on my server.
Let the Cacti grow!
nocactusjokesleft
Posts: 3
Joined: Mon Sep 02, 2024 9:44 am

Re: particular php pages show raw code (hosts.php, graph_view.php)

Post by nocactusjokesleft »

embarrassingly it was simply a browser cache issue, i just needed to do shift+f5.
thanks for taking the time to help me.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest