I have been trying to my vain to compile and install PHP on a red hat linux system:

The version of PHP I'm trying to compile is 4.3.3. The configure line that I use is:
./configure --with-apxs2=/usr/local/apache2/bin/apxs --without-pear --with-ftp

Configure runs fine and on checking the configure log the only thing that raises any eye brow is:

configure:85464: checking whether dlsym() requires a leading underscore in symbol names
configure:85532: gcc -o conftest -g -O2 conftest.c 1>&5
/tmp/ccuV3fq0.o(.text+0x1b): In function main':
/usr/shares/adam/linux/php/php-4.3.3/configure:85518: undefined reference to
dlopen'
/tmp/ccuV3fq0.o(.text+0x34):/usr/shares/adam/linux/php/php-4.3.3/configure:85523: undefined refere
nce to dlsym'
/tmp/ccuV3fq0.o(.text+0x52):/usr/shares/adam/linux/php/php-4.3.3/configure:85524: undefined refere
nce to
dlsym'

I then run make. Just before it finishes this warning appears:
Warning: inter-library dependencies are not known to be supported.
All declared inter-library dependencies are being dropped.

Warning: libtool could not satisfy all declared inter-library
dependencies of module libphp4. Therefore, libtool will create
a static module, that should work as long as the dlopening
application is linked with the -dlopen flag.

When I attempt to run make install however I got the following output:
[Installing PHP CLI binary: /usr/local/bin/
Installing PHP CLI man page: /usr/local/man/man1/
Installing PHP SAPI module: apache2handler
/usr/local/apache2/build/instdso.sh SH_LIBTOOL='/usr/local/apache2/build/libtool' libphp4.la /usr/local/apache2/modules
/usr/local/apache2/build/libtool --mode=install cp libphp4.la /usr/local/apache2/modules/
cp .libs/libphp4.lai /usr/local/apache2/modules/libphp4.la
cp .libs/libphp4.a /usr/local/apache2/modules/libphp4.a
ranlib /usr/local/apache2/modules/libphp4.a
chmod 644 /usr/local/apache2/modules/libphp4.a
libtool: install: warning: remember to run libtool --finish /usr/shares/adam/linux/php/php-4.3.3/libs'
Warning! dlname not found in /usr/local/apache2/modules/libphp4.la.
Assuming installing a .so rather than a libtool archive.
chmod 755 /usr/local/apache2/modules/libphp4.so
chmod: failed to get attributes of
/usr/local/apache2/modules/libphp4.so': No such file or directory
apxs:Error: Command failed with rc=65536
.
make: *** [install-sapi] Error 1

It appears as if make install has created the following files:
$ ls libs
libphp4.a libphp4.la

$ ls .libs
libphp4.a libphp4.la libphp4.lai

So why it is attempting chmod a file which it didn't create is beyond me. I have a feeling that this may all stem from the configure error. I have upgraded to the latest version of libtool and have also done some research on a similar issue that occured in php 4.2.x whereby the a a flag in libtool needed to be changed.

I have also read this bug report which instructs you to change the configure file. However I am not confident with doing this:
http://bugs.php.net/bug.php?id=19918

I would greatly appriate any help. I enjoy compiling programs instead of just installing as it presents a challenge. However PHP is proving a very difficult challenge.

    Thanks for the link. I modified the apxs file as instructed and did a recompile and attempted to reinstall. However the problem still persists.

    I have the idea of attempting to install the rpm which came with the linux distribution I have and see if there are any failed dependancies.

      Still no luck. The rpm's come up with the same error and these are PHP 4.2.2. I figure something on my system must be missing.

        I gave up completely with configuring PHP 4 as an Apache DSO module and decided instead to go for the CGI. I used the following configure line:
        #./configure --enable-track-vars --enable-force-cgi-redirect \
        --enable-discard-path --with-mysql --without-pear \
        --enable-ftp --with-pcre-regex

        Everything went fine with the make and make install. However after I added the directives to httpd.conf:

        for php cgi



        ScriptAlias /php/ "/usr/local/bin/"
        AddType application/x-httpd-php .php
        Action application/x-httpd-php "/php/php"

        On executing this simple script:

        #!/usr/local/bin/php
        
        <?php
          phpinfo();
        ?>
        

        I get the following error:
        Parse error: parse error in /usr/local/bin/php on line 3781

        I am again at my wits end. Having searched the internet from beginning to end I seem to come up with a dead end. Is it me or is PHP designed not to work on my computer.

        Again help would be a god send.

        Thanks Adam

          Write a Reply...