search
HomeBackend DevelopmentPHP Tutorialhiphop-php【未能顺利编译YII】

hiphop-php【未能成功编译YII】

==================测试环境redhat 6.0? 64bit


cmake 2.6 is the minimum version
g++/gcc 4.3 is the minimum version
Boost 1.37 is the minimum version

libicu 4.2 is the minimum version

tbb Intel's Thread Building Blocks

?

?

===64bit====https://github.com/facebook/hiphop-php?? zhengdlwb@....

?

https://github.com/facebook/hiphop-php/issues

http://groups.google.com/group/hiphop-php-dev/
http://blog.liubijian.com/hiphop-php-install.html
http://www.ooso.net/archives/543
https://github.com/facebook/hiphop-php/wiki/building-and-installing
http://www.inanu.net/post/386.html
http://www.iteye.com/topic/1112434

?

http://www.oschina.net/question/54100_10698

http://www.ooso.net/archives/545

https://github.com/facebook/hiphop-php/wiki/using-nginx-as-front-server-to-hiphop?? Using nginx as front server to HipHop

http://www.joomlagate.com/article/joomla-review/hiphop-php-speed-up-joomla-websites/??? HipHop PHP 或可提高 Joomla 网站运行效率达 50%?

?

?



====32bit====https://github.com/metagoto/hiphop-php??
http://www.linuxidc.com/Linux/2011-04/35270.htm

?

?

?

?

?

?

======================================说明

?

不支持绝对路径

编译yii报错

编译wordpress成功

禁用非常用命令,如eval()

静态资源js,css,图片可用二级域名或一级域名匹配后缀走nginx/apache

前端80nginx,php访问分发到hiphop-php的服务上

?

?

?

?

?

hphp --input-dir=/tmp/aa/ --keep-tempdir=1 --log=3
./program -m server -p 8081

http://192.168.1.95:8081/a/1.php
http://192.168.1.95:8081/a2/2.php

?

=================================== 问题

???1 .如何编译两个不同根下的目录

?

cp -avx /tmp/{a,a2} /tmp/aa/
cp -avx {/tmp/a,/tmp/a2} /tmp/aa/

?

hphp --input-dir /tmp/{a,a2} --keep-tempdir=1 --log=3 不成功

?

?

??? 2. YII编译报错? hphp --input-dir=/tmp/yii/ --keep-tempdir=1 --log=3 --force=1

?


[[email protected]_MS_HIPHOP_95 tmp]# hphp --input-dir=/tmp/yii/ --keep-tempdir=1 --log=3
running hphp...
creating temporary directory /tmp/hphp_8EI4PF ...
parsing inputs...
Unable to stat file /tmp/yii/framework/gii/components/Pear/Text/Diff/Renderer/Text/Diff/Renderer.php
Unable to stat file /tmp/yii/framework/gii/components/Pear/Text/Diff/Text/Diff.php
Unable to stat file /tmp/yii/framework/gii/components/Pear/Text/Text/Diff.php
Unable to stat file /tmp/yii/framework/gii/components/Text/Diff.php
Unable to stat file /tmp/yii/framework/gii/components/Text/Diff/Renderer.php
Unable to stat file /tmp/yii/framework/gii/components/Text/Diff/Renderer/inline.php
Unable to stat file /tmp/yii/framework/test/PHPUnit/Runner/Version.php
Unable to stat file /tmp/yii/framework/test/PHPUnit/Autoload.php
Unable to stat file /tmp/yii/framework/test/PHPUnit/Extensions/SeleniumTestCase.php
Unable to stat file /tmp/yii/framework/vendors/TextHighlighter/Text/Text/Highlighter/Generator.php
Unable to stat file /tmp/yii/framework/vendors/TextHighlighter/Text/Console/Getopt.php
parsing inputs took 0'07" (7181 ms) wall time
pre-optimizing...
pre-optimizing took 0'00" (293 ms) wall time
inferring types...
inferring types took 0'01" (1003 ms) wall time
post-optimizing...
post-optimizing took 0'00" (377 ms) wall time
creating CPP files...
creating CPP files took 0'03" (3134 ms) wall time
saving code errors...
compiling and linking CPP files...
/tmp/hphp_8EI4PF/php/framework/db/schema/mysql/CMysqlSchema.cpp:
In member function \xe2\x80\x98double HPHP::c_CMysqlSchema::t_getserverversion()\xe2\x80\x99:\n/tmp/hphp_8EI4PF/php/framework/db/schema/mysql/CMysqlSchema.cpp:808
: \xe9\x94\x99\xe8\xaf\xaf\xef\xbc\x9a\xe2\x80\x98q_PDO___ATTR_SERVER_VERSION\xe2\x80\x99\xe5\x9c\xa8\xe6\xad\xa4\xe4\xbd\x9c\xe7\x94\xa8\xe5\x9f\x9f\xe4\xb8\xad\xe5\xb0\x9a\xe6\x9c\xaa\xe5\xa3\xb0\xe6\x98\x8e\nmake[2]: *** [CMakeFiles/program.dir/php/framework/db/schema/mysql/CMysqlSchema.cpp.o]
\xe9\x94\x99\xe8\xaf\xaf 1\nmake[1]: *** [CMakeFiles/program.dir/all] \xe9\x94\x99\xe8\xaf\xaf 2\nmake: *** [all] \xe9\x94\x99\xe8\xaf\xaf 2\n
compiling and linking CPP files took 7'06" (426610 ms) wall time
hphp failed
running hphp took 7'19" (439331 ms) wall time

