LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-13-2001, 06:40 PM   #1
yazan
LQ Newbie
 
Registered: Aug 2001
Posts: 2

Rep: Reputation: 0
PHP4 & Apache Install Error


Hi all,

Okay here is the error message I am getting when I try to start apache server after installing php4:

Syntax error on line 236 of httpd.conf:
Cannot load /usr/local/apache/libexec/libphp4.so into server: /usr/local/apache/libexec/libphp4.so: undefined symbol: uncompress

Here is what I did from the start:

1. untared apache_1.3.20.tar.gz
2. ./configure --enable-module=most --enable-shared=max
3. make
4. make install

That installed the server with no problems and with support for DSO

Next trying to install php4

1. again untarring php4
2. ./configure --with-mysql=/usr/local/mysql --with-apxs=/usr/local/apache/bin/apxs
3. make
4. make install

Everything runs okay and everything installs properly.

Then :

1. copy the php.ini-dist file to the apache conf file and name it php.ini
2. checking httpd.conf for the following :

LoadModule php4_module libexec/libphp4.so
AddModule mod_php4.c

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

Upon restarting the server the above error appears saying libphp4.so: undefined symbol: uncompress

Does anyone have any idea what is going on?
I have looked everywhere for an answer and came up blank. Would really appreciate any direction.

Extra info:
1. Distro Red Hat Linux 6.2
2. PHP 4.0.6
3. Apache 1.3.20

Thanks,
Yazan
 
Old 08-13-2001, 11:35 PM   #2
yazan
LQ Newbie
 
Registered: Aug 2001
Posts: 2

Original Poster
Rep: Reputation: 0
Re: PHP4 & Apache Install Error

Okay with a little determination I found the answer to my problem and thought I would post it on here since I found plenty of lists and forums that had the question but not the answer so here it goes:

The problem with the "uncompress" symbol is related to libz.so.#
This is a DSO library which is required when building PHP4.

So here is the error message again:
Cannot load /usr/local/apache/libexec/libphp4.so: /usr/local/apache/libexec/libphp4.so: undefined symbol: uncompress

Now here is the solution:

1. First try to clean out whatever files and directories you have created while building php4. Usually they are all under the php#.#.# directory created when you untar the zipped package.
What I did is run the following under the php directory:
>make clean
>make clean all
>cd ..
>rm -Rf php_4.0.6 (note: version numbers may vary)

2. I manually removed libphp4.so from the apache/libexec directory


3. Obviously I had to re-untar the php package
>tar -zxvf php_4.0.6.tar.gz

4. I ran the configure command
>./configure --with-apxs=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql --without-zlib

(Here is what "solves" the problem)
5. Now *BEFORE* running "make" find the top level "Makefile" in the php directory. Using your favourite editor look for the following line:

LTLIBRARY_LDFLAGS = [ other options already there ]

add to it the three characters -lz which are not included by default.

so now it looks like :

LTLIBRARY_LDFLAGS = -lz [ other options already there ]

6. Save and exit.

7. You can now run "make" and then "make install"

To make sure that libz.so.# has been properly linked to libphp4.so run the following command from the apache directory:

>ldd libexec/libphp4.so
libz.so.1 => /usr/lib/libz.so.1 (0x40129000) libpam.so.0 => /lib/libpam.so.0 (0x40138000)
libdl.so.2 => /lib/libdl.so.2 (0x40140000)
libgd.so.1 => /usr/lib/libgd.so.1 (0x40143000)
libresolv.so.2 => /lib/libresolv.so.2 (0x40179000)
libm.so.6 => /lib/libm.so.6 (0x40188000)
libcrypt.so.1 => /lib/libcrypt.so.1 (0x401a5000)
libnsl.so.1 => /lib/libnsl.so.1 (0x401d2000)
libc.so.6 => /lib/libc.so.6 (0x401e8000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)

(notice the first line in the result!)

Once everything has finished compiling and installing don't forget to edit the httpd.conf file to reflect the php extension by adding the following lines:

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

and making sure that the following lines are there and pointing to the correct files and directories:

LoadModule php4_module libexec/libphp4.so
AddModule mod_php4.c

finally copy php.ini-dist to the apache/conf folder and rename it to php.ini

8. Start the apache server and everything should be fine:
>apache/bin/apachectl start
bin/apachectl start: httpd started

That means that the apache server started with the php module with no problems.
To test that PHP really works I created the following page:

<HTML>
<HEAD><TITLE> PHP Test </TITLE></HEAD>
<BODY>
<?php phpinfo( ); ?>
</BODY>
</HTML>

Save this file in your htdocs directory as test.php and then test it on your browser using:
http://localhost/test.php as the address, you should see the PHP Page with its current configuration.

Hope this helps others out there...

-yazan
 
Old 02-28-2002, 03:02 PM   #3
indy_bob
LQ Newbie
 
Registered: Feb 2002
Location: Indianapolis
Distribution: Slackware 8.0
Posts: 6

Rep: Reputation: 0
Just wanted to post that I had the same exact problem which I could not figure out. The previously posted steps worked perfectly.

Configuration:

Distro - Slackware 8
Apache 1.3.23
PHP 4.1.1
MySql 3.23.49a

Many thanks.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SElinux & php4 & interbase & apache maxut Linux - Security 0 03-15-2005 04:57 AM
Install error: fatal error attempting to install <pkgpath & name> gmartin Slackware - Installation 24 02-17-2005 04:26 PM
php4 & apache installed but will not run web pages with scripts oberon-ken-obi Linux - Newbie 5 07-06-2004 08:00 AM
php4 make/install error BobNz Linux - Software 0 05-03-2004 12:02 AM
apache && php4 err DaFrEQ Linux - Software 0 01-17-2003 03:39 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration