CallingMATLAB from PHP http://mem.bio.pitt.edu/content/calling-matlab-php Submittedby keithc on Mon, 08/23/2010 - 15:26 Iwanted to run a MATLAB command from PHP that would generate afigure, save it to an image file, and display that image in thewebpage. Here is the process I used: 1. Mostnew MATLAB licenses only allow a single specified user to startthe application at any time. If you want to call MATLAB from thecommand-line from an interface like PHP (that for security reasonsis run as another system user), one way to get around thislicensing issue is to masquerade as the licensed user using sudo:
2. SincePHP won't have a TTY terminal associated with it, you'll have togive the system user that runs PHP/apache the NOPASSWD flag in thesudoers file. Start editing the sudoers file by running
Pleasenote that there are security issues in giving sudo privileges toyour apache/webserver user, especially with NOPASSWD. |
GMT+8, 2024-11-24 21:26 , Processed in 0.037957 second(s), 16 queries , Gzip On.
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.