473,692 Members | 2,131 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 38141
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********@gmai l.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,dem oout.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:11 5: 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
`gdFreeFontCach e'
*** 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_err or':
/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********@gmai l.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
2154
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
2185
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? XSL support? Will they have XML support at all? If anyone can give us an idea for what the typical PHP enviroment will be, we can make sensible descisions about the trade off between the number of users who will be able to use the software, and the...
188
8434
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 2.4 installer for windows. Now I have problems to compile python extension that some packages
4
466
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 Files\ssrpttest\44d149b5\fdee4a07\c22wlbzl.dll' -- 'Access is denied. ' I just upgraded to visual studio .net 2003 and now none of my applications wil work!
5
4807
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 ULONG_LONG_MAX
2
3307
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 - Win32 Debug-------- ------------ Compiling... pp.cpp c:\program files\microsoft visual studio\vc98
6
2851
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 fine while the file was in the project directory. When the obsolete file was removed from the project directory, my application will no longer compile. Can someone please help with this issue? Thank in advance, Tom
1
2048
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 error: Make sure that the class defined in this code file matches the 'inherits' attribute, and that it extends the correct base class (e.g. Page or UserControl). It is referring to "LoginBanner" on the first line of the code below. public...
3
3544
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 compiler line from the output window during complication: Target CoreCompile: C:\WINDOWS\Microsoft.NET\Framework\v3.5\Csc.exe /noconfig /nowarn:1701,1702 /platform:x86 /errorreport:prompt /warn:4 /define:DEBUG;TRACE /main:AutoDeveloper.Program...
27
5597
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 --
0
9079
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8954
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8794
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8796
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6458
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5817
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4322
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2234
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1955
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.