?

=========>>>?

?

官方解答:

?

open /tmp/hphp8EI4PF/php/framework/db/schema/mysql/CMysqlSchema.cpp
and replace q_PDO__
with q_PDO$$ and run make again.
known bug

?

?


================================编译 PHP 到 C++,Hiphop-PHP 有 5 种编译方法:

?

?系统环境变量的设置
Hiphop-PHP 在运行前需要设置两个系统环境变量,分别是 $HPHP_HOME 和 $HPHP_LIB。对于这篇文章中的 RPM 包方式安装的 Hiphop-PHP,这两个环境变量应该这样设置:

export HPHP_HOME=/usr/lib64/hphp

export HPHP_LIB=/usr/lib64/hphp/bin

?


(1)编译并直接运行

hphp test.php

(2)将 PHP 编译到临时目录,手动执行

hphp test.php --keep-tempdir=1 --log=3

/tmp/hphp_p6vSsP/program (注意!在你的系统中,临时目录的目录名和我不相同,需要进入正确的目录。)

(3)将 PHP 编译到临时目录,启动程序并以 WEB SERVER 方式访问

hphp test.php --keep-tempdir=1 --log=3

/tmp/hphp_p6vSsP/program -m server

打开浏览器,输入 http://www.your.domain/test.php 访问。

你也可以让 Hiphop-PHP 运行于非 80 端口:

/tmp/hphp_p6vSsP/program -m server -p 8080

对于生产环境来说,我们希望 Hiphop-PHP 以守护进程方式运行:

/tmp/hphp_p6vSsP/program -m daemon

(4)运行时解析

hphpi -f test.php

这个就不太推荐了,不过可以作为 Debug 模式来用。

(5)以 WEB 方式运行时解析

hphpi -m daemon

在浏览器中访问 http://www.your.domain/test.php 来访问。

?

?

?

?

========================================性能对比

?


# time php t.php
simple???????????? 0.227
simplecall???????? 0.277
simpleucall??????? 0.282
simpleudcall?????? 0.287
mandel???????????? 0.655
mandel2??????????? 0.841
ackermann(7)?????? 0.273
ary(50000)???????? 0.035
ary2(50000)??????? 0.030
ary3(2000)???????? 0.281
fibo(30)?????????? 0.897
hash1(50000)?????? 0.069
hash2(500)???????? 0.056
heapsort(20000)??? 0.170
matrix(20)???????? 0.161
nestedloop(12)???? 0.378
sieve(30)????????? 0.188
strcat(200000)???? 0.019
------------------------
Total????????????? 5.126

