存档在 2017年12月

速度拿:域名抢注,快人一线。

2017年12月22日

速度拿-全通道域名抢注
域名抢注,快人一线。
http://suduna.com/

“快人一线”典出哪里?

参考:http://new.qq.com/omn/20171222A06KZK.html#p=5

过了冬至白天的时间会一天比一天长一点,长多少呢?古时女人在家做针线活,正好可以多用一条线的时间,太阳才落山。古时候人们没有时钟,根据生活经验总结了这样的谚语:“吃过冬至饭,一天长一线。”

参考:http://www.beareyes.com.cn/

小熊在线 – 出色资讯·快人一线

怎样编译安装libtiff

2017年12月21日

【介绍】

参考:http://www.linuxfromscratch.org/blfs/view/svn/general/libtiff.html

【编译】

最高版本:tiff-4.0.9

wget http://download.osgeo.org/libtiff/tiff-4.0.9.tar.gz && tar -zxvf tiff-4.0.9.tar.gz && cd tiff-4.0.9
./configure --prefix=/usr
make && make check && make install

输出:

----------------------------------------------------------------------
Libraries have been installed in:
   /usr/lib
...
----------------------------------------------------------------------
 /usr/bin/mkdir -p '/usr/include'
 /usr/bin/install -c -m 644 tiff.h tiffio.h tiffvers.h tiffio.hxx '/usr/include'
 /usr/bin/mkdir -p '/usr/include'
 /usr/bin/install -c -m 644 tiffconf.h '/usr/include'
...

怎样编译安装PHP7.2.*

2017年12月20日

参考:https://github.com/gitKearney/php7-from-scratch

【依赖】

安装次序:1. aspell/pspell > 2. Libmcrypt > 3. mhash > 4. mcrypt

编译安装aspell/pspell

PHP5可以跳过这个文件,直接把configure命令中的 –with-pspell 参数去掉即可。

这两个扩展会识别单词的拼法是否正确并给出意见。

如果需要在编译PHP时添加pspell支持,必须安装aspell库。

编译php时加上 ./configure –with-pspell=/usr 如果是phpize 编译 –with-pspell=/usr

编译安装Libmcrypt:

参考:http://amon.org/mcrypt

编译安装GD库及依赖包

安装次序:1. zlib > 2. libpng > 3. freetype > 4. jpeg > 5. libxpm > 6. libgd

编译安装zlib:

参考:http://amon.org/zlib

编译安装libpng:

参考:http://amon.org/libpng

编译安装freetype

参考:http://amon.org/freetype

编译安装jpeg

参考:http://amon.org/jpeg

编译安装libxpm:

yum install libXpm libXpm-devel

编译安装libgd:

参考:http://amon.org/libgd

4. 安装PHP

第一步. 安装一些依赖包

yum install gmp gmp-devel

2. 安装 libc-client

yum install libc-client libc-client-devel

创建软连接:

ln -s /usr/lib64/libc-client.so /usr/lib/libc-client.so
ln -s /usr/lib64/libldap* /usr/lib/

必须创建软连接,不然在编译PHP的时候,会报错找不到文件。

3. 安装 libicu

参考:http://amon.org/icu

如果没有安装libicu的话,在编译PHP的时候,会报错:

configure: error: Unable to detect ICU prefix or no failed. Please verify ICU install prefix and make sure icu-config works.

4. 安装libzip

参考:http://amon.org/libzip

5. 安装 liconv

参考:http://amon.org/libiconv

如果没安装,会在编译时报错:

/usr/bin/ld: cannot find -liconv
collect2: error: ld returned 1 exit status
make: *** [libphp7.la] Error 1

【编译php】

参考:http://amon.org/php5217

下载:http://php.net/downloads.php

wget http://php.net/distributions/php-7.2.12.tar.xz && tar -xvf php-7.2.12.tar.xz && cd php-7.2.12

开始configure配置:

参考:http://blog.csdn.net/m0_37886429/article/details/72520632

