Windowsでは、コマンドラインでMaximaを起動し、??plot;
コマンドを入力すると、これが表示されます。Webブラウザ(localhost)からMaximaコマンド(対話形式で入力する必要があります)を実行するためにPHPとAJAXを使用するには?
そして、あなたはorder number
またはall
またはnone
を選択することで、コマンドラインと対話する必要があります。
ここでPHPとAJAXを使ってWebサイト(localhost)を作成し、localhostのPHPスクリプトにアクセスすると、バックエンドのMaximaコマンドラインと対話して??plot;
コマンドをWebサイトで使用できます。
次のようにだから私は、PHPスクリプトを書く:
ファイル名:cmx.php
<?php
chdir("D:/Program Files/Maxima-5.30.0/bin");
$expr = escapeshellarg("display2d:false$ ??plot;");
// $expr = escapeshellarg("display2d:false$ solve(x^2-1=0, x);";
$cmd_str = "maxima --batch-string=$expr";
$res = exec($cmd_str, $out_arr, $return_val);
$out_str = implode('<br/>', $out_arr);
echo $out_str.'<br/>';
?>
この時、私はhttp://localhost/cmx.php
にアクセスすると、ウェブの内容は次のとおりです。ただし
Maxima 5.30.0 http://maxima.sourceforge.net
using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL)
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) display2d:false
(%i2) describe("plot",inexact)
0: Functions and Variables for Plotting
1: Gnuplot Options
2: Gnuplot_pipes Format Functions
3: Introduction to Plotting
4: Plotting Formats
5: Plotting Options
6: barsplot (Functions and Variables for statistical graphs)
7: barsplot_description (Functions and Variables for statistical graphs)
8: boxplot (Functions and Variables for statistical graphs)
9: boxplot_description (Functions and Variables for statistical graphs)
10: contour_plot (Functions and Variables for Plotting)
11: get_plot_option (Functions and Variables for Plotting)
12: gnuplot_close (Gnuplot_pipes Format Functions)
13: gnuplot_curve_styles (Gnuplot Options)
14: gnuplot_curve_titles (Gnuplot Options)
15: gnuplot_default_term_command (Gnuplot Options)
16: gnuplot_dumb_term_command (Gnuplot Options)
17: gnuplot_file_name (Functions and Variables for draw)
18: gnuplot_out_file (Gnuplot Options)
19: gnuplot_pm3d (Gnuplot Options)
20: gnuplot_preamble (Gnuplot Options)
21: gnuplot_ps_term_command (Gnuplot Options)
22: gnuplot_replot (Gnuplot_pipes Format Functions)
23: gnuplot_reset (Gnuplot_pipes Format Functions)
24: gnuplot_restart (Gnuplot_pipes Format Functions)
25: gnuplot_start (Gnuplot_pipes Format Functions)
26: gnuplot_term (Gnuplot Options)
27: implicit_plot (Functions and Variables for Plotting)
28: multiplot_mode (Functions and Variables for draw)
29: plot2d (Functions and Variables for Plotting)
30: plot3d (Functions and Variables for Plotting)
31: plotdf (Functions for numerical solution of differential equations)
32: ploteq (Functions for numerical solution of differential equations)
33: plot_format (Plotting Options)
34: plot_options (Functions and Variables for Plotting)
35: plot_realpart (Plotting Options)
36: scatterplot (Functions and Variables for statistical graphs)
37: scatterplot_description (Functions and Variables for statistical graphs)
38: set_plot_option (Functions and Variables for Plotting)
39: starplot (Functions and Variables for statistical graphs)
40: starplot_description (Functions and Variables for statistical graphs)
41: stemplot (Functions and Variables for statistical graphs)
Enter space-separated numbers, 'all' or 'none':
Still waiting:
Maxima encountered a Lisp error:
Error in PROGN [or a callee]: Unexpected end of #.
Automatically continuing.
To enable the Lisp debugger set debugger-hook to nil.
PHPスクリプトに$expr = escapeshellarg("display2d:false$ solve(x^2-1=0, x);";
がある場合、私は期待される結果を得ることができます。
さらに、同様の問題が発生しましたHow to execute an interactive command from PHP?しかし、私の問題では機能しません。
私はウェブ上のコマンドラインと継続して対話したいが、私はcontexがお互いに関連付けられていることを望む。
どうすればよいですか?このウェブサイトの導入を支援する効果的なアドバイスやWebフレームワークはありますか?
これらのリソースは役に立ちますが、私はPHPとAJAXを使用してWebstieを実装することを強くお勧めします。 – iMath