real??? 0m5.165s
user??? 0m5.016s
sys???? 0m0.049s






# time ./program
simple???????????? 0.003
simplecall???????? 0.001
simpleucall??????? 0.001
simpleudcall?????? 0.001
mandel???????????? 0.291
mandel2??????????? 0.294
ackermann(7)?????? 0.046
ary(50000)???????? 0.016
ary2(50000)??????? 0.010
ary3(2000)???????? 0.183
fibo(30)?????????? 0.183
hash1(50000)?????? 0.043
hash2(500)???????? 0.037
heapsort(20000)??? 0.068
matrix(20)???????? 0.040
nestedloop(12)???? 0.021
sieve(30)????????? 0.041
strcat(200000)???? 0.006
------------------------
Total????????????? 1.284

real??? 0m1.743s
user??? 0m1.498s
sys???? 0m0.024s

?

===================================== 编译多个目录
/tmp/aa
??? /a/1.php
??? /a2/2.php

a/1.php
$a="a";
echo $a;
?>


a2/2.php
include("../a/1.php");
echo $a;

?>



hphp --input-dir=/tmp/aa/ --keep-tempdir=1 --log=3
./program -m server -p 8081

http://192.168.1.95:8081/a/1.php
http://192.168.1.95:8081/a2/2.php

?

======================================= 编译class

?

?