./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-fpm --with-fpm-user=apache --with-fpm-group=apache --disable-debug --with-curl --with-iconv --with-pcre-regex --with-zlib --enable-bcmath --enable-ftp --enable-sockets --enable-mbstring --enable-mbregex --enable-soap --with-xsl --with-openssl --enable-opcache=no --with-mysqli --with-mysql-sock --with-pdo-mysql --enable-mysqlnd --disable-fileinfo --with-gd=/usr/local/gd --enable-gd-jis-conv --with-jpeg-dir=/usr/local/jpeg/lib --with-png-dir=/usr/local/png --with-freetype-dir=/usr/local/freetype --with-libzip=/usr/local/lib64 --enable-zip --with-iconv-dir=/usr/local/lib --with-readline --with-apxs2=/usr/local/apache2/bin/apxs LDFLAGS="-L/usr/lib -lz"

然后开始 make:

make ZEND_EXTRA_LIBS='-liconv'

如果make 时报错:undefined reference to symbol ‘ber_scanf’

参考:http://www.oschina.net/question/56833_128548?sort=time

/usr/bin/ld: ext/ldap/.libs/ldap.o: undefined reference to symbol 'ber_scanf'
/usr/bin/ld: note: 'ber_scanf' is defined in DSO /lib64/liblber-2.4.so.2 so try adding it to the linker command line
/lib64/liblber-2.4.so.2: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1

编辑MakeFile,找到 117行 开头是 ‘EXTRA_LIBS’ 这一行 在结尾加上 ‘-llber’ :

EXTRA_LIBS = ... -llber

重新make(注意不能make clean,因为这样的话MakeFile会还原),输出:

...
Build complete.
Don't forget to run 'make test'

如果执行命令 make test ,进程会卡死,止步于:

...
PASS Bug #66830 (Empty header causes PHP built-in web server to hang) [sapi/cli/tests/bug66830.phpt]

那就绕开此步,关闭进程后,重启进程直接 make install :

make install

运行:

libtool --finish /root/php-7.2.0/libs

添加/usr/local/php/lib/php to your php.ini include_path:

/root/php-7.2.0/build/shtool install -c ext/phar/phar.phar /usr/local/php/bin
ln -s -f phar.phar /usr/local/php/bin/phar

编译安装完成。

创建软连接:

ln -s /usr/local/php/bin/php /usr/local/bin/
ln -s /usr/local/php/bin/phpize /usr/local/bin/
ln -s /usr/local/php/bin/php-config /usr/local/bin/

php 配置文件:

cp /root/php-7.2.11/php.ini-production /usr/local/php/etc/php.ini

php-fpm 配置文件:

cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
cp /usr/local/php/etc/php-fpm.d/www.conf.default /usr/local/php/etc/php-fpm.d/www.conf

查看版本:

php -v

输出:

