# End of script output before headers line 118

**URL:** <https://forum.xojo.com/t/end-of-script-output-before-headers-line-118/58645>\
**Category:** Web\
**Created:** [November 9, 2020, 9:36pm UTC](https://forum.xojo.com/t/end-of-script-output-before-headers-line-118/58645 "2020-11-09T21:36:49Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gary\_Vassalotti](https://forum.xojo.com/user_avatar/forum.xojo.com/gary_vassalotti/32/444_2.png) [@Gary\_Vassalotti](https://forum.xojo.com/u/Gary_Vassalotti)\
**Post date:** [November 9, 2020, 9:36pm UTC](https://forum.xojo.com/t/end-of-script-output-before-headers-line-118/58645/1 "2020-11-09T21:36:49Z")

</div>

I keep getting the following, very aggravating error… I have seen quite a few similiar posts on the forum but I still can’t get past it… I am running Xojo 2019r3.1 in this project, uploading to an linux web server running Apache. It does have libunwind installed; that was an earlier error message.

I have tried this on my server and a separate server provided by my net provider; I can see my error message on my server, of course, and have no idea what the error is on their server, but it gives a 500 error instead.

I do have other xojo cgi programs running on my server; it does run on my development machine.

Any suggestions would be greatly appreciated!

The /var/log/httpd/error\_message log is as follows:

End of script output before headers: wportman.cgi  
[Mon Nov 09 15:52:03.797922 2020] [cgi:error] [pid 29644] [client xxxxxxxxx] AH01215: Can’t use an undefined value as a symbol reference at /data/www/cgi-bin/wportman/wportman.cgi line 118.: /data/www/cgi-bin/wportman/wportman.c  
gi  
[Mon Nov 09 15:52:03.801818 2020] [cgi:error] [pid 29644] [clientxxxxxxxxxx] End of script output before headers: wportman.cgi

---

<div class="post-metadata">

**Author:** ![Tim\_Parnell](https://forum.xojo.com/user_avatar/forum.xojo.com/tim_parnell/32/161_2.png) [@Tim\_Parnell](https://forum.xojo.com/u/Tim_Parnell)\
**Post date:** [November 9, 2020, 9:49pm UTC](https://forum.xojo.com/t/end-of-script-output-before-headers-line-118/58645/2 "2020-11-09T21:49:59Z")

</div>

I’m not super familiar with CGI deployment, but I think I’ve seen it that 500 is common if your app is crashing. Have you got it running locally? Have you deployed standalone? Could I interest you in [Lifeboat](https://forum.xojo.com/t/in-development-need-feedback-app-to-deploy-xojo-web-to-digital-ocean-lightsail/58305)?

---

<div class="post-metadata">

**Author:** ![Gary\_Vassalotti](https://forum.xojo.com/user_avatar/forum.xojo.com/gary_vassalotti/32/444_2.png) [@Gary\_Vassalotti](https://forum.xojo.com/u/Gary_Vassalotti)\
**Post date:** [November 10, 2020, 1:44am UTC](https://forum.xojo.com/t/end-of-script-output-before-headers-line-118/58645/3 "2020-11-10T01:44:06Z")

</div>

It runs on my development machine, but not when deployed to the server.

---

<div class="post-metadata">

**Author:** ![Anthony\_G\_Cyphers](https://forum.xojo.com/user_avatar/forum.xojo.com/anthony_g_cyphers/32/16862_2.png) [@Anthony\_G\_Cyphers](https://forum.xojo.com/u/Anthony_G_Cyphers)\
**Post date:** [November 10, 2020, 1:47am UTC](https://forum.xojo.com/t/end-of-script-output-before-headers-line-118/58645/4 "2020-11-10T01:47:13Z")

</div>

When running on your local machine, it’s the same as running on a server as Standalone. When you deploy as CGI, a CGI script is created and uploaded with the app to control the application. Here’s a relevant thread that may help:

> [@"Can't use an undefined value as a symbol reference" in .cgi file](https://forum.xojo.com/t/cant-use-an-undefined-value-as-a-symbol-reference-in-cgi-file/16460/17):
>
> Hi all I’ve the same issue. 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

---

<div class="post-metadata">

**Author:** ![Gary\_Vassalotti](https://forum.xojo.com/user_avatar/forum.xojo.com/gary_vassalotti/32/444_2.png) [@Gary\_Vassalotti](https://forum.xojo.com/u/Gary_Vassalotti)\
**Post date:** [November 10, 2020, 4:53am UTC](https://forum.xojo.com/t/end-of-script-output-before-headers-line-118/58645/5 "2020-11-10T04:53:24Z")

</div>

Yes… I read through that post before postung my question. I do have other xojo programs running and have the config file set for auto port as auggested in that thread but it did not help.

---

<div class="post-metadata">

**Author:** ![Greg\_O\_Lone](https://forum.xojo.com/user_avatar/forum.xojo.com/greg_o_lone/32/49_2.png) [@Greg\_O\_Lone](https://forum.xojo.com/u/Greg_O_Lone)\
**Post date:** [November 10, 2020, 12:08pm UTC](https://forum.xojo.com/t/end-of-script-output-before-headers-line-118/58645/6 "2020-11-10T12:08:30Z")

</div>

This error is caused by the Xojo app either crashing or taking too long to respond to the CGI script.

Remember, with CGI the request/response goes like this:

Browser \> Web Server \> cgi script \> Xojo App \> cgi script \> web server \> Browser.

If the app fails to respond or goes away, the socket that’s created in the cgi script will time out, giving you the error you posted.

---

<div class="post-metadata">

**Author:** ![system](https://forum.xojo.com/uploads/default/original/1X/455b4dcc0e61630e9f81940004ddffa49c432a46.png) [@system](https://forum.xojo.com/u/system)\
**Post date:** [May 12, 2021, 12:08am UTC](https://forum.xojo.com/t/end-of-script-output-before-headers-line-118/58645/7 "2021-05-12T00:08:35Z")

</div>

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