FAQ.How to use Sybase in Web App?Answer:
Please use our MBS Xojo SQL Plugin to connect to a Sybase Database in your web application.Notes:
If you see db.Connect giving the error message "cs_ctx_alloc -> CS_MEM_ERROR", than some things are not setup right for Sybase.
The Apache process may not have all the SYBASE environment variables being set when the CGI was launched.

Adding these lines to /etc/httpd/conf/httpd.conf stopped the faux memory errors for us: