473,378 Members | 1,138 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

how to compile PHP with GD support?

Hello there,
I am tryin to compile PHP with GD support:

# cd php-4.3.11
# ./configure \
--with-gd=/usr/local/src/gd-2.0.33/ \
--with-png-dir=/usr/local/src/libpng-1.2.8/ \
--with-zlib-dir=/usr/local/src/zlib/ \
--with-jpeg-dir=/usr/local/src/jpeg-6b/

....
checking for GD support... yes
checking for the location of libpng... /usr/local/src/libpng-1.2.8/
If configure fails try --with-jpeg-dir=<DIR>
configure: error: libpng.(a|so) not found.

why libpng.(a|so) not found ?

# ls -l /usr/local/src/libpng-1.2.8/libpng.a
-rw-r--r-- 1 root wheel 160448 May 31 12:48
/usr/local/src/libpng-1.2.8/libpng.a

What is my mistake? Where to read about correct way for installing php
+ gd + libjpeg + libpng ?

Jul 17 '05 #1
6 38119
Encapsulin,
checking for the location of libpng... /usr/local/src/libpng-1.2.8/
If configure fails try --with-jpeg-dir=<DIR>
configure: error: libpng.(a|so) not found.

why libpng.(a|so) not found ?

# ls -l /usr/local/src/libpng-1.2.8/libpng.a
-rw-r--r-- 1 root wheel 160448 May 31 12:48
/usr/local/src/libpng-1.2.8/libpng.a

What is my mistake? Where to read about correct way for installing php
+ gd + libjpeg + libpng ?


You may wish to check the PHP manual:
http://us3.php.net/manual/en/ref.image.php

If it doesn't find libpng, libjpeg or libxpm it can fail.
You may wish to specify the directory...
--with-jpeg-dir=DIR --with-png-dir=DIR --with-xpm-dir=DIR

Also note that libpng requires the zlib library :) so you may need to
add --with-zlib-dir=DIR

Hope that helps.

Mike
Jul 17 '05 #2
ljb
en********@gmail.com wrote:
Hello there,
I am tryin to compile PHP with GD support:

# cd php-4.3.11
# ./configure \
--with-gd=/usr/local/src/gd-2.0.33/ \
--with-png-dir=/usr/local/src/libpng-1.2.8/ \
--with-zlib-dir=/usr/local/src/zlib/ \
--with-jpeg-dir=/usr/local/src/jpeg-6b/

...
checking for GD support... yes
checking for the location of libpng... /usr/local/src/libpng-1.2.8/
If configure fails try --with-jpeg-dir=<DIR>
configure: error: libpng.(a|so) not found.

why libpng.(a|so) not found ?

# ls -l /usr/local/src/libpng-1.2.8/libpng.a
-rw-r--r-- 1 root wheel 160448 May 31 12:48
/usr/local/src/libpng-1.2.8/libpng.a

What is my mistake? Where to read about correct way for installing php
+ gd + libjpeg + libpng ?


If you say --with-png-dir=X, then PHP configure will look for
"X/lib/libpng.a" or "X/lib/libpng.so" (or whatever replaces .so on
your platform). Note the "/lib/" that gets inserted after your path.
Configure expects a certain directory structure where lib/ and include/
directories can be found under a common root ("X") directory. With
your setup, that won't work. You probably should actually install the
libraries (zlib, libpng, jpeg).
Jul 17 '05 #3
Ok, thank you all for your comments,
but i still not shure, what is wrong.

I have read http://us3.php.net/manual/en/ref.image.php
that manual said, that GD supports GIF by default. Ok, let me start
with gifs:

1) compilling GD:

# cd /usr/local/src/gd-2.0.33
# env CPPFLAGS="-I../zlib -I../libpng-1.2.8" LDFLAGS="-L../zlib
-L../libpng-1.2.8"
\
../configure --disable-shared --without-freetype --without-jpeg
# make
# cp .libs/* .
# ./gddemo
(gddemo generates demoout.gif,demoout.png, so, GD is compilled and
works)

2) compilling php:

# cd /usr/local/src/php-4.3.9
# ./configure \
--with-gd=/usr/local/src/gd-2.0.33
--with-apxs=/usr/local/apache/bin/apxs --with
-mysql
# make

