configure: error: mcrypt.h not found. Please reinstall libmcrypt

On Centos6/7, when compile PHP from source:

configure: error: mcrypt.h not found. Please reinstall libmcrypt

To fix this:

yum update epel-release
yum install -y libmcrypt-devel

or if it doesn’t work, use epel-release from Fedora:

rpm -ivh https://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
yum install -y libmcrypt-devel

 

 

 

configure: error: mcrypt.h not found. Please reinstall libmcrypt

ERROR: http://rubygems.org/ does not appear to be a repository Error fetching remote data: Errno::ETIMEDOUT

Error happens when installing gem package using proxy

$ gem install sass
ERROR: http://rubygems.org/ does not appear to be a repository
Error fetching remote data: Errno::ETIMEDOUT: Connection timed out – connect(2) (http://rubygems.org/yaml)
Falling back to local-only install
ERROR: Could not find a valid gem ‘sass’ (>= 0) in any repository

Solution:
On RHEL/Centos:=, the variable http_proxy should have value started with ‘http://’

Working:
export http_proxy=http://192.168.1.1:3128

Not working:
export http_proxy=192.168.1.1:3128

Or we can add proxy option in gem install command:
gem install –http-proxy http://192.168.1.1:3128 sass

ERROR: http://rubygems.org/ does not appear to be a repository Error fetching remote data: Errno::ETIMEDOUT