Problem Description: Ave is a GNU open-source scientific computing software compatible with matlab syntax. I wrote a piece of Ave script, specifying octave as the interpreter at the beginning #! Usrbinoctave can directly execute this script under the command line to generate the image I want. Use. octavedemo... problem description:
Ave is a GNU open-source scientific computing software compatible with matlab syntax. I wrote a piece of Ave script, specifying octave as the interpreter at the beginning#!/usr/bin/octave
Execute this script directly under the command line to generate the image I want. Ready for use./octavedemo.m arg1 arg2...
But now I want to use php system functions such as shell_exec () to execute this command, but it cannot take effect.
To test whether it is a permission issue, I tried to use shell_exec () to execute simple ls-l and other commands, which can be successful:
$test = shell_exec("ls -l");echo $test;
Js can receive and print the results on the console, so it should not be a problem with the system function execution permission.
So I would like to ask what kind of situation may lead?
Is it too long to generate images slowly? I have set max_excution_time to 600 in php. ini. it should be enough;
Or is the image too big to generate, unlike simple text?
Thanks for your experience!
Update (resolved ):
Originally, I created a new demonstrate directory under the default html directory of apache, and put php and other files in this directory. then I just entered this directory, the chmod 777 operation is performed on all files in it.
Now I tried to grant the 777 permission to the demonstrate directory, and the problem was solved. It should be because you cannot generate files in this directory because you do not grant the read and write permissions to this directory.
Facts have proved that it is still necessary to think clearly about the logic of each step to avoid wasting time. thank you!
Reply content: Problem description:
Ave is a GNU open-source scientific computing software compatible with matlab syntax. I wrote a piece of Ave script, specifying octave as the interpreter at the beginning#!/usr/bin/octave
Execute this script directly under the command line to generate the image I want. Ready for use./octavedemo.m arg1 arg2...
But now I want to use php system functions such as shell_exec () to execute this command, but it cannot take effect.
To test whether it is a permission issue, I tried to use shell_exec () to execute simple ls-l and other commands, which can be successful:
$test = shell_exec("ls -l");echo $test;
Js can receive and print the results on the console, so it should not be a problem with the system function execution permission.
So I would like to ask what kind of situation may lead?
Is it too long to generate images slowly? I have set max_excution_time to 600 in php. ini. it should be enough;
Or is the image too big to generate, unlike simple text?
Thanks for your experience!
Update (resolved ):
Originally, I created a new demonstrate directory under the default html directory of apache, and put php and other files in this directory. then I just entered this directory, the chmod 777 operation is performed on all files in it.
Now I tried to grant the 777 permission to the demonstrate directory, and the problem was solved. It should be because you cannot generate files in this directory because you do not grant the read and write permissions to this directory.
Facts have proved that it is still necessary to think clearly about the logic of each step to avoid wasting time. thank you!
Php shell_exec adopts the web user permission ~ Are you sure you have the execution permission for your script?