'witm' - Web Interface To Mathematica.



I've made some quite significant changes to the php code I mentioned a few days back.

It can now run most Mathematica commands, as well as display 2D and 3D graphics. I suspect you can produce sound too, but I have not tried.

There is a *non-functioning* demo at

http://www.althorne.org/witm/witm.php

A 3D graph was created over the web and is placed at

http://www.althorne.org/witm/graph.pdf

In order to run this, you will need a

1) UNIX or Linux computer.
2) Web server (almost certainly apache)
3) Web server configured for PHP.
4) Copy of Mathematica on the web server.

Feel free to download the php code at

http://www.althorne.org/witm/witm.txt

You will then need to save this as witm.php, not as .txt as on the web server. The name is important - if you want to use anything other than witm.php you will have to hack this line.

<Form action="witm.php" method="post" >

You would be strongly advised to password protect this, as it is possible for a user to read/write to any file which the user of the web server (typically 'nobody') can do. Also, Wolfram Research might object if you made the full Mathematica program publically accesable.

You might need to hack a couple of lines - particularly this one

$tailprog="/bin/tail +3 | head -1";

which gets the results from the program, and misses any irrelevant junk like the version of Mathematica. If it is not right, you will not see the result.

Also this, which is the path to 'math'

$mathprog="/usr/local/bin/math -batchinput -batchoutput";

You might want to change these too:

$maxram=1000000000; // Maximum RAM in bytes
$maxtime=10; // Maximum time in seconds

which set how long the kernel can run the computation, and how much memory it can use.

I'd be interested if anyone tries to get it working.

There are < 100 lines of php, including comments, so it should not be hard to see how it works.

If there is any interst, I might stick it on Soureforce. Shame I can't do a live demo, but it is just not practical for security and legal reasons.
--
Dave K MCSE.

MCSE = Minefield Consultant and Solitaire Expert.

Please note my email address changes periodically to avoid spam.
It is always of the form: month-year@domain. Hitting reply will work
for a couple of months only. Later set it manually.
.



Relevant Pages

  • Force a page to refresh after submitting a form.
    ... I wrote some PHP code, ... When 'Submit' is pressed, the PHP calls an external program (Mathematica), which itself creates a JPEG file. ... Dave K MCSE. ...
    (uk.net.web.authoring)
  • Re: The 2nd last ever php thread
    ... used to understand HTML ... - the web server recognises the .php file extension ... if found - the web server will examine and process the php code ... 'If the user is John then display Hi John, if the user is Fred then display Go away Fred' ...
    (uk.media.tv.misc)
  • Mathematica front end - needs just a browser.
    ... I know from recentdiscussions on here about the Solaris 10 bug which is screwing up Mathematica, that quite a few run Mathematica on Solaris, so perhaps the start is not too bad either. ... WITM needs Mathematica and a web server running on a UNIX/Linux platform, but allows access from anything with a browser. ...
    (comp.unix.solaris)
  • Re: .INC file not being included
    ... but what happens when someone tries to directly access the ... the php code itself and access the database credentials, of course depending ... on how the web server has been configured. ...
    (alt.php)
  • Re: Interactive PHP like Python
    ... Make a php script that outputs a form with a textarea where you can enter some php code. ... After outputting the <DIV styl=> tag, pass the code from the textarea passed to php's eval function. ... DO *NOT* put such a script on your website or any publically accessable web server directory as it would allow anyone to execute any php code on your server, allowing the reading of all its publically readable files, and probably hack you server. ...
    (comp.lang.php)