Solved

PHP5 RC1 with Apache 2 on RHL9

Posted on 2004-03-23
16
9,815 Views
Last Modified: 2013-12-13
I have just installed Red Hat 9 and I am trying to get PHP 5 RC1 up and running on Apache 2.0.48. I have compiled and installed Apache which now runs without a problem. However, I compile and install PHP but can not find the libphp5.so file which I need to place in the /usr/local/apache2/modules directory. I run ./configure for PHP with the following options:

--prefix=/usr/local/php5 --exec-prefix=/usr/local/php5 --with-mysql=/usr/local/mysql --without-sqlite --with-libxml-dir=/usr/local/libxml2 --with-config-file-path=/usr/local/php --disable-cgi

I then run make, then make install

I may be making an obvious mistake, I don’t know. Can anyone tell me why no libphp5.so file has been created? Any other pointers would also be appreciated.

Many Thanks
0
Comment
Question by:adamcharnock
16 Comments
 
LVL 1

Expert Comment

by:allelopath
Comment Utility
Did you try the following command to see where libphp5.so is?
# locate libphp5.so

0
 
LVL 1

Expert Comment

by:allelopath
Comment Utility
Also, what is the actual error your getting?
0
 

Author Comment

by:adamcharnock
Comment Utility
Thanks for you advice. I have run 'locate libphp5.so' (as well as 'find / -name libphp5.so') but the file has not been found. I do not get any errors, but if I tell apache to load libphp5.so when it does not exist, I am certain it will not like very much. Maybe I have missed out a ./configure option, that is all I can really think of.

You may find this usefull...
[root@localhost root]# locate libphp
/root/downloads/php-5.0.0rc1/php-5.0.0RC1/sapi/apache/libphp5.module.in
/root/downloads/php-5.0.0rc1/php-5.0.0RC1/sapi/apache_hooks/libphp5.module.in
/root/downloads/php-5.0.0rc1-snapshot/php5-200403221330/sapi/apache/libphp5.module.in
/root/downloads/php-5.0.0rc1-snapshot/php5-200403221330/sapi/apache_hooks/libphp5.module.in
seems to be two module.in files (the last two are a PHP5 snapshot, which i am not using)

I also appended this option to ./configure:
--with-apxs2=/usr/local/apache2/bin/apxs
But this did not seem to help.

Thanks once again!
0
 
LVL 1

Expert Comment

by:allelopath
Comment Utility
Double check that the file apxs is in /usr/local/apache2/bin/

You shouldn't have to put libphp5.so in  /usr/local/apache2/modules manually.
The make install should do that for you
In your make install output, do you see something like:
cp .libs/libphp5.so /usr/local/apache/modules/libphp5.so

But these are not the problem since it appears that libphp5.so dne.
I think this means there is a problem with libtool, try:
# libtool --finish /usr/local/php-5.0.0RC1/libs

You should see something like this:

PATH="$PATH:/sbin" ldconfig -n /usr/local/php-5.0.0RC1/libs
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/local/php-5.0.0RC1/libs

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,--rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
0
 

Author Comment

by:adamcharnock
Comment Utility
Hi,
I checked that axps was in the correct place, which it is. I removed the php5 directory and ran configure, make and then 'make install | grep cp'. The latter produced no results. I can configure with the options in my first post.

However, I then ran configure with:
--prefix=/usr/local/php5 --exec-prefix=/usr/local/php5 --with-mysql=/usr/local/mysql --without-sqlite --with-libxml-dir=/usr/local/libxml2 --with-config-file-path=/usr/local/php5 --disable-cgi --with-apxs2=/usr/local/apache2/bin/apxs --libexecdir=/usr/local/apache2/modules

In the hope of installing libphp5.so into /usr/local/apache2/modules. However, upon running make I get the following output (notably the last few lines):