ext/mysql/libmysql/my_tempnam.lo: In function `my_tempnam':
/usr/local/src/php-4.3.9/ext/mysql/libmysql/my_tempnam.c:115: warning:
tempnam() possibly used unsafely; consider using mkstemp()
ext/gd/gd.lo: In function `zm_deactivate_gd':
/usr/local/src/php-4.3.9/ext/gd/gd.c:390: undefined reference to
`gdFreeFontCache'
*** Error code 1

Stop in /usr/local/src/php-4.3.9.

What is wrong now?
Many thanks.

Jul 17 '05 #4
Well, i have read
http://www.onlamp.com/pub/a/php/2003/03/27/php_gd.html

And now i have GD (png,gif) with my php engine, but jpeg still not
supported:

1)compiling jpeg lib:
# cd /usr/local/src/jpeg-6b
# ./configure --prefix=/usr && make && make install

2) compiling php:
# cd /usr/local/src/php-4.3.9
# ./configure --with-gd --with-zlib-dir=/usr/include
--with-apxs=/usr/local/apache/bin/apxs --with-
mysql --with-jpeg-dir=../jpeg-6b
# make clean && make && make install

/usr/local/src/php-4.3.9/ext/gd/libgd/gd_jpeg.c:42:21: jpeglib.h: No
such file or directory
/usr/local/src/php-4.3.9/ext/gd/libgd/gd_jpeg.c:43:20: jerror.h: No
such file or directory
/usr/local/src/php-4.3.9/ext/gd/libgd/gd_jpeg.c:53: error: syntax error
before "cinfo"
/usr/local/src/php-4.3.9/ext/gd/libgd/gd_jpeg.c: In function
`fatal_jpeg_error':
/usr/local/src/php-4.3.9/ext/gd/libgd/gd_jpeg.c:58: error: `cinfo'
undeclared (first use in this function)
....
/usr/local/src/php-4.3.9/ext/gd/libgd/gd_jpeg.c:764: error: `outfile'
undeclared (first use in this function)
*** Error code 1

Stop in /usr/local/src/php-4.3.9.

Jul 17 '05 #5
ljb
en********@gmail.com wrote:
Well, i have read
http://www.onlamp.com/pub/a/php/2003/03/27/php_gd.html

And now i have GD (png,gif) with my php engine, but jpeg still not
supported:

1)compiling jpeg lib:
# cd /usr/local/src/jpeg-6b
# ./configure --prefix=/usr && make && make install

2) compiling php:
# cd /usr/local/src/php-4.3.9
# ./configure --with-gd --with-zlib-dir=/usr/include
--with-apxs=/usr/local/apache/bin/apxs --with-
mysql --with-jpeg-dir=../jpeg-6b
# make clean && make && make install

/usr/local/src/php-4.3.9/ext/gd/libgd/gd_jpeg.c:42:21: jpeglib.h: No
such file or directory


You have to point your PHP configure to where the jpeg library got
installed, not where it was built (so it can find headers and such).
Try: --with-jpeg-dir=/usr

Jul 17 '05 #6
hello guys. where can i find more information on simply learning how
to configure. i'm reading through php manual as i'm trying to get gd
installed with jpep support. however, i'm not sure what i'm doing.
i've gone through a few sites with incomplete details. my system was
built buth php 4.2.2 as the default. i can't even find the directory.
any help is greatly appreciated. thanks.

Jul 17 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: paul dallaire | last post by:
I have some PHP files that need to be compile with MySQL support How do we do this?. I am using IIS 5.1 and I installed MySQL 4.1 Server 4.1 as a Development system. Paul
1
by: davmonster | last post by:
Hello, I am trying to write a server-side PHP application that will be eventually open-sourced. We want to know what a typical distribution of PHP has compiled in. Will they have DOM support?...
188
by: Ilias Lazaridis | last post by:
I'm a newcomer to python: - E01: The Java Failure - May Python Helps? http://groups-beta.google.com/group/comp.lang.python/msg/75f0c5c35374f553 - I've download (as suggested) the python...
4
by: Vince | last post by:
I'm getting this message when I try and run a .net web app in the development system: CS0016: Could not write to output file 'c#:\windows nt\Microsoft..net framework\v1.1.4322\Temporary ASP.NET...
5
by: Mark Shelor | last post by:
Problem: find a portable way to determine whether a compiler supports the "long long" type of C99. I thought I had this one solved with the following code: #include <limits.h> #ifdef...
2
by: Gustavo | last post by:
After updating Windows 2000 I began to get a weird compile error message: Deleting intermediate files and output files for project 'pp - Win32 Debug'. --------------------Configuration: pp -...
6
by: Thomas Connolly | last post by:
I have 2 pages referencing the same codebehind file in my project. Originally the pages referenced separate code behind files. Once I changed the reference to the same file, everything worked...
1
by: Larry Epn | last post by:
I've created a project from Microsoft's "club.vsi". I don't want inline code so I've separated all aspx and ascx pages into code-behind pages. I'm compiling the project and continue to get this...
3
by: =?Utf-8?B?QWxleGFuZGVyIFd5a2Vs?= | last post by:
My application is taking way too long to build. It use to never take so long. I change only line and I think it recompiles all the classes in the assembly because it hangs forever. Here is the...
27
by: CodeMonk3y | last post by:
gotta question on sizeof keyword does the sizeof keyword calcuates the size at compile time or run time ?? -- Posted on news://freenews.netfront.net - Complaints to news@netfront.net --
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.