help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Octave 3.8.0 and PHP


From: eykiriku
Subject: Octave 3.8.0 and PHP
Date: Wed, 29 Jan 2014 09:07:36 -0800 (PST)

Consider the following architecture: 
 - users upload data into a database
 - my web app accesses the database, gets the users data, processes it and
sends back the results to a webpage.

The smartest solution I came up to achieve this is by using PHP, mysql,
apache and Octave 3.8.0 on Ubuntu 12.04.

No user input is required and the script flow that I thought to use is:
 - PHP uses mysql to retrieve the users data
 - Octave is called from PHP to do all the processing
 - The results are sent to a webpage or saved into another file.

The problem occurs when calling Octave from PHP with the functions exec(),
passthru(), ...
All these functions let only to initialize Octave and I can say it because I
see the startup message on the webpage and then no octave script is
executed. Here below there is the code I am using:

The set up PHP, Apache works yet (the Apache user is www-data). The problem
occurs related to the following call:

$cmd = "octave3.8 -qf /.../path_to_file/myscript.m file.txt";
$ex = passthru($cmd, $output);
var_dump($ex);
var_dump($output)

inside the script myscript.m there is:

e = 5;               % too see if it will be printed onto the web page
disp(e);

The result is : *NULL int(1)*
There is no way to make it work for now, I also tried to use a shell script.
The popen instead results in the sentence "resource(4) of type (stream)". 

Few keynotes:

The same command from the terminal works fine (octave3.8 -qf
/../path_to_file/myscript.m file.txt)
I already tried to put the PHP process to be run by a sudoer




--
View this message in context: 
http://octave.1599824.n4.nabble.com/Octave-3-8-0-and-PHP-tp4661495.html
Sent from the Octave - General mailing list archive at Nabble.com.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]