PHP安装 PHP 5.1.6 for CentOS 4.3 X86_64 配置

PHP 5.1.6 for CentOS 4.3 X86_64 配置

./configure –with-apxs2=/usr/local/apache2/bin/apxs –with-libxml-dir –with-ipenssl –with-zlib –enable-bcmath –with-bz2 –enable-calendar –with-curl –with-curlwrappers –enable-exif –enable-ftp –with-gettext –with-mysql –with-mysqli –with-oci8=/u01/oracle/10.2.0/db_1/ –enable-soap –enable-sockets –with-iconv –with-libdir=lib64 –with-gd –with-jpeg-dir –with-png-dir –enable-xslt –with-xslt-sablot=/usr/local/sablot/lib –prefix=/usr/local/php5 –with-pgsql –enable-mbstring=all –enable-mbstr-enc-trans –enable-mbregex –with-pdo-mysql –with-pdo-sqlite –with-pdo-pqsql
包含ORACLE,MYSQL,POSTGRESQL,SQLITE,PDO等支持
X86_64的支持关键在于–with-libdir=lib64这句
(with-libdir=lib64小心使用,上次俺在这上面花了一天时间,晕)

 

下面这段是修正后的 php5.2.5 mysql5.0.22 (注意在一台服务器上装了两个mysql,一个版本为4一个为5,所以下面会出现类似mysql5的东西 –with-freetype-dir=/usr/include/freetype2/freetype 表示2.x系列的freetype,开始没带这个参数,我的机器是1.x系列的,弄得phpMyVisites的图表中文字全是黄色,看都看不清楚.)
./configure –with-apxs2=/usr/local/apache2/bin/apxs –with-libxml-dir –with-ipenssl –with-zlib –enable-bcmath –with-bz2 –enable-calendar –with-curl –with-curlwrappers –enable-exif –enable-ftp –with-gettext –with-mysql=/usr/local/mysql5 –enable-soap –enable-sockets –with-iconv –with-gd –with-ttf –with-freetype –with-freetype-dir=/usr/include/freetype2/freetype –with-jpeg-dir –with-png-dir –enable-xslt –prefix=/usr/local/php5 –with-pgsql=/usr/local/pgsql –enable-mbstring=all –enable-mbstr-enc-trans –enable-mbregex –with-pdo-mysql=/usr/local/mysql5 –with-pdo-sqlite –with-pdo-pqsql

 

 

注意:由于我第一次安装的时候未指定–with-freetype 这个参数,导致出现 Call to undefined function imagettfbbox 这个错误提示,后来我将–with-freetype  带上了再make make install,发现还是不行,在Baidu上搜了一下,没找到正确答案,然后再Google搜了一下,哈哈,原来是由于要先 make clean ,晕,还有这号事情,这次是老外帮了我的忙,下面发上他们对这个问题的对话.

Member
 

Registered: Aug 2003
Location: USA
Distribution: Slackware 12.0 RC1
Posts: 129

PHP Call to undefined function imagettfbbox()

Ok, here’s the situation. I’ve compiled and installed Apache2 and PHP 5 on my Slackware 10 machine. I compiled with GD support. All of the GD functions seem to work until I get to the TTF related ones.

So, first I checked php.net. It said I needed FreeType 1 and/or 2, jpeg, png, xpm, and zlib. Well, I already compiled those in without any configure/make warnings/errors.

On to google. It seems many people are having the same issue, and none have had it resolved, as far as I could tell.

Here’s my config (from config.nice):

Code:
'./configure' \
'--with-mysql=/usr/local/mysql' \
'--with-apxs2=/usr/local/apache2/bin/apxs' \
'--with-curl' \
'--enable-ftp' \
'--with-pspell' \
'--enable-sockets' \
'--with-pdflib' \
'--with-gd' \
'--with-jpeg-dir' \
'--with-png-dir' \
'--with-zlib-dir' \
'--with-ttf' \
'--enable-gd-native-ttf' \
'--with-freetype-dir' \
'--with-xpm-dir=/usr/X11R6' \

Yes, I know I haven’t specified dirs on several options like jpeg and png, but as shown by the following output of print_r(gd_info()), PHP used the defaults and they worked just fine.

Code:
Array
(
    [GD Version] => bundled (2.0.28 compatible)
    [FreeType Support] => 
    [T1Lib Support] => 
    [GIF Read Support] => 1
    [GIF Create Support] => 1
    [JPG Support] => 1
    [PNG Support] => 1
    [WBMP Support] => 1
    [XPM Support] => 
    [XBM Support] => 1
    [JIS-mapped Japanese Font Support] => 
)

However, notice XPM and FreeType. They are not enabled. This is obviously why PHP can’t find imagettfbbox(). FreeType isn’t even enabled! I’ve made sure all the necessary libs and includes are installed on my machine. I’ve tried several different paths for the config options like –with-xpm-dir=/usr/X11R6/lib or –with-freetype-dir=/usr/include/freetype2/freetype but to no avail. I have exhausted every possible path to libs and includes I could find for each option — and of course, configure never complained.

I’m beginning to think it’s an issue of versions, but I don’t know for sure.

I should go through config.log for more info, but since it’s past midnight and I’m exhausted, I thought I’d let someone else do the thinking for a while. 🙂

Any help is GREATLY appreciated!!

QtCoder is offline     Reply With Quote

Old 02-13-2005, 04:58 AM   #2
Senior Member
 

Registered: Mar 2004
Distribution: Slackware-current
Posts: 3,655

Did you try :
./configure … … –with-freetype –with-freetype-dir=/usr/lib …