PHP 7.2.11 (cli) (built: Mar 12 2018 10:11:46) ( ZTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

重启Apache:

service httpd stop
service httpd start

Apache正常启动。

【报错】

报错:configure: error: Unable to detect ICU prefix or no failed. Please verify ICU install prefix and make sure icu-config works.

yum install libicu-devel

参考:http://amon.org/icu

报错:configure: error: Cannot find ldap libraries in /usr/lib.

cp -frp /usr/lib64/libldap* /usr/lib/

报错:checking for libzip… not found

yum install libzip libzip-devel

报错:checking for libzip… configure: error: system libzip must be upgraded to version >= 0.11

参考:http://amon.org/libzip

ln -s -f /usr/include/zipconf.h /usr/local/include/zipconf.h

报错:cannot find -liconv

make 时报错:cannot find -liconv

参考:http://amon.org/libiconv

报错:off_t undefined; check your library configuration

参考:https://stackoverflow.com/questions/44941513/php-compile-off-t-undefined
参考:https://stackoverflow.com/questions/44941513/php-compile-off-t-undefined
参考:http://ju.outofmemory.cn/entry/319609

echo '/usr/local/lib64
/usr/local/lib
/usr/lib
/usr/lib64'>>/etc/ld.so.conf&&ldconfig -v

怎样保证保证Server loaded和Compiled using的APR版本一致

2017年12月20日

编译安装Apache时,可能因APR版本产生问题。

wget http://archive.apache.org/dist/apr/apr-1.4.8.tar.gz && tar -zxvf apr-1.4.8.tar.gz && mv apr-1.4.8 apr
wget http://archive.apache.org/dist/apr/apr-util-1.5.2.tar.gz && tar -zxvf apr-util-1.5.2.tar.gz && mv apr-util-1.5.2 apr-util



wget http://archive.apache.org/dist/apr/apr-1.6.3.tar.gz && tar -zxvf apr-1.6.3.tar.gz && mv apr-1.6.3 apr
wget http://archive.apache.org/dist/apr/apr-util-1.6.1.tar.gz && tar -zxvf apr-util-1.6.1.tar.gz && mv apr-util-1.6.1 apr-util

输入:

/usr/local/apache2/bin/httpd -V

输出:

Server version: Apache/2.4.29 (Unix)
Server built: Dec 20 2017 11:26:18
Server’s Module Magic Number: 20120211:68
Server loaded: APR 1.4.8, APR-UTIL 1.5.2
Compiled using: APR 1.4.8, APR-UTIL 1.5.2
Architecture: 64-bit
Server MPM: worker
threaded: yes (fixed thread count)
forked: yes (variable process count)

I also encountered the same issue. The root cause of the issue is a version mismatch in the apr version
In order to fix it, download the following: apr-util-1.5.4.tar.gz and apr-1.5.1.tar.gz. These can be downloaded at : https://apr.apache.org/download.cgi
Assuming that you have http src untarred in /src/httpd, you untar the apr-1.5.1 and apr-util in the opt/src/httpd/srclib
So the unzipped structure would be opt/src/httpd/srclib/apr and opt/src/httpd/srclib/apr-util
After this is done, you can run the configure with the following command

参考:https://stackoverflow.com/questions/25231421/mod-ssl-so-not-loading
参考:https://stackoverflow.com/questions/20435151/undefined-symbol-in-apache-http-server

Error code: ssl_error_rx_record_too_long

2017年12月20日

原来:

<virtualhost 127.0.0.1:443>

	ServerName domain.name
	ServerAlias www.domain.name

	DocumentRoot /usr/local/apache2/htdocs/domain.name/

	ErrorLog /usr/local/apache2/htdocs/logs/domain.name_error.log
	CustomLog /usr/local/apache2/htdocs/logs/domain.name_access.log combined

	GnuTLSEnable on
	GnuTLSPriorities NORMAL
	GnuTLSCertificateFile /usr/local/apache2/htdocs/ssl/domain.name/chained.pem
	GnuTLSKeyFile /usr/local/apache2/htdocs/ssl/domain.name/domain.key

	<Directory /usr/local/apache2/htdocs/domain.name>
		Options Indexes FollowSymLinks
		AllowOverride All
		Require all granted
	</Directory>

</virtualhost>

在浏览器中输入网址后,报错:

SSL 接收到一个超出最大准许长度的记录。

(错误码: ssl_error_rx_record_too_long)

参考:https://www.xdty.org/411
参考:http://b.gkp.cc/2010/10/14/solve-error-code-ssl-error-rx-record-too-long/

解决方法是修改标签,将其改为的形式

我是这样配置的:,改成 。就好了。其实 StarlSSL 网站的教程中就是这么写的。

修改后:

<virtualhost *:443>

	ServerName domain.name
	ServerAlias www.domain.name

	DocumentRoot /usr/local/apache2/htdocs/domain.name/

	ErrorLog /usr/local/apache2/htdocs/logs/domain.name_error.log
	CustomLog /usr/local/apache2/htdocs/logs/domain.name_access.log combined

	GnuTLSEnable on
	GnuTLSPriorities NORMAL
	GnuTLSCertificateFile /usr/local/apache2/htdocs/ssl/domain.name/chained.pem
	GnuTLSKeyFile /usr/local/apache2/htdocs/ssl/domain.name/domain.key

	<Directory /usr/local/apache2/htdocs/domain.name>
		Options Indexes FollowSymLinks
		AllowOverride All
		Require all granted
	</Directory>

</virtualhost>

重新在浏览器中输入网址,正常。