PHP exec octave sh in Windows

♀尐吖头ヾ 提交于 2019-12-14 04:09:59

问题


I'm trying to execute the following octave sh file in php using the exec command running in Windows 2008. This command works in Unix but I don't know why it doesn't work in Windows. Seems that the working directory of Octave is C:\Windows\system32\config\systemprofile Please advice.

exec("octave ./d_test.sh");

回答1:


Solved :) I edited the octaverc in 'c:\software\Octave\Octave3.6.2_gcc4.6.2\share\octave\site\m\startup' with

addpath("C:\\Program Files (x86)\\Apache Software Foundation\\Apache2.2\\htdocs\\test");
addpath("C:\\Windows\\system32\\config\\systemprofile")
##cd(getenv('USERPROFILE'))



回答2:


You're better off just figuring out where octave is and calling it using that absolute path, ex. exec("C:\Octave-3.6.1\bin\octave.exe ./d_test.sh");.



来源:https://stackoverflow.com/questions/13586263/php-exec-octave-sh-in-windows

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!