Is it possible to create a standalone CGI executable to deploy my application on the web using the MATLAB Compiler?

I want to deploy my application on the Web. I want to write all my code in MATLAB and compile it with the MATLAB Compiler.

 Réponse acceptée

Using MATLAB Compiler you can create a standalone executable which can be called by your web server using the Common Gateway Interface (CGI).
A CGI program or script outputs HTML by printing it to the screen (stdout). Input to a CGI program is through the environment variable "QUERY_STRING". By using the MATLAB functions GETENV and FPRINTF you can create a simple CGI program.
Before attempting the following, you should verify that you have configured your web server properly in order to run CGI programs, and that you are able to execute a CGI program that is independent of MATLAB. Consult your web server documentation for how to do this.
An example has been created which demonstrates how to do this. The files for this example are located in the file CGI_Standalone.zip. The download link is present at the bottom of this page. Perform the following steps to compile and run this example:
1. Compile the MATLAB file into a standalone application. This can be done with the following command in MATLAB:
mcc -m mycgimagic.m
2. Copy the HTML file to the web server and place it in a directory with the proper permissions. Consult your web server documentation for how to do this.
3. Copy the EXE and CTF files to the web server and place them in the "/cgi-bin" directory of your website. You will need to configure the web server to have the proper permissions to be able to execute the EXE-file. Consult your web server documentation for how to do this.
4. Install the MCR on the web server.
5. Execute the EXE-file for the first time from the web server system itself in order to force the CTF-archive extraction.
6. Load the HTML-file in a web browser from the remote computer and submit the form to execute the CGI program.
For more information on standalone applications, see the MATLAB Compiler documentation and C standalone application target example.

7 commentaires

Mohammad, can you contact Mathworks Tech support at support@mathworks.com?
Aman, please contact MathWorks Technical Support.
The link to download the example CGI_Standalone.zip seems to be missing. At least it's not visible from my browser.
"The files for this example are located in the file CGI_Standalone.zip. The download link is present at the bottom of this page."
Yes again another TMW solution where the attached files are missing
Neil, please contact MathWorks Technical Support.
(Answers dev) Attachment has been added.
CGI_Standalone.zip is a zip file of 2 KB

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur MATLAB Compiler dans Centre d'aide et File Exchange

Produits

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by