[PHP-users 31899] Re: php で imagemagick

Masaaki Suga suga @ tenrikyo.or.jp
2007年 4月 11日 (水) 12:20:35 JST


須賀です

Masaaki Matsuyama <masakun @ lily.ocn.ne.jp> wrote:

> 
> ここみると、image_newはありません。
> imagick_readについては、引数としてファイル名のみとなっているようです。
> 
適当なサンプルを使ってので,imsage_new()を使っていました

<?php
        $handle = imagick_readimage( "./image.jpg" ) ;
        if ( imagick_iserror( $handle ) )
        {
                $reason      = imagick_failedreason( $handle ) ;
                $description = imagick_faileddescription( $handle ) ;
        exit ;
        }

        print "Image height is " . imagick_getheight( $handle ) .
          " pixels<BR>\n" ;
?>

としても
Fatal error: Call to undefined function imagick_readimage() in /usr/local/apache/htdocs/suga.php on line 2
が出ます


http://jp2.php.net/manual/ja/ref.imagick.php
を読んでいると

インストール手順

Windows binaries may be found at ? http://snaps.php.net/. To install, download php_imagick.dll to the folder specified by your php.ini file's extension_dir directive. Enable it by adding extension=php_imagick.dll to your php.ini and restarting your webserver.

extension_dir=c:/php5/exts/
extension=php_imagick.dll

 

Linux, BSD, and other *nix variants can be compiled using the following steps:

    *

      Either:

          o Run the pear installer for PECL/imagick: pecl install imagick
          o Copy imagick.so from the directory indicated by the build process to the location specified in your php.ini file under extension_dir.
          o Add extension=imagick.so to your php.ini 

      Or:

          o

            Set the path to your php.ini via:

            pecl config-set php_ini /path/to/php.ini
          o Run the pear installer for PECL/imagick: pecl install imagick 


と書いてあります

具体的には,どういうことをすればいいのでしょうか?

Eitherのすぐしたの部分のやり方は
#pecl install imagick
を実行してできたimagick.soをphpのエクステンションのDirectoryにおいて
php.iniのextension=imagick.so としろということだと思いますが

#pecl install imagickを実行しようとしても
peclコマンドがどこにもありません

アドバイスよろしくお願いします

 -------------------------------
 須賀正明:suga @ tenrikyo.or.jp
 -------------------------------



PHP-users メーリングリストの案内