Solved

php problems!!! apxs compile

Posted on 2006-11-16
5
445 Views
Last Modified: 2013-12-13
I'm attempting a reinstall of PHP.  I'm running this line for the initial configure:

./configure --with-gd --with-apxs=/usr/local/apache/bin/apxs --with-xml --enable-bcmath --enable-calendar --enable-ftp --enable-magic-quotes --with-mysqli --with-mysql=/usr --enable-discard-path --with-pear --enable-sockets --enable-track-vars --with-zlib --with-jpeg-dir=/usr/include --with-zlib-dir=/usr/include --prefix=/usr/local/ --enable-shared --includedir=/usr/local/ --libdir=/usr/local/

The ./configure runs just fine, but when I attempt the Make, it gets about halfway and then I get a long list of errors that look basically like this:

/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../crt1.o(.text+0x18): In function `_st
art':
: undefined reference to `main'
ext/standard/info.lo(.text+0x19): In function `php_info_write_wrapper':
/home/installd/buildapache/php-4.4.4/ext/standard/info.c:69: undefined reference t
o `php_escape_html_entities'
ext/standard/info.lo(.text+0x27):/home/installd/buildapache/php-4.4.4/ext/standard
/info.c:71: undefined reference to `php_body_write'
ext/standard/info.lo(.text+0x31):/home/installd/buildapache/php-4.4.4/ext/standard
/info.c:73: undefined reference to `_efree'

 It a whole bunch of undefined references.  One other thing to note, is that if I change the ./configure line to use "--with-a
pache=/home/installd/buildapache/apache_1.3.36" instead of "--with-apxs=/usr/local/apache/bin/apxs", it compiles successfully.  Unfortunately, I need to use the apxs compile to work with the forum software, so I have to be able to get it to work this way.

I can't see why the compiler is not seeing those function names.  All of the undefined references come from included header files, which I've attempted to point to with the "includedir=" option, but it still continues to fail.  Please help.  What generally causes the undefined reference errors, and how can I get a successful apxs compile?

Probably won't hurt to mention that the OS is CentOS 4.4, the version of PHP being installed is 4.4.4.  



0
Comment
Question by:krose05
  • 3
  • 2
5 Comments
 

Author Comment

by:krose05
ID: 17969440
anyone???
0
 
LVL 48

Expert Comment

by:hernst42
ID: 17979996
The difference of building with --with-apxs=/usr/local/apache/bin/apxs and --with-apache=/home/installd/buildapache/apache_1.3.36 is the the last one makes a static apache module and apxs creates an dynamic loadable extension for apache. If you the run a make install in your apache-directory again (after configureing --with-apache, make install in php) you should have a apache which has build in php-support. This sould also work with you forum software.
0
 

Author Comment

by:krose05
ID: 17992079
Maybe I'm unclear on the order.  I tried what I believe you said, but it didn't work.
First I used the ./configure line, using the --with-apache=/home/installd/buildapache/apache_1.3.36 option.  I also did make and make install which was successful.
I then subsequently went into the /home/installd/buildapache/apache_1.3.36 folder and ran make, then make install to reinstall apache.
When I look in my Forum program, it shows phpinfo, and one part of the php info is the configure command, which appears as follows:
 './configure'
'--with-apxs=/usr/local/apache/bin/apxs'
'--prefix=/usr/local'
'--with-xml'
'--enable-bcmath'
'--enable-calendar'
'--enable-ftp'
'--enable-magic-quotes'
'--with-mysqli'
'--with-mysql=/usr'
'--enable-discard-path'
'--with-pear'
'--enable-sockets'
'--enable-track-vars'
'--with-zlib'

So it looks like the server still sees the install of php with the --with-apxs setting (even though I did a reinstall with the --with-apache setting).  More importantly, it does not have the --with-gd option, which is the whole point of this exercise.  If I can get the --with-gd option to be recognized, I don't care if PHP is used as a static module or a dynamic extension.  But whatever I do, the forum doesn't seem to see it.

 If it helps, I'm running Invision 2.1.7, which is where I'm viewing the php info.
0
 
LVL 48

Accepted Solution

by:
hernst42 earned 500 total points
ID: 17994422
Did you made a
make distclean
before you run ./configure with your options again this can screw up some things  if you run multiple ./configures and makes afterwards as not all things are cleaned up correctly from a previous build.

If you have a running php on you server, try the following to only build the gd:
cd php-source
cd ext/gd
phpize (locate the file might be in /usr/local/bin)
./configure --your gd options
make
make install

The edit the php.ini and add
extension=gd.so
Restart the webserver and your gd should be available
0
 

Author Comment

by:krose05
ID: 18033147
thank you, it took sometime, but your advice set us on the right path!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

948 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now