Configure: error: Please reinstall the BZip2 distribution
yum install bzip2 bzip2-devel
configure: error: libpng.(a|so) not found.
yum install libpng-devel
configure: error: mcrypt.h not found. Please reinstall libmcrypt.
When compiling PHP on a CentOS 6 machine I always get this error
configure: error: mcrypt.h not found. Please reinstall libmcrypt.
To fix this I just add these Repos. Just choose if you are running 32bit or 64bit
*For CentOS6 32bit
# rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
*For CentOS6 64bit
# rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
And then also add this
# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
And then install the libmcrypt
# yum --enablerepo=remi,remi-test install libmcrypt libmcrypt-devel
I would prefer this way since I dont want to compile the library manually and since I would also like to install the latest MySQL version which you can also install using the command below
# yum --enablerepo=remi,remi-test install mysql mysql-server
[iyunv@host]# rpm -ivh nginx.rpm
[iyunv@host]# yum install nginx
[iyunv@host]# chkconfig nginx on
[iyunv@host]# service nginx start
[iyunv@host]# service nginx stop
[iyunv@host]# service nginx restart
[iyunv@host]# service nginx status
nginx 开启GZIP压缩
root/nginx.conf
http{...}结点
server_names_hash_bucket_size 128;
client_header_buffer_size 32k;
large_client_header_buffers 4 32k;
client_max_body_size 50m;
sendfile on;
tcp_nopush on;
keepalive_timeout 60;
tcp_nodelay on;
server_tokens off;
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
fastcgi_buffer_size 64k;
fastcgi_buffers 4 64k;
fastcgi_busy_buffers_size 128k;
fastcgi_temp_file_write_size 256k;
gzip on;
gzip_min_length 1k;
gzip_buffers 4 16k;
gzip_http_version 1.0;
gzip_comp_level 2;
gzip_types text/plain application/x-javascript text/css application/xml;
gzip_vary on;
[iyunv@host]# service nginx reload
[iyunv@host]# yum install gcc
[iyunv@host]# yum install gcc-c++
[iyunv@host]# yum install gcc
[iyunv@host]# yum install gcc-c++
tar -zxvf name.tar.gz
tar -jxvf name.tar.bz2
[iyunv@host]# yum install libxml2
[iyunv@host]# yum install libxml2-devel -y
[iyunv@host]# yum install mysql mysql-server
[iyunv@host]# yum install mysql-devel
[iyunv@host]# service mysqld start
//修改密码
UPDATE user SET password=PASSWORD('123456') WHERE user='root';
FLUSH PRIVILEGES;
yum install wget gcc gcc-c++ make re2c curl curl-devel libxml2 libxml2-devel libjpeg libjpeg-devel libpng libpng-devel libmcrypt libmcrypt-devel zlib zlib-devel openssl openssl-devel freetype freetype-devel gd gd-devel perl perl-devel ncurses ncurses-devel bison bison-devel libtool gettext gettext-devel cmake bzip2 bzip2-devel pcre pcre-devel
PHP Setup
./configure --prefix=/usr/local/php --enable-fpm --enable-sockets --with-mcrypt --enable-mbstring --with-curl --disable-debug --disable-rpath --enable-inline-optimization --with-bz2 --enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex --with-mhash --enable-zip --with-pcre-regex --with-mysql --with-gd --with-pdo-mysql --with-freetype-dir --enable-pdo --with-openssl
[iyunv@host]# make
[iyunv@host]# make install
make ZEND_EXTRA_LIBS='-liconv'
configure: error: Please reinstall the libcurl distribution -
easy.h should be in /include/curl/
[iyunv@host]# yum -y install curl-devel
Configure: error: Please reinstall the BZip2 distribution
[iyunv@host]# yum install bzip2 bzip2-devel
那查看Configuration File (php.ini) Prath => /usr/local/lib
把php-5.4.16.tar目录中php.ini-production或者php.ini-development复制到/usr/local/lib/php.ini
将php-fpm设置为服务启动
[iyunv@host]# /usr/local/php/sbin/php-fpm
[13-Apr-2014 03:20:56] ERROR: failed to open configuration file '/opt/php/etc/php-fpm.conf': No such file or directory (2)
[13-Apr-2014 03:20:56] ERROR: failed to load configuration file '/opt/php/etc/php-fpm.conf'
[13-Apr-2014 03:20:56] ERROR: FPM initialization failed
解决办法
cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
[iyunv@host]# cd php-5.5.13/sapi/fpm/
[iyunv@host]# cp init.d.php-fpm /etc/init.d/php-fpm
[iyunv@host]# chmod 755 /etc/init.d/php-fpm
[iyunv@host]# /etc/init.d/php-fpm start
[iyunv@host]# /sbin/chkconfig --add /etc/init.d/php-fpm --(添加到开机服务列表)
[iyunv@host]# /sbin/chkconfig php-fpm on
php-fpm的启动、停止和重启:
[iyunv@host]# /etc/init.d/php-fpm start
[iyunv@host]# /etc/init.d/php-fpm stop
打开80端口必须输入以下
[iyunv@host]# /sbin/iptables -I INPUT -p tcp --dport 80 -j ACCEPT
[iyunv@host]# service iptables save
[iyunv@host]# service iptables restart
安装好系统后,发现没有我习惯使用的五笔输入法。你可以在这里设置:
system->preferences->input method。
如果在安装系统时选择语言包括UK和中文了,这块应该就有五笔等汉语输入法了。
但如果没有的话,就这样操作:
1.yum install "@Chinese Support"
2.到设置输入的地方添加即可
打包/usr目录,并用gzip压缩为abcd文件
tar zcvf abcd.tar.gz /usr
打包a.txt和b.txt到abcd文件,并用bzip压缩
tar jcvf abcd.tar.bz2 a.txt b.txt
解压tgz文件:
tar zxvf abcd.tar.gz
解压tbz2文件
tar jxvf abcd.tar.bz2
insert into user(Host,User,Password)values("localhost","test",password("123456"));
flush privileges;
grant all privileges on hsker.* to 'test'@'%' identified by '123456';
flush privileges;
update user set host = '%' where user = 'test';
MySQL Daemon failed to start
chmod 777 -R /var/lib/mysql;
yum install ibus-table-wubi.noarch
运维网声明
1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网 享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com