php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33745 Errors compiling on x86_64 platform
Submitted: 2005-07-18 12:13 UTC Modified: 2005-07-19 09:59 UTC
From: jap1968 at yahoo dot es Assigned:
Status: Not a bug Package: Compile Failure
PHP Version: 5.0.4 OS: Fedora Core 4
Private report: No CVE-ID: None
 [2005-07-18 12:13 UTC] jap1968 at yahoo dot es
Description:
------------
I am having a lot of problems when trying to compile PHP on a Fedora Core 4 (x86_64) just out of the box.

They seem to be related to problems in finding the 64bit versions of the libraries

Initially I had problems to compile with MySQL support, but those where solved adding
  LDFLAGS=' -L/usr/lib64/mysql'
when launching the '.configure' command. Then, manually replacing '-L/usr/lib/mysql' with '-L/usr/lib64/mysql' when running the libtool command (just at the end of the 'make' process).

With these changes I can compile PHP with MySQL both in 64 bit version, but I am having a similar problem compiling with the graphic library GD (--wityh-gd) and even telling explicitly the path of the 64 bit libraries, it always complain about not finding the libraries.

As I told before, Is a FC4-x86_64 distro just installed, 'out of the box' without any changes.

Reproduce code:
---------------
LDFLAGS=' -L/usr/lib64 -L/usr/lib64/mysql' ./configure \
  --with-apxs2=/usr/sbin/apxs \
  --with-config-file-path=/etc \
  --with-zlib \
  --without-sqlite \
  --with-gd \
  --with-jpeg-dir=/usr/lib64 \
  --with-png-dir=/usr/lib64


Expected result:
----------------
Makefile created!

Actual result:
--------------
checking for GD support... yes
checking for the location of libjpeg... /usr/lib64
checking for the location of libpng... /usr/lib64
..
configure: error: libjpeg.(a|so) not found.

Note: Both, libjpeg.a and libjpeg.so are located on my /usr/lib64 directory

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-07-18 12:15 UTC] tony2001@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip


 [2005-07-18 14:57 UTC] jap1968 at yahoo dot es
I have just the same behaviour using the CVS (php5-200507181030) version.

If you have a look to the lines 2874..2880 of the configure script, you'll see:

# Check whether --with-libdir or --without-libdir was given.
if test "${with_libdir+set}" = set; then
  withval="$with_libdir"
  q=$withval
else
  PHP_LIBDIR=lib
fi

The PHP_LIBDIR var is set to 'lib' by default. So the solution is execute the configure script with an additional parameter:

./configure --with-libdir=lib64 ...

Could the configure script be modified in such way that it does some kind of test as that?

  if uname -m == x86_64 then PHP_LIBDIR=lib64

Sorry, but I'm not very familiar with the shell scripting syntax.

With the additional parameter it seems to work, but I have to recompile some other modules to place their compiled libs in 'lib64' instead of 'lib' (as they do right now) to do a test with all the modules which I need in my PHP.
 [2005-07-18 18:43 UTC] sniper@php.net
When you want to compile 32bit binary, the libs are supposed to be under /lib, when you compile 64bit binary they're supposed to be under /lib64. Just use the option, that's what it's there for. (no, we're not going to add any magical detection for this)

 [2005-07-19 09:59 UTC] jap1968 at yahoo dot es
Now I have recompiled my other modules (freeTDS) generating libs in 'lib64' (As you should have noticed, this is my first time working on a 64 bit platform).

Using the option '--with-libdir=lib64' works right in the CVS version, but fails in the 5.0.4 version when trying to include the gd library (it still complains about libpng not found).

Even on the CVS version, there is a minor problem with the location of zlib: You must tell either '--with-zlib' or '--with-zlib-dir=/usr/lib64'. Otherwise, if you let the script search zlib (required by libpng, from gd) it is not able to find the library, even being on the same dir (/usr/lib64) as the rest of the libraries.

So, I have finally been able to compile (The CVS version, not the 5.0.4) PHP with this configuration:

./configure \
  --with-libdir=lib64 \
  --with-apxs2=/usr/sbin/apxs \
  --with-config-file-path=/etc \
  --with-gd \
  --with-zlib \
  --with-mssql=/usr/local/freetds \
  --without-sqlite \
  --with-mysql \
  --enable-ftp \
  --enable-sockets
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri Aug 15 19:00:03 2025 UTC