I’m currently testing a VPS configuration.
I installed Ubuntu 12.04 (32bits) and zPanel. Now I’m trying to run a simple web app but I’m getting this error in the log:
[error] Can't use an undefined value as a symbol reference at /var/zpanel/hostdata/zadmin/public_html/.../webtest/webtest.cgi line 118.
[error] Premature end of script headers: webtest.cgi
I’m no Perl expert, but it seems that something went wrong in the .cgi script at line 118. Any Idea of what’s going on here?
I’ve tried with a simple script that display the environment variables::
print "Content-type: text/plain\
\
";
foreach $var (sort(keys(%ENV))) {
$val = $ENV{$var};
$val =~ s|\
|\\\
|g;
$val =~ s|"|\\\"|g;
print "${var}=\"${val}\"\
";
}And it worked fine. I’ve checked the permissions of my web app’s files and the apache config, and everything seems OK. Still, all I got an error 500 whil trying to launch it…
Did anyone see this behavior before?
If you get an “Internal Server Error” or any error, you need to check the web server log for specifics. A common source of problems is incorrect permissions.
Is yourapp’s config.cfg writeable, most of the time i forget that myself.
Try setting the permission to 777 as in the picture and if that works try decrementing the permissions.
Also check if the owner of the Apache process is part of the group who has the write permission. The owner of the Apache process is most of the time ‘www-data’. If you have uploaded the files under your own account then probably you are the owner and only you have permission there and ofcourse the root user.
To easily check this you can issue the ‘ps -A’ command in a shell and search for apache-process.
The app is called ‘webtest’ so I tried the ./webtest when logged as root via ssh and in the app directory. It crashed and I got this message:
Segmentation Fault
I also tried ./webtest.cgi and got:
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_CTYPE = "UTF-8",
LANG = "en_GB.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Use of uninitialized value $ENV{"REQUEST_METHOD"} in string eq at ./webtest.cgi line 110.
Can't use an undefined value as a symbol reference at ./webtest.cgi line 118.
Can the locale setting issue be a problem?
At last, I built a simple “Hello World!” console app for Linux adn upload it and set the permissions. I ran it as root and get the following message:
[code]root@[…]/cgi-bin/test/testconsole# ./testconsole
Runtime Error
Please report what caused this error along with the information below.
Common/Loaders/LoaderLinux.cpp: 106
Failure Condition: 1 == itemsRead
I solved the locale settings issue and still the same result:
root@[...]/cgi-bin/webtest# ./webtest.cgi
Use of uninitialized value $ENV{"REQUEST_METHOD"} in string eq at ./webtest.cgi line 110.
Can't use an undefined value as a symbol reference at ./webtest.cgi line 118.
Well, actually it was Filezilla’s settings that messed up the whole thing. It was set to transfer file in ASCII mode only… which can’t be good for application files. My test web app is now up and running !!!
Use of uninitialized value $ENV{“REQUEST_METHOD”} in string eq at ./leti.cgi line 110.
Use of uninitialized value $length in subtraction (-) at ./leti.cgi line 131.
Use of uninitialized value $length in numeric eq (==) at ./leti.cgi line 130.
Upload using binary mode.
Compiled with 2015 R3 FC1 64bits
Runing under Centos 7.0 64Bits
Use of uninitialized value $ENV{“REQUEST_METHOD”} in string eq at ./leti.cgi line 110.
Use of uninitialized value $length in subtraction (-) at ./leti.cgi line 131.
Use of uninitialized value $length in numeric eq (==) at ./leti.cgi line 130.
Upload using binary mode.
Compiled with 2015 R3 FC1 64bits
Runing under Centos 7.0 64Bits
Any idea?
Regards[/quote]
That would indicate that your web server is not sending a complete cgi request.
I use WinSCP and i launch my uploads using SSH access.
Even if i put binary method, it seems that some files are corrupted during upload.
When a problem appears, i launch the upload file by file or folder by folder and the project works again.
Thanks for your help and sorry sorry for the inconvenience