サーバー移転

2011年6月から使わせていただいていたsq4u.jpさんであるが、このところサーバーの不調が顕著であるため、移転することにした。

新サーバーはXFREEさん。
Perlが使えるという点でも、広告が全くないという点でも、sq4u.jpさんの方が上だとは感じているし、名残惜しくもあるのだが……

続きを読む

JpGraph Error 25128

PHPのお絵描きライブラリーであるJpGraph(4.2.6)をとある無料サーバーで使ったところ、25128というエラーになってしまった。

PHPのバージョンを5.4とかにすればエラーは出ないのだが、5.5とか、7.1とかにするとエラーになる。

ググったところ、gd_image.inc.phpのSetAntiAliasing()のエラーを吐いている箇所をコメントにすればよいらしい。

    // Should we use anti-aliasing. Note: This really slows down graphics!
    function SetAntiAliasing($aFlg=true) {
        $this->use_anti_aliasing = $aFlg;
        if( function_exists('imageantialias') ) {
            imageantialias($this->img,$aFlg);
        }
        else {
            // JpGraphError::RaiseL(25128);//('The function imageantialias() is not available in your PHP installation. Use the GD version that comes with PHP and not the standalone version.')
        }
    }

ただし、これをやるとアンチエイリアスが無効になるので、グラフの線が汚くなってしまう。

エラーメッセージの通り、システムのPHPの設定を変えることができればよいのだろうが。
仕方ないか…

【参考URL】
http://colekcolek.com/2012/05/16/how-to-fix-jpgraph-error-the-function-imageantialias-is-not-available/
http://sookibizviz.blog81.fc2.com/blog-entry-1633.html
https://support.severalnines.com/hc/en-us/articles/212425843