백엔드 개발 PHP 튜토리얼 hiphop-php【未能顺利编译YII】

hiphop-php【未能顺利编译YII】

Jun 13, 2016 am 10:30 AM
file php usr

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

?

?

?

?

?

?

본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.

핫 AI 도구

Undresser.AI Undress

Undresser.AI Undress

사실적인 누드 사진을 만들기 위한 AI 기반 앱

AI Clothes Remover

AI Clothes Remover

사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool

Undress AI Tool

무료로 이미지를 벗다

Clothoff.io

Clothoff.io

AI 옷 제거제

AI Hentai Generator

AI Hentai Generator

AI Hentai를 무료로 생성하십시오.

인기 기사

R.E.P.O. 에너지 결정과 그들이하는 일 (노란색 크리스탈)
4 몇 주 전 By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. 최고의 그래픽 설정
4 몇 주 전 By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. 아무도들을 수없는 경우 오디오를 수정하는 방법
4 몇 주 전 By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25 : Myrise에서 모든 것을 잠금 해제하는 방법
1 몇 달 전 By 尊渡假赌尊渡假赌尊渡假赌

뜨거운 도구

메모장++7.3.1

메모장++7.3.1

사용하기 쉬운 무료 코드 편집기

SublimeText3 중국어 버전

SublimeText3 중국어 버전

중국어 버전, 사용하기 매우 쉽습니다.

스튜디오 13.0.1 보내기

스튜디오 13.0.1 보내기

강력한 PHP 통합 개발 환경

드림위버 CS6

드림위버 CS6

시각적 웹 개발 도구

SublimeText3 Mac 버전

SublimeText3 Mac 버전

신 수준의 코드 편집 소프트웨어(SublimeText3)

Ubuntu 및 Debian용 PHP 8.4 설치 및 업그레이드 가이드 Ubuntu 및 Debian용 PHP 8.4 설치 및 업그레이드 가이드 Dec 24, 2024 pm 04:42 PM

PHP 8.4는 상당한 양의 기능 중단 및 제거를 통해 몇 가지 새로운 기능, 보안 개선 및 성능 개선을 제공합니다. 이 가이드에서는 Ubuntu, Debian 또는 해당 파생 제품에서 PHP 8.4를 설치하거나 PHP 8.4로 업그레이드하는 방법을 설명합니다.

PHP 개발을 위해 Visual Studio Code(VS Code)를 설정하는 방법 PHP 개발을 위해 Visual Studio Code(VS Code)를 설정하는 방법 Dec 20, 2024 am 11:31 AM

VS Code라고도 알려진 Visual Studio Code는 모든 주요 운영 체제에서 사용할 수 있는 무료 소스 코드 편집기 또는 통합 개발 환경(IDE)입니다. 다양한 프로그래밍 언어에 대한 대규모 확장 모음을 통해 VS Code는

PHP에서 HTML/XML을 어떻게 구문 분석하고 처리합니까? PHP에서 HTML/XML을 어떻게 구문 분석하고 처리합니까? Feb 07, 2025 am 11:57 AM

이 튜토리얼은 PHP를 사용하여 XML 문서를 효율적으로 처리하는 방법을 보여줍니다. XML (Extensible Markup Language)은 인간의 가독성과 기계 구문 분석을 위해 설계된 다목적 텍스트 기반 마크 업 언어입니다. 일반적으로 데이터 저장 AN에 사용됩니다

이전에 몰랐던 후회되는 PHP 함수 7가지 이전에 몰랐던 후회되는 PHP 함수 7가지 Nov 13, 2024 am 09:42 AM

숙련된 PHP 개발자라면 이미 그런 일을 해왔다는 느낌을 받을 것입니다. 귀하는 상당한 수의 애플리케이션을 개발하고, 수백만 줄의 코드를 디버깅하고, 여러 스크립트를 수정하여 작업을 수행했습니다.

JWT (JSON Web Tokens) 및 PHP API의 사용 사례를 설명하십시오. JWT (JSON Web Tokens) 및 PHP API의 사용 사례를 설명하십시오. Apr 05, 2025 am 12:04 AM

JWT는 주로 신분증 인증 및 정보 교환을 위해 당사자간에 정보를 안전하게 전송하는 데 사용되는 JSON을 기반으로 한 개방형 표준입니다. 1. JWT는 헤더, 페이로드 및 서명의 세 부분으로 구성됩니다. 2. JWT의 작업 원칙에는 세 가지 단계가 포함됩니다. JWT 생성, JWT 확인 및 Parsing Payload. 3. PHP에서 인증에 JWT를 사용하면 JWT를 생성하고 확인할 수 있으며 사용자 역할 및 권한 정보가 고급 사용에 포함될 수 있습니다. 4. 일반적인 오류에는 서명 검증 실패, 토큰 만료 및 대형 페이로드가 포함됩니다. 디버깅 기술에는 디버깅 도구 및 로깅 사용이 포함됩니다. 5. 성능 최적화 및 모범 사례에는 적절한 시그니처 알고리즘 사용, 타당성 기간 설정 합리적,

문자열로 모음을 계산하는 PHP 프로그램 문자열로 모음을 계산하는 PHP 프로그램 Feb 07, 2025 pm 12:12 PM

문자열은 문자, 숫자 및 기호를 포함하여 일련의 문자입니다. 이 튜토리얼은 다른 방법을 사용하여 PHP의 주어진 문자열의 모음 수를 계산하는 방법을 배웁니다. 영어의 모음은 A, E, I, O, U이며 대문자 또는 소문자 일 수 있습니다. 모음이란 무엇입니까? 모음은 특정 발음을 나타내는 알파벳 문자입니다. 대문자와 소문자를 포함하여 영어에는 5 개의 모음이 있습니다. a, e, i, o, u 예 1 입력 : String = "Tutorialspoint" 출력 : 6 설명하다 문자열의 "Tutorialspoint"의 모음은 u, o, i, a, o, i입니다. 총 6 개의 위안이 있습니다

PHP에서 늦은 정적 결합을 설명하십시오 (정적 : :). PHP에서 늦은 정적 결합을 설명하십시오 (정적 : :). Apr 03, 2025 am 12:04 AM

정적 바인딩 (정적 : :)는 PHP에서 늦은 정적 바인딩 (LSB)을 구현하여 클래스를 정의하는 대신 정적 컨텍스트에서 호출 클래스를 참조 할 수 있습니다. 1) 구문 분석 프로세스는 런타임에 수행됩니다. 2) 상속 관계에서 통화 클래스를 찾아보십시오. 3) 성능 오버 헤드를 가져올 수 있습니다.

php magic 방법 (__construct, __destruct, __call, __get, __set 등)이란 무엇이며 사용 사례를 제공합니까? php magic 방법 (__construct, __destruct, __call, __get, __set 등)이란 무엇이며 사용 사례를 제공합니까? Apr 03, 2025 am 12:03 AM

PHP의 마법 방법은 무엇입니까? PHP의 마법 방법은 다음과 같습니다. 1. \ _ \ _ Construct, 객체를 초기화하는 데 사용됩니다. 2. \ _ \ _ 파괴, 자원을 정리하는 데 사용됩니다. 3. \ _ \ _ 호출, 존재하지 않는 메소드 호출을 처리하십시오. 4. \ _ \ _ get, 동적 속성 액세스를 구현하십시오. 5. \ _ \ _ Set, 동적 속성 설정을 구현하십시오. 이러한 방법은 특정 상황에서 자동으로 호출되어 코드 유연성과 효율성을 향상시킵니다.

See all articles