To build the MDSPLUS PHP extension you should perform the following steps. Beginning with downloading the sources.
Download MDSplus sources
The MDSplus repository can also be cloned from github using:
git clone https://github.com/MDSplus/mdsplus.git
php < PHP_SOURCE_DIR/ext/mdsplus/sample.php
If you want to just build a loadable module for php you can do the following:
cd PHP_SOURCE_DIR/ext/mdsplus ./build.sh
This should produce a mdsplus_php.so loadable module. You would use the dl() function to load this module. Note the location that the dl() function uses to find loadable modules is set in the php.ini configuration file. This may, by default, be set to "./" which would require the module to be located in the same directory as the php script being executed.
Another method is to use the phpize program which is often distributed with php. To use this method do the following commands:
$ cd mdsplus/php (This is the php directory under the mdsplus source tree) $ phpize $ ./configure $ make
This will produce a modules/mdsplus.so file which you can copy to mdsplus_php.so in your php library directory.
There are several sample php cgi scripts found in the php subdirectory of the mdsplus source tree:
sample.php - shows most of the use and functionality of the php interface. shot_display.php - displays plots of mdsplus signals. browser.php - a simple mdsplus tree browser