Premature end of script headers

Uploaded the build from a Web (CGI) project and I am receiving the following in the httpd logs:

[Thu Nov 05 07:43:17 2015] [error] [client] Can't use an undefined value as a symbol reference at /var/www/cgi-bin/myapp/myapp.cgi line 118. [Thu Nov 05 07:43:17 2015] [error] [client] Premature end of script headers: myapp.cgi

Line 118:

print $sock $body;

Linux host
CentOS release 6.7 (Final)
App has been set to compile for 32bit linux (auto select port)
32bit dependencies have been installed and verified
app_dir and subdirs = 755
config.cfg = 666

I had the app working last week after tinkering and reading forum posts. Deployed new version and I am back to it not working. I can’t find that one page or forum post that provided the answer to the issue and I can’t remember what tinkering got it to work last time, this time i am logging everything that is done.

Deployment Method
zip files in build directory
sftp to server
cp to /var/www/cgi-bin
chmod 755 for files and dirs
chmod 666 for config.cfg

Created a plain cgitest.cgi app (with xojo), deployed it and it worked. Knowing that a basic app works and the app in question used to work along with knowing the change that was made was only to the renaming of a field label on a container, is there a way to know exactly what this error is stating is wrong or what needs to be done? I reverted back to the previous version and it doesn’t work either now. I am leaning towards privs/permissions or something with the ftp tool being used? (filezilla, cyberduck, command line- tried all three with same results.)

This was supposed to be a trivial change and now the app is “dead”. Any ideas?

Did you zip the entire directory or select the files in the directory to zip? There’s also a .htaccess file that is invisible that’s required.

One thing that bit me for a while for one client was that using FTP didn’t set the right user. I had to upload through their CPanel software. Upload the zip (of the entire app directory), unzip it, set the permissions on the newly unzipped directory (and its contents).

For situations like this, screen capture software (I prefer Screenflow) can be most helpful.

I am pretty sure I zipped the entire directory and moved it up out of the assorted times going through this. I will do it again to double check it was done to spec.

Yes, entire directory zipped and uploaded, unzipped and still the same. .htaccess file is out there.

Are you sure the old process is actually dead? Simply deleting it may not do it.

Try building it with a new application ID. Upload and use the new URL for it.

Will try doing that now. Looks like you are the only one out there willing to tinker with this and help me out. It’s much appreciated.

I have been using xojo (side work and personal tools) since the realbasic days for mac and linux apps. I am wanting to introduce xojo to my developers “java” regarding RAD tools. Without the ability to get things running in a web environment removes it from my list of candidates to use at work. It looks like it will have to stay as an “after 5/hobby”.

I will let you know of my results.

Bob - You are the man! Saved as another name. Changed the appid, compiled, uploaded and bingo! Thanks for your help!

Take a look at this blog post form 1701 Software Add that bit of code to your cgi web app to not have this happen again.

Checking it out, thanks! I Logged all my steps to get things up and running again. Not to mention had my SA create a snapshot of the VM.