Ubuntu 16.04 gitweb.cgi gives error on page: "Software error: Can't use 'defined(@array)' (Maybe you should just omit the defined()?) at gitweb.cgi line 1193."

When I try to access gitweb.cgi from a web browser I get the following error on page:

Software error: Can't use 'defined(@array)' (Maybe you should just omit the defined()?) at gitweb.cgi line 1193.

My Apache2 error log shows:

[Thu Dec 08 09:58:46.557787 2016] [cgi:error] [pid 3872] [client 174.67.159.4:3533] AH01215: [Thu DecĀ  8 09:58:46 2016] gitweb.cgi: Can't use 'defined(@array)' (Maybe you should just omit the defined()?) at gitweb.cgi line 1193.: /home/vcadmin/domains/pjc.domain.net/public_html/git/gitweb.cgi

I have included my gitweb.cgi (with domain renamed for security). It appears that all the paths are pointing to the correct locations. I have tried removing /usr/share/gitweb/gitweb.cgi (from a forum reply) but it did not have any effect. I have Git working with HTTPS and Smart HTTP, I have not been able to get gitweb.cgi to work since first installing Git on Virtualmin.

Status: 
Active

Comments

Try editing /home/vcadmin/domains/pjc.domain.net/public_html/git/gitweb.cgi and changing defined(@something) to just @something

Got this error when trying to setup git: Can't use 'defined(@array)' (Maybe you should just omit the defined()?) at gitweb.cgi line 1193.

Removed defined from these lines from the gitweb.cgi file: line 1193 same for line 1246 same for line 1324 same for line 1376

Then got this error: Can't locate object method "startform" via package "CGI" at gitweb.cgi line 409.

Error is a typo. To fix the typo: replace startform with start_form on line 409

On Ubuntu 16.04 - seems like an update to git module is needed?

Which version of the Virtualmin Git plugin are you running there?