keefaz is offline     Reply With Quote

Old 02-13-2005, 02:54 PM   #3
Member
 

Registered: Aug 2003
Location: USA
Distribution: Slackware 12.0 RC1
Posts: 129

Yep, I already tried that. However, one thought occurred to me. I am beginning to think the gd package I got from linuxpackages.net didn’t have freetype support compiled in. I’m compiling it now with freetype and I’ll point php to the new install location to see if my idea is right.


Last edited by QtCoder : 02-14-2005 at 03:41 PM.

QtCoder is offline     Reply With Quote

Old 02-13-2005, 03:31 PM   #4
Member
 

Registered: Aug 2003
Location: USA
Distribution: Slackware 12.0 RC1
Posts: 129

Scrap that idea. Moving on to others…

QtCoder is offline     Reply With Quote

Old 02-13-2005, 06:36 PM   #5
Senior Member
 

Registered: Mar 2004
Distribution: Slackware-current
Posts: 3,655

With php > 4.3 it is advised to use its built-in gd support

Also did you try :
–with-freetype-dir=/usr/include/freetype2/freetype

keefaz is offline     Reply With Quote

Old 02-14-2005, 03:38 PM   #6
Member
 

Registered: Aug 2003
Location: USA
Distribution: Slackware 12.0 RC1
Posts: 129

Well, my first attempts at compiling PHP with GD involved using the bundled GD version. It worked except for freetype. Then I tried the separate one from linuxpackages.net, and finally a self-compiled one. Each worked with the exception of freetype support.

I have tried ‘–with-freetype-dir=/usr/include/freetype2/freetype’ but it didn’t work.

This just doesn’t make sense to me. Configure indicates that FreeType was found, as well as XPM. During the compilation, I can see the -lfreetype and -lXpm switches and there are no warnings or errors that they don’t exist. Make completes perfectly, and yet neither xpm nor freetype shows up in phpinfo() or gd_info().

Any other suggestions?

QtCoder is offline     Reply With Quote

Old 02-14-2005, 06:54 PM   #7
Senior Member
 

Registered: Mar 2004
Distribution: Slackware-current
Posts: 3,655

I suppose you already tried ‘ –with-freetype-dir=/usr ‘, when you test php do you restart apache each time ?

keefaz is offline     Reply With Quote

Old 02-14-2005, 07:35 PM   #8
Member
 

Registered: Aug 2003
Location: USA
Distribution: Slackware 12.0 RC1
Posts: 129

Yes to both. I’ve even restarted my machine just to reload everything.

I think I’ll watch some TV for a while, stuff my face, and let my mind wander for a while. Maybe I’ll have one of those “Oh, of course!” moments.

QtCoder is offline     Reply With Quote

Old 02-15-2005, 02:06 PM   #9
Member
 

Registered: Aug 2003
Location: USA
Distribution: Slackware 12.0 RC1
Posts: 129

Yes!! I got it working… but I did something I shouldn’t have to do (afaik). I ran ‘make clean’ before re-compiling. Shouldn’t it automatically detect which files need to be recompiled and compile them?

Anyway, I’m glad it’s working. I can finally go back to business as usual!

Thanks for the input.

QtCoder is offline     Reply With Quote

Old 04-27-2005, 12:05 PM   #10
Member
 

Registered: Jan 2004
Distribution: Fedora Core 4
Posts: 30

Quote:
Originally posted by QtCoder
Yes!! I got it working… but I did something I shouldn’t have to do (afaik). I ran ‘make clean’ before re-compiling. Shouldn’t it automatically detect which files need to be recompiled and compile them?

Anyway, I’m glad it’s working. I can finally go back to business as usual!

Thanks for the input.

Woohoo! Thanks for posting this. I was having the same problem, except with JPG support. make clean fixed it right up

Ryand833 is offline     Reply With Quote

Old 07-31-2005, 06:56 AM   #11
Newbie
 

Registered: Nov 2004
Location: Poland
Distribution: Slackware – best and only ;]
Posts: 29

Oh yeah! Make clean! It works
Sorry for posting in old topic but I had to express my joy.

Barca is offline     Reply With Quote

Old 08-17-2005, 06:26 AM   #12
Newbie
 

Registered: Aug 2005
Posts: 1

Talking Thank God

I’ve been pulling my hair out with this shit – check my version of gd and freetype

recompiled php like 50 time and then we have

make clean which saves the day

thanx alot for this post really help

soan is offline     Reply With Quote

Old 09-20-2006, 06:18 AM   #13
Newbie
 

Registered: Sep 2006
Distribution: Fedora or Suse
Posts: 1

Thumbs up

Make Clean!!!

I was having the same problem!!!
Now it works: Many thx!!!

Santrino is offline     Reply With Quote

Old 09-24-2006, 02:29 PM   #14
Newbie
 

Registered: Sep 2006
Location: Costa Rica
Distribution: GNU/Linux – Umbuntu Debian (Dapper)
Posts: 1

Talking Make Clean Saves the Day!

soan:
“I’ve been pulling my hair out with this shit – check my version of gd and freetype

recompiled php like 50 time…”

Totally man.. I was about ready to install umbuntu again..
btw, my problem was with the imagettfbbox() .. recompiled about
51 times.. (hahaha) and with make clean, it did the trick.

thanks guys!

p.s. I hope this thing doesn’t show i’m on a winblows box… (currently running umbuntu debian on my lapytopy..) anybody got an idea how to install the default software modem from a toshiba satelite model A75-S125?

留下评论

您的电子邮箱地址不会被公开。 必填项已用 * 标注

28 − = 19