Here is my problem I'm using Solaris 8 (SPARC) and I'm trying to install php-4.3.7 on it however when I run the following command:

./configure -with-mysql=/usr/local/mysql/bin --with-apxs=/usr/apache/bin/apxs

I get this:

checking for dirent.h... yes
checking for ApplicationServices/ApplicationServices.h... no
checking for sys/param.h... yes
.
.
.
checking for int8... no
checking base type of last arg to accept... socklen_t
checking return type of qsort... void

At the end the of all that "checking" I get this:

configure: error: Cannot find MySQL header files under /usr/local/mysql/bin

I got the same error when I used:

configure: error: Cannot find MySQL header files under /usr/local/mysql/include

Which is where the "header files" are

I have Apache 1.3.9 on the box and MySQL 4.0.20-standard

What is wrong here ?

    Hi,

    use -with-mysql=/usr/local/mysql instead. You need to specify the base directory of MySQL.

    Thomas

      Originally posted by tsinka
      Hi,

      use -with-mysql=/usr/local/mysql instead. You need to specify the base directory of MySQL.

      Thomas

      Ok thanx for that...that seem to "work"...it then told me I didn't have zlib so I installed that now I get this when I try to "configure" PHP:

      After trying this:
      /export/php-4.3.7 >>./configure -with-mysql=/usr/local/mysql --with-apxs=/usr/apache/bin/apxs --with-zlib-dir=/export/zlib--1.2.1

      I got this:

      .
      .
      .
      checking for mysql_close in -lmysqlclient... no
      checking for mysql_error in -lmysqlclient... no
      configure: error: mysql configure failed. Please check config.log for more information.

      So I went to the log file and saw (among other things) this:

      1664 configure:56221: checking for mysql_close in -lmysqlclient
      1665 configure:56240: gcc -o conftest -g -O2 -D_POSIX_PTHREAD_SEMANTICS -R/usr/local/mysql/lib -L/usr/local/mysql/lib -R/usr/ucblib -L/us
      r/ucblib -R/usr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.3 -L/usr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.3 conftest.c -lmysqlclient -
      lz -lresolv -lm -ldl -lnsl -lsocket -lgcc 1>&5
      1666 ld: warning: file /usr/local/mysql/lib/libmysqlclient.a(libmysql.o): wrong ELF class: ELFCLASS64
      1667 Undefined first referenced
      1668 symbol in file
      1669 mysql_close /var/tmp/ccoB2zCm.o
      1670 ld: fatal: Symbol referencing errors. No output written to conftest
      1671 collect2: ld returned 1 exit status
      1672 configure: failed program was:
      1673 #line 56229 "configure"
      1674 #include "confdefs.h"
      1675 / Override any gcc2 internal prototype to avoid an error. /
      1676 / We use char because int might match the return type of a gcc2
      1677 builtin and then its argument prototype would still apply.
      /
      1678 char mysql_close();
      1679
      1680 int main() {
      1681 mysql_close()
      1682 ; return 0; }
      1683 configure:56445: checking for mysql_error in -lmysqlclient
      1684 configure:56464: gcc -o conftest -g -O2 -D_POSIX_PTHREAD_SEMANTICS -R/usr/local/mysql/lib -L/usr/local/mysql/lib -R/usr/ucblib -L/us
      r/ucblib -R/usr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.3 -L/usr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.3 -R/usr -L/usr conftest.c -l
      mysqlclient -lz -lz -lresolv -lm -ldl -lnsl -lsocket -lgcc 1>&5
      1685 ld: warning: file /usr/local/mysql/lib/libmysqlclient.a(libmysql.o): wrong ELF class: ELFCLASS64
      1686 Undefined first referenced
      1687 symbol in file
      1688 mysql_error /var/tmp/cc73hOvU.o
      1689 ld: fatal: Symbol referencing errors. No output written to conftest
      1690 collect2: ld returned 1 exit status
      1691 configure: failed program was:
      1692 #line 56453 "configure"
      1693 #include "confdefs.h"
      1694 / Override any gcc2 internal prototype to avoid an error. /
      1695 / We use char because int might match the return type of a gcc2
      1696 builtin and then its argument prototype would still apply.
      /
      1697 char mysql_error();
      1698
      1699 int main() {
      1700 mysql_error()
      1701 ; return 0; }

      What does this mean "wrong ELF class: ELFCLASS64"....more importantly how do I fix it....I'm currently trting to move my pages over to a Solaris box running Apache 1.3.9 and MySQL 4....I'm trying to install PHP 4

        Ok,

        things are getting a little bit more complicated now ...

        you have a 64 Solaris installed ... so in order to successfully compile PHP you either have to have everything compiled in 32 bit mode or in 64 bit mode.

        First, try to add -m64 to the environment variable CFLAGS. This can be done by

        either
        setenv CFLAGS "$CFLAGS -m64"
        or
        export CFLAGS="$CFLAGS -m64"

        depending on the shell. Just try it and then execute
        echo $CFLAGS
        on the shell. On of theses lines should work and the echo should contain -m64.

        The problem is that you would have to recompile apache in 64 bit mode if it is a 32 bit version. If all the software you need is compiled in 32 bit mode but only MySQL is compiled in 64 bit mode you need to recompile MySQL in 32 bit mode.

        Might sound complicated ... but this is the way ... I hope that only MySQL is compiled in 64 bit mode.

        btw ... did you install packages available on www.sunfreeware.com ? This might help you a little bit.

        Thomas

          I have 64 bit MySQL running on the box, This is what I have...:

          mysql-standard-4.0.20-sun-solaris2.8-sparc-64bit

            Which version of apache did you install ?

            btw. you need the 64 bitversion of gcc, too.

            Thomas

              This what I'm using for the compiler:

              gcc-2.95.3-sol8-sparc-local

              I 'm running Apache 1.3.9

                Yes gcc is a 64 bit version....I don't kno about Apache.....How would I determine that for Apache....

                  Is this the apache version that came with Solaris ? It is rather old. If it is the version that came with Solaris it might be the 64 bit version.

                  Clean up the PHP source directory (make distclean), then export the following environment variables:

                  With bash:

                  export CFLAGS="-des -Duse64bitall"
                  export CPPFLAGS=$CFLAGS
                  export CXXFLAGS=$CPPFLAGS
                  export LDFLAGS="-mcpu=v9 -m64"
                  export LDDLFLAGS="-mcpu=v9 -m64 -G"

                  Depending on the shell you might need to use setenv. Additionally you might need to change -mcpu to -mcpu=v8, not sure about that, depends on the hardware.

                  Then try to reconfigure and recompile php. You might need to upgrade apache to a recent version ... I don't know if you can use such an old Apache with a recent php version, just try it.

                  Thomas

                    make distclean is that a command.... ? What is distclean ?

                    I tried it and got this:

                    make: Fatal error: Don't know how to make target `distclean'

                      I forgot ... this only works if the configure command executed successfully once.
                      make distclean cleans up the directory but you can as good remove the directory and untar the sources again just to make sure that you have a clean php source directory.

                      Thomas

                        Ok I have decided to go with PHP 5 but now I'm having different problems.

                        This makes no sense, I tried this:

                        /export/php-5.0.1 >>./configure -with-mysql=/usr/local/mysql/bin --with-apxs=/usr/apache/bin/apxs --with-libxml-dir=/export/libxml2-2.5.5

                        And this

                        /export/php-5.0.1 >>./configure -with-mysql=/usr/local/mysql/bin --with-apxs=/usr/apache/bin/apxs --with-libxml=/export/libxml2-2.5.5

                        And this

                        /export/php-5.0.1 >>./configure -with-mysql=/usr/local/mysql/bin --with-apxs=/usr/apache/bin/apxs --with-libxml=/export/libxml2-2.5.5/xml2-config

                        I keep getting this :

                        .
                        .
                        .
                        Configuring extensions
                        checking whether to enable LIBXML support... yes
                        checking libxml2 install dir... no
                        configure: error: xml2-config not found. Please check your libxml2 installation.

                        But I know the file exist, because when I did a ls -l (on /export/libxml2-2.5.5) I got this:

                        -rwxr-xr-x 1 root other 1058 Aug 25 08:53 xml2-config

                        So why can't PHP find the file ? Could it have to with how libxml2-2.5.5 wuz installed ? All I did wuz this :

                        /export/libxml2-2.5.5/.configure

                          Hi,

                          I think just executing ./configure isn't sufficient. You need to execute make and make install afterwards in order to install libxml2.

                          You might want to specify the at least prefix (base install directory) like
                          ./configure --prefix=/usr/local

                          After installing libxml2 use that prefix as path to the libxml2 when configuring PHP.

                          Thomas

                            Ok I finally "completed" (or so I thought) I tried starting the Apache server (it wuz never running in the first place) and I got this message...

                            Syntax error on line 212 of /etc/apache/httpd.conf:
                            Cannot load /var/apache/libexec/libphp5.so into server: ld.so.1: /usr/apache/bin/httpd: fatal: /var/apache/libexec/libphp5.so: open failed: No such file or directory
                            ./apachectl start: httpd could not be started

                            Online 212 I have (the line hightlighted):

                            Example:

                            LoadModule foo_module libexec/mod_foo.so

                            LoadModule php5_module libexec/libphp5.so

                            LoadModule vhost_alias_module /usr/apache/libexec/mod_vhost_alias.so
                            LoadModule env_module /usr/apache/libexec/mod_env.so

                            For me the actually directory that Apache should be trying to load is:

                            /usr/apache/libexec

                            NOT

                            /var/apache/libexec/

                            Because /var/apachelibexec jus doesn't exist....This directory exist though /var/apache. I have no idea why it's even looking there

                            Nevertheless I went to /usr/apache/libexec and to my suprise there wuz no libphp5.so (I however saw several *.so files) I did a seach of my system and that file (libphp5.so) is no where to be found..

                            I wuz following the instructions at Apache 1.3.x on Unix systems

                              Hi,

                              did "make" and "make install" produce any errors ? After compiling PHP search the PHP directory for any file libphp5*. In order to compile php5 you need at least the most recent versions of the following software packages:

                              gcc
                              make
                              flex
                              bison
                              m4
                              autoconf
                              automake
                              gzip
                              tar
                              sed

                              and maybe perl. This list comes from the PHP manual. I installed several more packages when I compiled apache/php4.x on a Solaris 9 machine.

                              Hmmm...while writing this I remember that I recently wrote down every single step required to compile apache/PHP on Solaris 9 including environment variables (and installed sunfreeware packages if I remember right). It was some kind of tricky (but included oracle/oci8/mysql/ssl support afterwards).

                              Let me see if I can find it. It's hard to suggest anything without knowing how the system is set up and wich packages are installed. Please give me an overview of the GNU tools that are installed.

                              Thomas

                                I would surely appreciate that article U wrote...

                                I also have problems installing packages so I have jus tried installing the packages that I tells me that it needs....like zlib and libxml2

                                Currently the system I'm trying to install PHP 5 on is a "bare bones" system....whatever packages I need I have to go download them....(this box didn't even have a compiler)....

                                What I did though is that I tried to install PHP 5 first by running ./configure and based on what it told me wuz missing I went and downloaded it !

                                  Which problem do you have installing the packages (sunfreeware.com) ?

                                  btw ... it isn't an article, rather just a list of the steps, but it should be sufficient to get PHP up and running with the features you need. I had some heavy work to do so I hadn't the time to send it. I think I can post it as soon as I finish work today 🙂

                                  Thomas

                                    Originally posted by tsinka
                                    Which problem do you have installing the packages (sunfreeware.com) ?

                                    btw ... it isn't an article, rather just a list of the steps, but it should be sufficient to get PHP up and running with the features you need. I had some heavy work to do so I hadn't the time to send it. I think I can post it as soon as I finish work today 🙂

                                    Thomas

                                    I don't kno if it's so much a problem installing the packages...but more of a problem with me specifying the correct paths for installation and specifying the paths where certain other packages can be found....for my installation all packages that I download must be installed in a directory called /export not /usr/local which apparently is the usuall.....

                                    The last time I tried the installation (PHP 5 installation)....I got this

                                    .
                                    .
                                    .
                                    Configuring extensions
                                    checking whether to enable LIBXML support... yes
                                    checking libxml2 install dir... /export/libxml2-2.6.12
                                    checking whether libxml build works... yes
                                    checking for OpenSSL support... no
                                    checking for ZLIB support... yes
                                    checking if the location of ZLIB install directory is defined... no
                                    configure: error: Cannot find libz

                                    Where would I find that libz thing ?

                                    I'm nevertheless going to try to rebuild the following before I again try to rebuild PHP 5

                                    Theze are the packages I would want to rebuild


                                    zlib-1.2.1.tar.gz
                                    openssl-0.9.7d.tar.gz
                                    libxml2-2.6.12.tar.gz
                                    mhash-0.9.1.tar.gz
                                    libtool-1.5.6.tar.gz
                                    libpng-1.2.6-config.tar.gz
                                    libmcrypt-2.5.7.tar.gz (BTW is there a bug in this libraray ? Ok I jus checked...there is, is there an alternative)
                                    gd-2.0.28.tar.gz

                                    This is how I'm configuring the the packages to be built:

                                    ./configure --prefix=/export --libexecdir=/export/libexec -libdir=/export/lib --includedir=/export
                                    /include

                                    make

                                    make install

                                    I get this whenever I do it for it for zlib

                                    mkdir: illegal option -- l
                                    mkdir: illegal option -- i
                                    mkdir: illegal option -- b
                                    mkdir: illegal option -- d
                                    mkdir: illegal option -- i
                                    mkdir: illegal option -- r
                                    mkdir: illegal option -- =
                                    mkdir: illegal option -- /
                                    mkdir: illegal option -- e
                                    mkdir: illegal option -- x
                                    mkdir: illegal option -- o
                                    mkdir: illegal option -- r
                                    mkdir: illegal option -- t
                                    mkdir: illegal option -- /
                                    mkdir: illegal option -- l
                                    mkdir: illegal option -- i
                                    mkdir: illegal option -- b
                                    mkdir: usage: mkdir [-m mode] [-p] dirname ...
                                    Error code 2 (ignored)
                                    cp zlib.h zconf.h /export/include
                                    chmod 644 /export/include/zlib.h /export/include/zconf.h
                                    cp libz.a -libdir=/export/lib
                                    cp: cannot create -libdir=/export/lib: No such file or directory
                                    Error code 2
                                    make: Fatal error: Command failed for target `install'

                                    I get this whenever I do it for it for libxml2-2.6.12

                                    ld: fatal: relocations remain against allocatable but non-writable sections
                                    collect2: ld returned 1 exit status
                                    Error code 1
                                    make: Fatal error: Command failed for target libxml2.la'
                                    Current working directory /export/libxml2-2.6.12
                                    *** Error code 1
                                    make: Fatal error: Command failed for target
                                    all-recursive'
                                    Current working directory /export/libxml2-2.6.12
                                    Error code 1
                                    make: Fatal error: Command failed for target `all'

                                      Write a Reply...