BuildSmart <buildsmart <at> daleenterprise.com> writes:
This tells me you were not in the php source directory where
you issued the configure and make commands.
You're building php in /tmp and not /usr/src.
Yes. It worked for all software exceprt PHP.
Let's back up even more since it's clear you're not entirely sure
what your doing so lets try using a schema in the build process so
you will be in the correct directory and I will also know where you
should be and will be.
Place the uncompressed php source in the drive root.
mkdir -p /SourceCache/tarball
Copy or move the php source tarball to the /SourceCache/tarball directory.
cd /SourceCache
Use one of the following to expand the source
tar -xjvf tarball/php-5.2.5.tar.bz2; # this is for a .bz2 file
tar -xzvf tarball/php-5.2.5.tar.gz; # this is for a .gz file
cd /SourceCache/php-5.2.5
As I understand I need to put PHP source to this directory. I've unpacked PHP
source to:
/SourceCache/php-5.2.5
Your original configure command has conflict issues so here is
a cleaned up one.
Since it appears that your OS is 64bit savy apache may be running in
64bit mode and I believe the two arches required are i386 and x86_64
or i586 and x86_64 but of course this also depends on your gcc and how it was
compiled for your OS by whomever you get your packages from, I think you
can verify this by use of the "file" command.
file /usr/src/php-5.2.3/libs/libphp5.so; # <-- the working php module
And just for giggle check the one that doesn't work
file /tmp/php-5.2.3/libs/libphp5.so; # <-- the non-working php module
I've erased 5.2.3 directory. When I'm trying to run "file" for 5.2.5, I get this:
[root@fc php-5.2.5]# file /etc/httpd/modules/libphp5.so
/etc/httpd/modules/libphp5.so: ELF 64-bit LSB shared object, x86-64,
version 1 (SYSV), not stripped
HERE IS YOUR CONFIGURE COMMAND:
CFLAGS="-arch i386 -arch x86_64 -pipe -no-cpp-precomp" \
CCFLAGS="-arch i386 -arch x86_64 -pipe" \
CXXFLAGS="-arch i386 -arch x86_64 -pipe" \
LDFLAGS="-arch i386 -arch x86_64" \
./configure \
--build=x86_64-unknown-linux-gnu \
--host=x86_64-unknown-linux-gnu \
--target=x86_64-redhat-linux-gnu \
--cache-file=../config.cache \
--with-layout=GNU \
--with-apxs2=/usr/sbin/apxs \
--prefix=/usr \
--libdir=/usr/lib64 \
--localstatedir=/var \
--sharedstatedir=/usr/com \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--sysconfdir=/etc \
--with-config-file-path=/etc \
--with-config-file-scan-dir=/etc/php.d \
--with-pic \
--with-bz2 \
--with-curl \
--with-gd=shared \
--with-freetype-dir=/usr \
--with-png \
--with-png-dir=/usr \
--with-jpeg \
--with-jpeg-dir=/usr \
--with-gettext \
--with-gmp \
--with-iconv \
--with-kerberos \
--with-mime-magic=shared,/usr/share/file/magic.mime \
--with-openssl \
--with-pspell \
--with-expat-dir=/usr \
--with-pcre-regex=/usr \
--with-unixODBC=shared,/usr \
--with-xml \
--with-libxml-dir=/usr \
--with-zlib \
--enable-calendar \
--enable-dbx \
--enable-dio \
--enable-exif \
--enable-ftp \
--enable-gd-native-ttf \
--enable-magic-quotes \
--enable-memory-limit \
--enable-shmop \
--enable-sockets \
--enable-sysvsem=shared \
--enable-sysvshm=shared \
--enable-sysvmsg=shared \
--enable-track-vars \
--enable-trans-sid \
--enable-ucd-snmp-hack \
--enable-wddx \
--enable-yp \
--without-mysql \
--without-gdbm \
--without-pear \
--without-sqlite \
--disable-dba \
--disable-debug \
--disable-dependency-tracking \
--disable-dom \
--disable-pdo \
--disable-rpath \
--disable-xmlreader \
--disable-xmlwriter
I'm getting this error when I'm trying to configure:
creating cache ../config.cache
checking for Cygwin environment... no
checking for mingw32 environment... no
checking for egrep... grep -E
checking for a sed that does not truncate output... /bin/sed
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-redhat-linux-gnu
checking for gcc... gcc
checking whether the C compiler (gcc -arch i386 -arch x86_64 -pipe
-no-cpp-precomp -arch i386 -arch x86_64) works... no
configure: error: installation or configuration problem: C
compiler cannot create executables.
Knowing about your environment and tools helps you build software, since I don't know what you have I can only guess and I guess your environment isn't as advanced as I had originally thought.