/bin/sh /root/.Trash/php-5.0.0RC1/libtool --silent --preserve-dup-deps --mode=compile gcc  -Imain/ -I/root/.Trash/php-5.0.0RC1/main/ -DPHP_ATOM_INC -I/root/.Trash/php-5.0.0RC1/include -I/root/.Trash/php-5.0.0RC1/main -I/root/.Trash/php-5.0.0RC1 -I/root/.Trash/php-5.0.0RC1/Zend -I/usr/local/libxml2/include/libxml2 -I/usr/local/mysql/include  -I/root/.Trash/php-5.0.0RC1/TSRM  -g -O2  -prefer-pic -c main/internal_functions.c -o main/internal_functions.lo
/bin/sh /root/.Trash/php-5.0.0RC1/libtool --silent --preserve-dup-deps --mode=link gcc -g -O2 -prefer-pic  -rpath /root/.Trash/php-5.0.0RC1/libs -avoid-version -module -L/usr/local/libxml2/lib -L/usr/local/mysql/lib  -R /usr/local/libxml2/lib -R /usr/local/mysql/lib ext/libxml/libxml.lo ext/ctype/ctype.lo ext/dom/php_dom.lo ext/dom/attr.lo ext/dom/document.lo ext/dom/domerrorhandler.lo ext/dom/domstringlist.lo ext/dom/domexception.lo ext/dom/namelist.lo ext/dom/processinginstruction.lo ext/dom/cdatasection.lo ext/dom/documentfragment.lo ext/dom/domimplementation.lo ext/dom/element.lo ext/dom/node.lo ext/dom/string_extend.lo ext/dom/characterdata.lo ext/dom/documenttype.lo ext/dom/domimplementationlist.lo ext/dom/entity.lo ext/dom/nodelist.lo ext/dom/text.lo ext/dom/comment.lo ext/dom/domconfiguration.lo ext/dom/domimplementationsource.lo ext/dom/entityreference.lo ext/dom/notation.lo ext/dom/xpath.lo ext/dom/dom_iterators.lo ext/dom/typeinfo.lo ext/dom/domerror.lo ext/dom/domlocator.lo ext/dom/namednodemap.lo ext/dom/userdatahandler.lo ext/mysql/php_mysql.lo ext/pcre/pcrelib/maketables.lo ext/pcre/pcrelib/get.lo ext/pcre/pcrelib/study.lo ext/pcre/pcrelib/pcre.lo ext/pcre/php_pcre.lo ext/posix/posix.lo ext/session/session.lo ext/session/mod_files.lo ext/session/mod_mm.lo ext/session/mod_user.lo ext/simplexml/simplexml.lo ext/spl/php_spl.lo ext/spl/spl_functions.lo ext/spl/spl_engine.lo ext/spl/spl_iterators.lo ext/spl/spl_array.lo ext/spl/spl_directory.lo ext/spl/spl_sxe.lo regex/regcomp.lo regex/regexec.lo regex/regerror.lo regex/regfree.lo ext/standard/array.lo ext/standard/base64.lo ext/standard/basic_functions.lo ext/standard/browscap.lo ext/standard/crc32.lo ext/standard/crypt.lo ext/standard/cyr_convert.lo ext/standard/datetime.lo ext/standard/dir.lo ext/standard/dl.lo ext/standard/dns.lo ext/standard/exec.lo ext/standard/file.lo ext/standard/filestat.lo ext/standard/flock_compat.lo ext/standard/formatted_print.lo ext/standard/fsock.lo ext/standard/head.lo ext/standard/html.lo ext/standard/image.lo ext/standard/info.lo ext/standard/iptc.lo ext/standard/lcg.lo ext/standard/link.lo ext/standard/mail.lo ext/standard/math.lo ext/standard/md5.lo ext/standard/metaphone.lo ext/standard/microtime.lo ext/standard/pack.lo ext/standard/pageinfo.lo ext/standard/parsedate.lo ext/standard/quot_print.lo ext/standard/rand.lo ext/standard/reg.lo ext/standard/soundex.lo ext/standard/string.lo ext/standard/scanf.lo ext/standard/syslog.lo ext/standard/type.lo ext/standard/uniqid.lo ext/standard/url.lo ext/standard/url_scanner.lo ext/standard/var.lo ext/standard/versioning.lo ext/standard/assert.lo ext/standard/strnatcmp.lo ext/standard/levenshtein.lo ext/standard/incomplete_class.lo ext/standard/url_scanner_ex.lo ext/standard/ftp_fopen_wrapper.lo ext/standard/http_fopen_wrapper.lo ext/standard/php_fopen_wrapper.lo ext/standard/credits.lo ext/standard/css.lo ext/standard/var_unserializer.lo ext/standard/ftok.lo ext/standard/sha1.lo ext/standard/user_filters.lo ext/standard/uuencode.lo ext/standard/filters.lo ext/standard/proc_open.lo ext/standard/sunfuncs.lo ext/standard/streamsfuncs.lo ext/standard/http.lo ext/tokenizer/tokenizer.lo ext/xml/xml.lo ext/xml/compat.lo TSRM/TSRM.lo TSRM/tsrm_strtok_r.lo TSRM/tsrm_virtual_cwd.lo main/main.lo main/snprintf.lo main/spprintf.lo main/php_sprintf.lo main/safe_mode.lo main/fopen_wrappers.lo main/alloca.lo main/php_scandir.lo main/php_ini.lo main/SAPI.lo main/rfc1867.lo main/php_content_types.lo main/strlcpy.lo main/strlcat.lo main/mergesort.lo main/reentrancy.lo main/php_variables.lo main/php_ticks.lo main/network.lo main/php_open_temporary_file.lo main/php_logos.lo main/output.lo main/streams/streams.lo main/streams/cast.lo main/streams/memory.lo main/streams/filter.lo main/streams/plain_wrapper.lo main/streams/userspace.lo main/streams/transports.lo main/streams/xp_socket.lo main/streams/mmap.lo Zend/zend_language_parser.lo Zend/zend_language_scanner.lo Zend/zend_ini_parser.lo Zend/zend_ini_scanner.lo Zend/zend_alloc.lo Zend/zend_compile.lo Zend/zend_constants.lo Zend/zend_dynamic_array.lo Zend/zend_execute_API.lo Zend/zend_highlight.lo Zend/zend_llist.lo Zend/zend_opcode.lo Zend/zend_operators.lo Zend/zend_ptr_stack.lo Zend/zend_stack.lo Zend/zend_variables.lo Zend/zend.lo Zend/zend_API.lo Zend/zend_extensions.lo Zend/zend_hash.lo Zend/zend_list.lo Zend/zend_indent.lo Zend/zend_builtin_functions.lo Zend/zend_sprintf.lo Zend/zend_ini.lo Zend/zend_qsort.lo Zend/zend_multibyte.lo Zend/zend_ts_hash.lo Zend/zend_stream.lo Zend/zend_iterators.lo Zend/zend_interfaces.lo Zend/zend_exceptions.lo Zend/zend_objects.lo Zend/zend_object_handlers.lo Zend/zend_objects_API.lo Zend/zend_mm.lo Zend/zend_default_classes.lo Zend/zend_reflection_api.lo Zend/zend_execute.lo sapi/apache2handler/mod_php5.lo sapi/apache2handler/sapi_apache2.lo sapi/apache2handler/apache_config.lo sapi/apache2handler/php_functions.lo main/internal_functions.lo -lcrypt -lcrypt -lmysqlclient -lresolv -lm -ldl -lnsl -lxml2 -lz -lm -lxml2 -lz -lm -lxml2 -lz -lm -lcrypt -lxml2 -lz -lm -lcrypt  -o libphp5.la
ext/libxml/libxml.lo: file not recognized: File truncated
collect2: ld returned 1 exit status
make: *** [libphp5.la] Error 1

