Project

General

Profile

Actions

Install the MRC PHP Extension » History » Revision 2

« Previous | Revision 2/80 (diff) | Next »
Amber Herold, 03/17/2010 02:29 PM


MRC PHP Extension Installation and Testing

4.1 Build the MRC module

Download php_mrc_src_1_5_1.tgz

cd to your php devel directory

> cd /usr/include/php/ext/
> mv [downloads]/php_mrc_src_1_5_1.tgz .

Untar the archive

> tar zxvf php_mrc_src_1_5_1.tgz
> cd mrc/

Make sure that GD and FFTW 3 devel libraries are installed

> phpize
> ./configure 
> make
> make install

4.2 Install MRC module

Check that mrc.so is in your php extension directory

> ls /usr/lib/php/extensions

You should see mrc.so listed.

Make sure that GD and FFTW 3 libraries are installed

  • edit your php configuration file php.ini to add "mrc.so" extension.
  • You might also increase the memory_limit field. It is set to 8M by default. The more the merrier!
  • 4kx4k float MRC image is about 64MB
    > vi /etc/php.ini
    
  • increase memory
    > memory_limit = 256M; Maximum amount of memory
    
  • Create the mrc.ini file
> cd /etc/php.d
vi mrc.ini
  • add the following lines
 ; Enable mrc extension module
 extension=mrc.so

NOTE: If PHP modules are already listed in PHP.ini do the following:

  • check extension_dir value
     extension_dir = /usr/lib64/php/extensions
    
  • add the following at the end of the [extension section]
 extension=mrc.so

Restart your webserver

/etc/init.d/apache2 restart

OR

/etc/init.d/httpd restart

4.3 Test the MRC module installation

Download this MRC file mymrc.mrc and the following 2 scripts into the same directory to test the PHP mrc extension.

Run the scripts with the following commands:
The expected results are shown below. If you get the same images, you've installed the extension properly.

> php -q ex1.php | display
  • gd module test result:
> php -q ex2.php | display
  • fftw module test result:

Updated by Amber Herold almost 15 years ago · 2 revisions