Error "Missing Content-Type Header" for PHP Options

SYSTEM INFORMATION
OS type and version Redhat Enterprise Linux 8.8
Webmin version 2.013
Usermin version 2.001
Virtualmin version 7.7
Theme version 20.13
Package updates 2 package updates are available

I think of myself as being in the middle of the pack, not a beginner and certainly not the biggest user – we have been using Virtualmin for 5-7 years and today have about 15 RedHat servers (RHEL 7 and 8) running 50+ websites all in a VMware/vSphere environment.

today I came across something I cannot figure out !! I don’t know if I have messed up, or found a bug. And I am not sure how to diagnose it. There are two issues I have identified so far as I upgrade to VM 7.7-3 and webmin 2.013 (plus added php 8.1 and 8.2 from REMI repos using cmd line YUM commands)

  1. while the cmd line command

virtualmin check-config

works fine and runs to completion, the GUI button, Virtualmin – System Settings – Re-Check Configuration … never finishes when clicked. Nothing of interest shows up in /var/webmin/miniserv.error

  1. when choosing any domain, then going to Server Configuration and clicking PHP Options, I do not get what I expect but instead

ERROR β€” MISSING CONTENT-TYPE HEADER

in red on the right hand half of the screen.

I tried to reduce this to a simple test CGI file such as:

#!/usr/bin/perl
# rename_form.cgi
# Display server rename form
require './virtual-server-lib.pl';
&ui_print_header("Verne -- entering rename_form.cgi");

(not sure in the forum how to better format the above code)

I wanted to reduce the code to determine what function or subroutine might be having an issue … and with just the above five lines put into edit_phpmode.cgi in /usr/libexec/webmin/virtual-server/ the PHP Options button still fails and gives the above error β€” but I can take the same five lines and put them into rename_form.cgi and when executing that by clicking on Change Domain Name, it works – that is, I get the line

Verne – entering rename_form.cgi

displayed on my screen. Whenever I get the error, /var/webmin/miniserv.error contains

[18/Oct/2023:16:04:22 -0400] [129.71.34.60] /virtual-server/edit_phpmode.cgi : Missing Content-Type Header
[18/Oct/2023:16:04:23 -0400] [129.71.34.60] /service-worker.js : File not found

I would love to know if its possible to turn on debug someplace to get more details. Again I am at a loss as to what I could have done in upgrading Virtualmin from 6.16 to 7.7-3 and webmin (from the proper software.virtualmin.com repo :smile:) from 1.973 to 2.013.

I have done things like a global GREP on edit_phpmode to see if miniserv.pl or other code would treat edit_phpmode.cgi differently than rename_form.cgi and could not find anything useful.

I might give up and back up the few domains (virtual servers) on this Linux box, and then totally erase/remove webmin and wbm-virtual-server, and re-install and then restore my saved virtual servers.

advice is welcome !!

p.s. not sure if my Re-Check Configuration issue should be in a different topic

I have cloned my production server over to a test copy … as over the years I have tinkered by manually editing various config files, perhaps causing my own issues (most of my edits have been to successfully get Virtualmin to work in our SELinux environment).

on my test server I just updated webmin to 2.101 and virtualmin to 7.8.2 – and have the same issues.

I see I failed to post in regards to item 1 β€” when clicking the Re-Check Configuration button, on the right panel (Framed Theme) I do get the header

Checking Configuration

displayed but nothing after that – as many will know, typically, and on my other servers, text starts scrolling immediately when clicking the button :smile:

And my five line CGI test file, when substituted as above, still has the same results.

Does miniserv do any checking, or have a cache that I need to clear?

Still stumped !!

I’m sorry, I should have thought thru my posts before actually posting !!

My goal was, after installing php 8.1 and 8.2, to go into the PHP Options panel, as I have done many times in the last few months on other servers, and adjust a domain to move from php 7.4 to 8.xx

Naturally its easy to make this adjustment with Virtualmin (one of the many many functions of Virtualmin making it such a good package), while much more difficult to do it by hand by using VIM to edit httpd.conf and the xxxxxxx.conf file in /etc/opt/remi/php82/php-fpm.d/as well as manually update the xxxxxxxxxx domain config file in /etc/webmin/virtual-server/domains/

maybe I found my own solution, but not sure of the root cause …

just noticed that most of the CGI files in /usr/libexec/webmin/virtual-server/ are set to -rwxr-xr-x – but not edit_phpmode.cgi (along with save_phpmode.cgi and download_backup.cgi) – it was missing the executable X bit !!

By adding X with chmod 755 edit_phpmode.cgi (yes there are other ways to do it) now has PHP Options working fine, problem solved !!

Any thoughts on what I missed in the logs that would have told me this?

And in checking one of my other RHEL8 servers (with webmin 2.101 but an older 7.7-3 Virtualmin), edit_phpmode.cgi is working fine WITHOUT the X bit β€” go figure.

Now if I only could see why Re-Check Configuration is not working :smile:

1 Like

I have made a new forum entry for my Re-Check Configuration issue at https://forum.virtualmin.com/t/re-check-configuration-never-finishes

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.