Skip to Main Content

Infrastructure Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Compiling 64bit PHP with 64bit MySQL on Solaris 11.3

msmcknightOct 9 2016 — edited Oct 15 2016

Hi everyone,

I'm stuck and need some help.  I am having a terrible time trying to get 64bit PHP compiled with 64bit MySQL.  I have MySQL compiled as 64bit, Apache is 64bit, but when I try to add PHP to the mix, it falls apart.  The failure only happens when I try to add MySQL to the compile options for PHP (ie. --with-mysql=/opt/mystuff/mysql), but it doesn't seem directly related to MySQL.  The compiler chokes with ELF errors, and that seems to be caused by something somewhere not looking at the appropriate 64bit libraries.

So, I guess the first question is, has anyone accomplished this?  I've yet to find anyone indicating success on Solaris.

I'm trying to use PHP 5.6.26 with MySQL 5.7.11.

make fails with:

ld: warning: file /usr/gcc/4.8/lib/gcc/i386-pc-solaris2.11/4.8.2/libgcc_eh.a(unwind-dw2.o): wrong ELF class: ELFCLASS32

I have no idea why it's not looking in amd64 for libgcc_eh.a -- it's there.

This only occurs if I have the following in the config line:

--with-mysql=/opt/mystuff/mysql

MySQL works without issue and is 64bit. If I look at the MySQL libraries, they are all 64-bit:

/opt/mystuff/mysql/lib> file *

libgcc_s.so: symbolic link to ../../gcc/4.5/lib/amd64/libgcc_s.so

libgcc_s.so.1: ELF 64-bit LSB dynamic lib AMD64 Version 1, dynamically linked, not stripped

libmysqlclient_r.so: ELF 64-bit LSB dynamic lib AMD64 Version 1, dynamically linked, not stripped

libmysqlclient.so: ELF 64-bit LSB dynamic lib AMD64 Version 1, dynamically linked, not stripped

libmysqlclient.so.20: ELF 64-bit LSB dynamic lib AMD64 Version 1, dynamically linked, not stripped

libmysqlclient.so.20.2.0: ELF 64-bit LSB dynamic lib AMD64 Version 1, dynamically linked, not stripped

libstdc++.so: symbolic link to ../../gcc/4.5/lib/amd64/libstdc++.so

libstdc++.so.6: symbolic link to ../../gcc/4.5/lib/amd64/libstdc++.so.6

libstdc++.so.6.0.14: ELF 64-bit LSB dynamic lib AMD64 Version 1, dynamically linked, not stripped

The build environment is set up as:

export CC=gcc

export CFLAGS="-m64"

export CXX=gcc

export CXXFLAGS="-m64"

======================================================

crle -64

Configuration file [version 4]: /var/ld/64/ld.config

  Platform: 64-bit LSB AMD64

  Default Library Path (ELF): /opt/mystuff/openssl/lib:/opt/mystuff/mysql/lib:/lib/64:/usr/lib/64

  Trusted Directories (ELF): /lib/secure/64:/usr/lib/secure/64 (system default)

Command line:

  crle -64 -c /var/ld/64/ld.config -l /opt/mystuff/openssl/lib:/opt/mystuff/mysql/lib:/lib/64:/usr/lib/64

======================================================

./configure --prefix=/opt/mystuff/php \

  --with-config-file-path=/opt/mystuff/php \

  --with-openssl=/opt/mystuff/openssl \

  --with-apxs2=/opt/mystuff/apache/bin/apxs \

  --with-mysql=/opt/mystuff/mysql \

  --enable-dtrace \

  --enable-exif \

  --enable-soap \

  --enable-sysvmsg \

  --enable-sysvsem \

  --enable-sysvshm \

  --enable-zip \

  --enable-mbstring \

  --enable-xml \

  --with-gd \

  --with-iconv \

  --with-jpeg-dir=/usr/lib/64 \

  --with-png-dir=/usr/lib/64 \

  --with-zlib \

  --without-sqlite3 \

  --without-pdo-sqlite

I filed a bug on this a few months ago (https://bugs.php.net/bug.php?id=71965) but there's been no response on it.

If anyone has succeeded in this task, please pass on the instructions.  At this point I'm looking to have to switch to Linux as my main webserver and I really, really would rather stay on Solaris.

Thanks to you all in advance.

This post has been answered by remzi.akyuz on Oct 10 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 12 2016
Added on Oct 9 2016
2 comments
1,497 views