It seems to be having problems with libxml. I have been slightly suspect of this as I had previously (on another RHL install) got PHP5 5 setup fine. However, when apache started it mentioned some form of libxml error in the libphp.so file. I am sure that libxml2 is at /usr/local/libxml2, and the version is 2.5.11. I did the upgrade after the make (or make install) process informed me that a new version was needed.

I will continue fighting with the problem, but if you think it is a bug (as it is RC1) then just let me know.

Thanks again

PS. Could the problem with libxml.lo be due to how I have unpacked the .tar.gz files? (using gzip and tar)
0
 

Author Comment

by:adamcharnock
Comment Utility
I have also increased the points to 200 as this is proving to be more difficult than I thought
0
 
LVL 1

Expert Comment

by:allelopath
Comment Utility
>>PS. Could the problem with libxml.lo be due to how I have unpacked the .tar.gz files? (using gzip and tar)
i don't see how this could be a problem, there's only one way to do it and either it does it or it doesn't

As it happens, I am having problems with RC1, too.
I had to upgrade libxml, as well, but after that everything compiled/built fine, but it crashes when trying to display a php file.
I'm beginning to think its a bug, because I've tried everything i can think of, except for one suggestion to install Apache and MySQL source RPMs specifically for RedHat.  I don't think MySQL enters into the problem because the pages I'm trying to display are simple test pages (phpInfo()) and don't make any SQL calls.  I did build Apache from src, but i got it from the Apache site, not RH.  Did you?


