Why do I get malformed header errors when using a MATLAB Compiler-generated standalone application as a CGI application with Apache?
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I have created a standalone executable, mycgimagic.exe, with MATLAB Compiler which is being called by my web server as a CGI application. In the program I am using DISP to print out the formatted HTML.
When I use this application with Microsoft's Internet Information Services (IIS) web server it works fine. However when it is used with Apache Web Server 2.2, I receive an Internal Server Error and the following message is in the Apache log file
malformed header from script. Bad header= : mycgimagic.exe
Respuesta aceptada
MathWorks Support Team
el 27 de Jun. de 2009
This error is caused by the automatic formatting done by the DISP command. Apache seems to be more particular about the formatting of the content-type headers in the HTML file than IIS.
To work around this issue, replace every occurrence of the DISP command with PRINTF. For example the command
disp('Content-type: text/html');
should be replaced with
fprintf(1,'Content-type: text/html\n');
After making these changes, the same program should work for both web servers.
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Workspace Variables and MAT Files en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!