class a {

??????????? function func1()
??????????????? {
??????????????? echo("I'm func1 in A!
");
??????????????? }

??????????? function func2()
??????????????? {
??????????????? echo("I'm func2 in A!
");
??????????????? }
}


$b = new a();
$b->func1();

?>

?

?

#hphp test.php???? 编译并直接运行

#hphpi -f test.php? 运行时解析

==========================================# hphp --help
HipHop Compiler for PHP Usage:

??????? hphp

Options:
? --help???????????????????????? display this message
? --version????????????????????? display version number
? -t [ --target ] arg (=run)???? lint | analyze | php | cpp | sep-ext-cpp |
???????????????????????????????? filecache | run (default)
? -f [ --format ] arg??????????? lint: (none);????????????????????????????????????????? 运行时解析??????? hphpi -f test.php
???????????????????????????????? analyze: (none);
???????????????????????????????? php: trimmed (default) | inlined | pickled |
???????????????????????????????? typeinfo | ???????????????????????????????? separator>;
???????????????????????????????? cpp: cluster (default) | file | sys | exe |
???????????????????????????????? lib;
???????????????????????????????? run: cluster (default) | file
? --cluster-count arg (=0)?????? Cluster by file sizes and output roughly these
???????????????????????????????? many number of files. Use 0 for no clustering.
? --input-dir arg??????????????? input directory???????????????????????????????????? 输入的目录(支持多个目录)
? --program arg (=program)?????? final program name to use
? --args arg???????????????????? program arguments
? -i [ --inputs ] arg??????????? input file names??????????????????????????????????? 输入的文件名
? --input-list arg?????????????? file containing list of file names, one per???????? 包含文件的文件名列表,每行一个
???????????????????????????????? line
? --include-path arg???????????? a list of full paths to search for files being
???????????????????????????????? included in includes or requires but cannot be
???????????????????????????????? found assuming relative paths
? --module arg?????????????????? directories containing all input files????????????? 包含所有的输入文件的目录
? --exclude-dir arg????????????? directories to exclude from the input
? --fmodule arg????????????????? same with module, except no exclusion checking
???????????????????????????????? is performed, so these modules are forced to
???????????????????????????????? be included
? --ffile arg??????????????????? extra PHP files forced to include without?????????? 被迫额外的PHP文件,包括不排除检查
???????????????????????????????? exclusion checking
? --exclude-file arg???????????? files to exclude from the input, even if??????????? 排除输入的文件,即使解析按需发现
???????????????????????????????? parse-on-demand finds it
? --exclude-pattern arg????????? regex (in 'find' command's regex command line
???????????????????????????????? option format) of files or directories to
???????????????????????????????? exclude from the input, even if
???????????????????????????????? parse-on-demand finds it
? --exclude-static-pattern arg?? regex (in 'find' command's regex command line
???????????????????????????????? option format) of files or directories to
???????????????????????????????? exclude from static content cache
? --exclude-static-dir arg?????? directories to exclude from static content????????? 目录排除静态内容缓存
???????????????????????????????? cache
? --exclude-static-file arg????? files to exclude from static content cache????????? 文件排除从静态内容缓存
? --cfile arg??????????????????? extra static files forced to include without??????? 额外的静态文件,迫使包括不排除检查
???????????????????????????????? exclusion checking
? --cmodule arg????????????????? extra directories for static files without????????? 不排除签静态文件的额外目录
???????????????????????????????? exclusion checking
? --parse-on-demand arg (=1)???? whether to parse files that are not specified?????? 不从命令行中指定的文件是否解析
???????????????????????????????? from command line
? --branch arg?????????????????? SVN branch
? --revision arg???????????????? SVN revision
? -o [ --output-dir ] arg??????? output directory
? --output-file arg????????????? output file????????????????????????????????????????? 输出文件
? --sync-dir arg???????????????? Files will be created in this directory first,?????? 文件将在此目录中创建的第一个,然后同步输出目录覆盖相同的文件。增量编译和构建大。
???????????????????????????????? then sync with output directory without
???????????????????????????????? overwriting identical files. Great for
???????????????????????????????? incremental compilation and build.
? --optimize-level arg (=1)????? optimization level??????????????????????????????????? 优化级别
? --gen-stats arg (=0)?????????? whether to generate code errors
? -k [ --keep-tempdir ] arg (=0) whether to keep the temporary directory?????????????? 是否保留临时目录
? --db-stats arg???????????????? database connection string to save code
???????????????????????????????? errors: :@:/???????????????????????????????? b>
? --no-type-inference arg (=0)?? turn off type inference for C++ code????????????????? 关闭C + +代码生成的类型推断
???????????????????????????????? generation
? --no-min-include arg (=0)????? turn off minimium include analysis when target???????? 关闭minimium包括分析时的目标是“分析”
???????????????????????????????? is "analyze"
? --no-meta-info arg (=0)??????? do not generate class map, function jump table???????? 不生成类图,函数跳转表和宏,在生成代码时,用于演示目的
???????????????????????????????? and macros when generating code; good for demo
???????????????????????????????? purposes
? -c [ --config ] arg??????????? config file name
? --config-dir arg?????????????? root directory configuration is based on (for????????? 根目录配置的基础上(例如,排除的目录可能会在配置中的相对路径。
???????????????????????????????? example, excluded directories may be relative
???????????????????????????????? path in configuration.
? -v [ --config-value ] arg????? individual configuration string in a format of???????? 个人配置字符串名称=值,名称可以是任何有效的配置配置文件的格式
???????????????????????????????? name=value, where name can be any valid
???????????????????????????????? configuration for a config file
? -l [ --log ] arg (=-1)???????? -1: (default); 0: no logging; 1: errors only;????????? log级别
???????????????????????????????? 2: warnings and errors; 3: informational as
???????????????????????????????? well; 4: really verbose.
? --force arg (=1)?????????????? force to ignore code generation errors and???????????? 强制忽略代码生成错误并继续编译
???????????????????????????????? continue compilations
? --file-cache arg?????????????? if specified, generate a static file cache??????????? 如果指定的话,产生与此文件名的静态文件缓存
???????????????????????????????? with this file name
? --rtti-directory arg?????????? the directory of rtti profiling data???????????????? RTTI分析数据的目录
? --java-root arg (=php)???????? the root package of generated Java FFI classes
? --generate-ffi arg (=0)??????? generate ffi stubs
? --dump arg (=0)??????????????? dump the program graph????????????????????????????? 转储程序图
? --docjson arg????????????????? Filename to generate a JSON file for PHP docs?????? 文件名生成一个JSON的PHP文件文件
? --coredump arg (=0)??????????? turn on coredump
? --nofork arg (=0)????????????? forking is needed for large compilation to?????????? 分叉是需要大量的编译之前的g ++编译释放内存。关闭分叉可以帮助gdb调试。
???????????????????????????????? release memory before g++compilation. turning
???????????????????????????????? off forking can help gdb debugging.
? --fl-annotate arg (=0)???????? Annote emitted source with compiler file-line?????????? Annote编译器文件行信息的排放源
???????????????????????????????? info
? --opts arg (=none)???????????? Set optimizations to enable/disable??????????????????? 设置启用/禁用的优化
? --ppp arg????????????????????? Preprocessed partition configuration. To speed
???????????????????????????????? up distcc compilation, bin/ppp.php can
???????????????????????????????? pre-compute better partition between different
???????????????????????????????? .cpp files according to preprocessed file
???????????????????????????????? sizes, instead of original file sizes
???????????????????????????????? (default). Run bin/ppp.php to generate an HDF
???????????????????????????????? configuration file to specify here.
? --compiler-id????????????????? display the git hash for the compiler id???????????? 显示git的编译器ID哈希
? --taint-status???????????????? check if the compiler was built with taint?????????? 检查如果编译器是内置的污点启用
???????????????????????????????? enabled

?

?

?

?

?

=========================== 安装配置(未完全整理,仅供参考)? 原则:碰到哪个软件本版太底或没安装,安装后继续

?

http://www.iteye.com/topic/1112434

?

?



yum -y install git cmake pcre-devel libmcrypt-devel mysql-devel gd-devel libxml2-devel libcap-devel binutils-devel flex bison expat-devel patch gcc44 gcc44-c++ gcc gcc-c++ bzip2 bzip2-devel memcached openldap openldap-devel readline-devel libc-client-devel pam-devel wget ncurses-devel




安装注意事项

编译的时候碰到的问题很多,但是基本上都是按照wiki上的步骤进行的。我觉得比较重要的几点:

??? wiki上的Required Packages包包列表都要检查一遍,比如版本号,是否安装过,像binutils-dev这种就很容易忽略
??? 版本符合的话,直接用yum安装这些包就可以了
??? wiki上有类似Boost 1.37 is the minimum version字样,说明开发者可能就是在这个版本下开发的,我试了下最新版本的boost,编译到后来反而出错
??? 如果yum上没有符合版本的lib库,可以手动编译,但是编译时建议就放在自己的home下,比如:
??? DE>./configure --prefix=/home/userDE>
??? tbb Intel’s Thread Building Blocks这个包有些麻烦,记得按照wiki上说的步骤安装


export CMAKE_PREFIX_PATH=/root

To build HipHop, use the following:

Linux:

cd /root/dev
git clone git://github.com/facebook/hiphop-php.git
cd hiphop-php
git submodule init
git submodule update
export HPHP_HOME=`pwd`
export HPHP_LIB=`pwd`/bin
cmake .

.....


make







cd libmemcached-0.48
./configure
make install
cd ..


cd libevent-1.4.14-stable
cp ../hiphop-php/src/third_party/libevent-1.4.14.fb-changes.diff .
patch ./configure
make install
cd ..




yum install libXpm
rpm -Uvh? gd-2.0.35-10.el6.x86_64.rpm




wget wget http://www.boutell.com/gd/http/gd-2.0.33.tar.gz
tar zxvf gd-2.0.33.tar.gz
cd gd-2.0.33
./configure
make
make install




tar jxvf curl-7.20.0.tar.bz2
cd curl-7.20.0
cp ../hiphop-php/src/third_party/libcurl.fb-changes.diff .
patch -p1 ./configure
make
make install



wget http://download.icu-project.org/files/icu4c/4.6.1/icu4c-4_6_1-src.tgz
cd icu/source
tar xvzf icu4c-4_6_1-src.tgz
./configure
make
make install




cd /tmp/rpm
###rpm -Uvh --force *.rpm --nodeps
rpm -Uvh --force *.rpm



wget "http://www.threadingbuildingblocks.org/uploads/77/142/2.2/tbb22_20090809oss_src.tgz"
tar xvzf tbb22_20090809oss_src.tgz
cd tbb22_20090809oss
gmake
cp -Rp include/tbb/ /usr/include/
cp ./build/*_release/*.so /usr/lib/
cp ./build/*_release/*.so.2 /usr/lib/
ldconfig



rpm -ivh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
yum install mcrypt.x86_64? libmcrypt-devel.x86_64



wget http://www.geocities.jp/kosako3/oniguruma/archive/onig-5.9.2.tar.gz
或者下载地址http://www.google.com.hk/url?sa=t&source=web&cd=1&ved=0CBkQFjAA&url=http%3A%2F%2Fwww.163disk.com%2Ffileview_273358.html&rct=j&q=onig-5.9.2.tar.gz&ei=DBJeTtehKovRmAX_w6Qy&usg=AFQjCNHaI9mOmm5o-BlJEAian2e9bKsYJw&cad=rjt
./configure
make
make install


yum install jemalloc-devel.x86_64 jemalloc.x86_64


yum install libc-client2007.x86_64
wget http://php.webtutor.pl/wp-content/uploads/2011/04/libcclient2007-devel.tar.gz
cp -r imap /usr/local/include/
cp /usr/lib/libc-client.so.2007 /usr/local/lib/libc-client.so





?

------------------ make 报错:
Linking CXX static library ../../bin/libhphp_analysis.a
[ 88%] Built target hphp_analysis
Scanning dependencies of target hphp
[ 88%] Building CXX object src/hphp/CMakeFiles/hphp.dir/main.cpp.o
Linking CXX executable hphp
/usr/bin/ld: warning: libcrypto.so.6, needed by /usr/local/lib/libc-client.so, m???????????????????????????????????????????????????????????????????????????? ay conflict with libcrypto.so.10
/usr/bin/ld: warning: libssl.so.6, needed by /usr/local/lib/libc-client.so, may????????????????????????????????????????????????????????????????????????????? conflict with libssl.so.10
../../bin/libhphp_runtime.a(ext_image.cpp.o): In function `HPHP::f_imagecreatefr???????????????????????????????????????????????????????????????????????????? omstring(HPHP::String const&)':
ext_image.cpp:(.text+0x70e7): undefined reference to `gdImageCreateFromJpegCtx'
../../bin/libhphp_runtime.a(ext_image.cpp.o): In function `HPHP::_php_image_conv???????????????????????????????????????????????????????????????????????????? ert(HPHP::String const&, HPHP::String const&, int, int, int, int)':
ext_image.cpp:(.text+0x77f9): undefined reference to `gdImageCreateFromJpeg'
../../bin/libhphp_runtime.a(ext_image.cpp.o): In function `HPHP::_php_image_crea???????????????????????????????????????????????????????????????????????????? te_from(HPHP::String const&, int, int, int, int, int, char*, gdImageStruct* (*)(???????????????????????????????????????????????????????????????????????????? ), gdImageStruct* (*)())':
ext_image.cpp:(.text+0x82e6): undefined reference to `gdImageCreateFromJpeg'
../../bin/libhphp_runtime.a(ext_image.cpp.o): In function `HPHP::f_imagecreatefr???????????????????????????????????????????????????????????????????????????? omjpeg(HPHP::String const&)':
ext_image.cpp:(.text+0x8b98): undefined reference to `gdImageCreateFromJpegCtx'
ext_image.cpp:(.text+0x8ba1): undefined reference to `gdImageCreateFromJpeg'
../../bin/libhphp_runtime.a(ext_image.cpp.o): In function `HPHP::f_imagejpeg(HPH???????????????????????????????????????????????????????????????????????????? P::Object const&, HPHP::String const&, int)':
ext_image.cpp:(.text+0x196ad): undefined reference to `gdImageJpegCtx'
../../bin/libhphp_runtime.a(ext_imagesprite.cpp.o): In function `HPHP::c_ImageSp???????????????????????????????????????????????????????????????????????????? rite::t_output(HPHP::String const&, HPHP::String const&, int)':
ext_imagesprite.cpp:(.text+0x4d29): undefined reference to `gdImageJpegPtr'
../../bin/libhphp_runtime.a(ext_imagesprite.cpp.o): In function `HPHP::ImageSpri???????????????????????????????????????????????????????????????????????????? te::Image::load_data_to_gd(int, void const*)':
ext_imagesprite.cpp:(.text+0x536e): undefined reference to `gdImageCreateFromJpe???????????????????????????????????????????????????????????????????????????? gPtr'
collect2: ld 返回 1
make[2]: *** [src/hphp/hphp] 错误 1
make[1]: *** [src/hphp/CMakeFiles/hphp.dir/all] 错误 2
make: *** [all] 错误 2





删除CMakeCache.txt,重新cmake .


yum install python-devel.x86_64








--------------------- gd 安装

mkdir /usr/local/modules
#jpeg目录
mkdir /usr/local/modules/jpeg6
mkdir /usr/local/modules/jpeg6/bin
mkdir /usr/local/modules/jpeg6/lib
mkdir /usr/local/modules/jpeg6/include
mkdir /usr/local/modules/jpeg6/man
mkdir /usr/local/modules/jpeg6/man/man1

a.zlib (看来zlib停止升级了,到现在还是2005年发布的一个东东)
# wget http://www.zlib.net/zlib-1.2.5.tar.gz //下载
# tar zxvf zlib-1.2.5.tar.gz //解压
# cd zlib-1.2.5 //改变目录
# CFLAGS=”-O3 -fPIC” ./configure?? //使用64位 的方法进行编译 (一般只需要./configure)
# make
# make install

b.FreeType
# wget http://downloads.sourceforge.net/freetype/freetype-2.3.5.tar.gz?modtime=1183336047&big_mirror=0 //下载
# tar zxvf freetype-2.3.5.tar.gz //解压
# cd freetype-2.3.5 //改变目录
# ./configure -prefix=/usr/local/modules/freetype? //配置
# make //编译
# make install //安装

c.Libpng

# wget http://prdownloads.sourceforge.net/libpng/libpng-1.2.8-config.tar.gz?download //下载
# tar zxvf libpng-1.2.8-config.tar.gz //解压
# cd libpng-1.2.8-config //改变目录

注意:首先看有没有装libtool (whereis libtool),没有就需要yum install libtool.
# ./configure //配置
# make //编译
# make install //安装

64位的机器这样搞
cp /usr/share/libtool/config.sub .
cp /usr/share/libtool/config.guess .
./configure –enable-shared –enable-static
make
make install

d.jpeg
# wget http://www.ijg.org/files/jpegsrc.v8b.tar.gz //下载
# tar jpegsrc.v8b.tar.gz //解压
# cd jpeg-8b //改变目录
# ./configure -prefix=/usr/local/modules/jpeg6 -enable-shared -enable-static? //配置
# make //编译
# make install? //安装

e.GD
# wget http://www.boutell.com/gd/http/gd-2.0.33.tar.gz //下载
# tar xzvf gd-2.0.33.tar.gz //解压
# cd gd-2.0.33 //改变目录
# ./configure -prefix=/usr/local/gd -with-jpeg=/usr/local/modules/jpeg6 -with-png=/usr/local/libpng -with-zlib -with-freetype=/usr/local/modules/freetype? //配置
# make //编译
# make install? //安装

cp -rf libgd.so libgd.so.2 libgd.so.2.0.0 /usr/local/lib64/
cp -rf libgd.so libgd.so.2 libgd.so.2.0.0 /usr/lib64/
cp -rf libgd.so libgd.so.2 libgd.so.2.0.0 /usr/lib/









/usr/bin/ld: warning: libcrypto.so.6, needed by /usr/local/lib/libc-client.so, may conflict with libcrypto.so.10
/usr/bin/ld: warning: libssl.so.6, needed by /usr/local/lib/libc-client.so, may conflict with libssl.so.10
[100%] Built target test

yum whatprovides "*/*libcrypto.so*"



经查,发现是运行机器的libcrypto.so版本太高,是libcrypto.so.6,而ldd显示nginx依赖的是libcrypto.so.4
于是,在对应的/lib64目录下建个libcrypto.so.4的软链接就可以了








/usr/bin/ld: warning: libcrypto.so.10, needed by /usr/lib64/mysql/libmysqlclient_r.so, may conflict with libcrypto.so.6

/usr/bin/ld: warning: libcrypto.so.10, needed by /usr/lib64/mysql/libmysqlclient_r.so, may conflict with libcrypto.so.6

?

?

?

?

?

?

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
php怎么把负数转为正整数php怎么把负数转为正整数Apr 19, 2022 pm 08:59 PM

php把负数转为正整数的方法:1、使用abs()函数将负数转为正数,使用intval()函数对正数取整,转为正整数,语法“intval(abs($number))”;2、利用“~”位运算符将负数取反加一,语法“~$number + 1”。

php怎么实现几秒后执行一个函数php怎么实现几秒后执行一个函数Apr 24, 2022 pm 01:12 PM

实现方法:1、使用“sleep(延迟秒数)”语句,可延迟执行函数若干秒;2、使用“time_nanosleep(延迟秒数,延迟纳秒数)”语句,可延迟执行函数若干秒和纳秒;3、使用“time_sleep_until(time()+7)”语句。

php怎么除以100保留两位小数php怎么除以100保留两位小数Apr 22, 2022 pm 06:23 PM

php除以100保留两位小数的方法:1、利用“/”运算符进行除法运算,语法“数值 / 100”;2、使用“number_format(除法结果, 2)”或“sprintf("%.2f",除法结果)”语句进行四舍五入的处理值,并保留两位小数。

php怎么根据年月日判断是一年的第几天php怎么根据年月日判断是一年的第几天Apr 22, 2022 pm 05:02 PM

判断方法:1、使用“strtotime("年-月-日")”语句将给定的年月日转换为时间戳格式;2、用“date("z",时间戳)+1”语句计算指定时间戳是一年的第几天。date()返回的天数是从0开始计算的,因此真实天数需要在此基础上加1。

php怎么判断有没有小数点php怎么判断有没有小数点Apr 20, 2022 pm 08:12 PM

php判断有没有小数点的方法:1、使用“strpos(数字字符串,'.')”语法,如果返回小数点在字符串中第一次出现的位置,则有小数点;2、使用“strrpos(数字字符串,'.')”语句,如果返回小数点在字符串中最后一次出现的位置,则有。

php字符串有没有下标php字符串有没有下标Apr 24, 2022 am 11:49 AM

php字符串有下标。在PHP中,下标不仅可以应用于数组和对象,还可应用于字符串,利用字符串的下标和中括号“[]”可以访问指定索引位置的字符,并对该字符进行读写,语法“字符串名[下标值]”;字符串的下标值(索引值)只能是整数类型,起始值为0。

php怎么替换nbsp空格符php怎么替换nbsp空格符Apr 24, 2022 pm 02:55 PM

方法:1、用“str_replace(" ","其他字符",$str)”语句,可将nbsp符替换为其他字符;2、用“preg_replace("/(\s|\&nbsp\;||\xc2\xa0)/","其他字符",$str)”语句。

php怎么查找字符串是第几位php怎么查找字符串是第几位Apr 22, 2022 pm 06:48 PM

查找方法:1、用strpos(),语法“strpos("字符串值","查找子串")+1”;2、用stripos(),语法“strpos("字符串值","查找子串")+1”。因为字符串是从0开始计数的,因此两个函数获取的位置需要进行加1处理。

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)