0
 

Author Comment

by:adamcharnock
Comment Utility
I compiled Apache from source as well. I may just have to wait for another PHP version to come out. I may post it as a bug in case in the hope that I will not get the same problem in future. If you think this is the case then I will close this question and give points. Unless anyone has any further ideas......
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 1

Expert Comment

by:allelopath
Comment Utility
i've discovered my problem:
http://www.experts-exchange.com/Web/Web_Languages/PHP/PHP_Installation/Q_20930420.html
i don't think my solution pertains to your probem, but it is now running...so it is possible

another wild guess, it says:
ext/libxml/libxml.lo: file not recognized: File truncated
maybe this file is corrupted, try uninstalling/reinstalling libxml and/or libxml2 rpms

what versions do you have?  i've got:
# rpm -q libxml
libxml-1.8.17-8
# rpm -q libxml2
libxml2-2.5.10-1

don't give me points unless and until we solve the problem

0
 
LVL 1

Accepted Solution

by:
allelopath earned 200 total points
Comment Utility
also make sure of this one:
# rpm -q MySQL-devel
MySQL-devel-4.0.18-0
0
 

Author Comment

by:adamcharnock
Comment Utility
Ok, I have solved it. I came in part from reading the following bug:
http://bugs.php.net/bug.php?id=25892

It turned out that using the latest snapshot (http://snaps.php.net/php5-latest.tar.gz) has solved the problem. libphp5.so was created in the modules directory as expected. For anyone's future reference, the snapshot file name was php5-200403261730.tar.gz, although I imagine that the folks at PHP will will not un-fix the problem in future snapshots/relases.

I also configured with the following information (also for other peoples reference):
./configure --prefix=/usr/local/php5 --exec-prefix=/usr/local/php5 --with-mysql=/usr/local/mysql --without-sqlite --with-libxml-dir=/usr/local/libxml2 --with-config-file-path=/usr/local/php5 --disable-cgi --with-apxs2=/usr/local/apache2/bin/apxs --libexecdir=/usr/local/apache2/modules

Many thanks to allelopath! I have given you the points because im sure I would not have solved it without you keeping me thinking about it. I hope this saves someone a headache in the future (albeit probably near future)!


0
 
LVL 1

Expert Comment

by:allelopath
Comment Utility
cool! i'm glad you got it working.  good day for both of us
0
 
LVL 1

Expert Comment

by:satyaramesh
Comment Utility
WAAH..............really my headache is gone...Thank you every body..
similar problem and solved it with your help
0
 
LVL 1

Expert Comment

by:allelopath
Comment Utility
nice to know you're not alone, isn't it?
0
 

Expert Comment

by:Frantique
Comment Utility
I had a similar problem: fixed with: make clean
After: make and make install
0
 

Expert Comment

by:pegger72
Comment Utility
I too was having a similar issue and fixed it with "make clean" solution suggested by Frantique.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
This article discusses four methods for overlaying images in a container on a web page
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.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

763 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

6 Experts available now in Live!

Get 1:1 Help Now