I am executing matlab script ( converted into .sh file using mcc ) using exec command from php . exec("./ru​n_searchIM​age.sh <Matlab Path> > output file 2>&1 & ") .

7 visualizaciones (últimos 30 días)
Running this command from php is giving error Error Using imshow IMSHOW unable to display image.
But if I run ./run_searchImage.sh -path from the command line it is running fine.
Code snipet where it is giving error .
f1 = figure('Visible','off'); imshow(im1_);hold on; f=figure('Visible','off'); imshow(im2_); hold on;

Respuesta aceptada

Anirudh Goyal
Anirudh Goyal el 1 de Jul. de 2013
Yes I mean to run it from php and probably there is no display environment variable set , so cld u plz elaborate your answer a little bit more
I have asked the same thing in apache mailing list and they told to run matlab in headless mode , and I tried running it but cld get the results , so cld u plz tell how to do it

Más respuestas (1)

Walter Roberson
Walter Roberson el 1 de Jul. de 2013
When you run it from PHP there is probably no DISPLAY environment variable set.
When you say "run it from PHP" do you mean by a web server? If so then the web server session is not connected to any display, and so is not able to display graphics. The most it can do in such a case is to compute an image of a graphic and send the image to the web session using an appropriate MIME type.
  5 comentarios
Anirudh Goyal
Anirudh Goyal el 1 de Jul. de 2013
I want this to be an web app only But Now for demonstration purposes I have shown this using Remote Desktop. I am showing an Image using imshow then I am plotting some boundaries on it using plot and then I am saving this using saveas .

Iniciar sesión para comentar.

Categorías

Más información sobre File Operations en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by