Trying to run matlab via PHP exec, but not executing....

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • atlkhan
    New Member
    • Apr 2007
    • 39

    Trying to run matlab via PHP exec, but not executing....

    Hi I am trying to run a matlab script.(This script you can run from the command line by command 'matlab -r scriptname').

    But when I use this command inside a system or exec I don't get any output, nor does the matlab opens and executes as it does in case of command line..

    I am doing like
    [code=php]
    <?php
    echo exec(' matlab -r scriptname');
    ?>
    [/code]

    [Please use CODE tags when posting source code. Thanks! --pbmods]
  • pbmods
    Recognized Expert Expert
    • Apr 2007
    • 5821

    #2
    Changed thread title to better describe the problem.

    Are you getting any errors? Make sure you turn on debugging messages.

    Comment

    • atlkhan
      New Member
      • Apr 2007
      • 39

      #3
      Originally posted by pbmods
      Changed thread title to better describe the problem.

      Are you getting any errors? Make sure you turn on debugging messages.

      No, I am not getting any errors. Sometimes the browsers start processing and takes a lot of time and after that there is an empty browser window.

      Comment

      • Peter R
        New Member
        • Jun 2011
        • 1

        #4
        are you running php script in standalone environment or under apache? If its under apache on windows you need to change apache to run as a specific user instead of a local service. on windows run services.msc then right click on Apache service under the Log On As set it as a user with proper privileges (I am running it as admin on dev server but this might not be good idea for production server). under linux you might try sudo or actually change the service user. If you are running php scripts w/o apache I would guess there is some way to change how the registered scripts are run under the OS in a similar fashion.

        Comment

        Working...