You can pass the command string in a file to Maxima, that is supported by command-line Maxima.
if your OS is Linux/Unix/MacOS
:
In PHP:
exec('maxima -q -b file');
or
system('maxima -q -b file');
if your OS is Win
:
$maximaDir = 'D:/Program Files/Maxima-5.30.0'; // If your maxima is installed in elsewhere, please modified this location
exec($maximaDir.'/bin/maxima.bat -q -b "result.txt"');
In Maxima, you can use stringout();
to get the result in a file, then in PHP read the file as a string, you can do any other manipulations to the string as you want.