Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


PHP5 RC1 with Apache 2 on RHL9

Posted on 2004-03-23
Medium Priority
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
Question by:adamcharnock

Expert Comment

ID: 10668551
Did you try the following command to see where libphp5.so is?
# locate libphp5.so


Expert Comment

ID: 10668562
Also, what is the actual error your getting?

Author Comment

ID: 10670120
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
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:
But this did not seem to help.

Thanks once again!
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.


Expert Comment

ID: 10670337
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:

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.

Author Comment

ID: 10675974
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)

Author Comment

ID: 10675989
I have also increased the points to 200 as this is proving to be more difficult than I thought

Expert Comment

ID: 10677269
>>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?


Author Comment

ID: 10688815
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......

Expert Comment

ID: 10691279
i've discovered my problem:
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
# rpm -q libxml2

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


Accepted Solution

allelopath earned 800 total points
ID: 10691345
also make sure of this one:
# rpm -q MySQL-devel

Author Comment

ID: 10692632
Ok, I have solved it. I came in part from reading the following bug:

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)!


Expert Comment

ID: 10693089
cool! i'm glad you got it working.  good day for both of us

Expert Comment

ID: 11558359
WAAH..............really my headache is gone...Thank you every body..
similar problem and solved it with your help

Expert Comment

ID: 11558694
nice to know you're not alone, isn't it?

Expert Comment

ID: 12167665
I had a similar problem: fixed with: make clean
After: make and make install

Expert Comment

ID: 20623749
I too was having a similar issue and fixed it with "make clean" solution suggested by Frantique.

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

564 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