PHP のインストール時に lex:command not found
GCC すら導入しないピュアな環境の CentOS5.3 に、php インストールしようとして、怒られたー。
checking lex output file root... ./configure: line 2554: lex: command not found
yum で、そのまま「lex」と検索しても、上記の解決に必要なパッケージは出てきません。「flex」で検索すると出てきます。
# yum install flex
これでおk。
おまけ
普通は、configure を実行すると、オプションを config.log へ記録するけど、php の場合は、config.nice っていうファイルに記録するよ。
■
Configuring RMagick 1.15.8 checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking for ruby... no configure: error: Can't install RMagick. Ruby must be installed first. RMagick configuration failed with status 1.
$ which ruby /usr/local/bin/ruby # ln -s /usr/local/bin/ruby /usr/bin/ruby
Configuring RMagick 1.15.8 checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking for ruby... /usr/bin/ruby checking for Magick-config... no checking for GraphicsMagick-config... no configure: error: Can't install RMagick. Can't find Magick-config or GraphicsMagick-config program. RMagick configuration failed with status 1.
RMagick: FreeType library is not available `/usr/share/fonts/default/Type1/n019003l.pfb'. RMagick: FreeType library is not available `/usr/share/fonts/default/Type1/n019003l.pfb'. RMagick: FreeType library is not available `/usr/share/fonts/default/Type1/n019003l.pfb'. RMagick: FreeType library is not available `/usr/share/fonts/default/Type1/n019003l.pfb'. RMagick: FreeType library is not available `/usr/share/fonts/default/Type1/n019003l.pfb'. RMagick: FreeType library is not available `/usr/share/fonts/default/Type1/n019003l.pfb'. /usr/local/bin/ruby -I /usr/local/lib/ruby/gems/1.8/gems/rmagick-1.15.8/./lib -I /usr/local/lib/ruby/gems/1.8/gems/rmagick-1.15.8/./ext/RMagick affine_transform.rb (example 16 of 183) affine_transform.rb:6:in `read': no decode delegate for this image format `images/Flower_Hat.jpg' (Magick::ImageMagickError) from affine_transform.rb:6 setup.rb: Too many examples failed. Search for "Help!" at http://rmagick.rubyforge.org/install-faq.html. post-setup.rb: affine_transform.rb example returned error code 256 make: *** [all] エラー 1 Gem files will remain installed in /usr/local/lib/ruby/gems/1.8/gems/rmagick-1.15.8 for inspection. Results logged to /usr/local/lib/ruby/gems/1.8/gems/rmagick-1.15.8/gem_make.out