Jump to content

launch matlab from php with an apache server


anna82

Recommended Posts

Hi,

I have to develop a website that enables the execution of a matlab program. I would like to know whether or not the option I am trying to implement is feasible and/or if this depends on the type of license that I have.

 

In particular, I would like to be able to lauch a script from php in this way:

 

system('./script.sh')

 

where the script contains the following lines:

 

whoami

matlab -nodisplay -nosplash -r "main;quit;"

 

Since the installed type of license is "stand-alone named user installation", I can only run matlab from the enabled user. For thid reason, I have changed the apache user from the default www-data to the matlab user.

 

The problem is that, if I go to the webpage of my application (the php file), I have the license manager error even if the user displayed by the "whoami" command is the correct one.

 

Is the option I am trying to develop feasible? Does any of you have ever done something similar?

 

Thank you

 

Anna

 

Hi all,

 

Thank you for the suggestions...unfortunately it still doesn't  work.

I have tried both options but it still gives me the license error message.

 

Moreover, the idea to launch the .sh file with the command:

sudo -u matlabuser ./script.sh

 

after having added to the sudoers file :

matlabuser ALL=NOPASSWD: pathto script.sh

 

does not work even when I launch it in the terminal from root: I still get the license error message.

 

Thank you very much for the help

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.