Apache2 PHP5 not starting

Hello all. I have a Solaris 10/Sun Ultra10 box and I am trying to build a SAMP server.

The MySQL portion is working and Apache2 seems to be working. However after installing PHP5 I get the following error:

# ./apachectl start
httpd: Syntax error on line 115 of /usr/local/apache2/conf/httpd.conf: Cannot load /usr/local/apache2/modules/libphp5.so into server: ld.so.1: httpd: fatal: libmysqlclient.so.15: open failed: No such file or directory
# cd /usr/local/apache2/modules
# ls -l libphp5.so
-rwxr-xr-x 1 bin bin 7157740 Sep 28 2008 libphp5.so

The crazy thing is, the file libphp5.so is there in the /modules directory as the output shows.

Google is not very helpful. I was wondering if anyone here might have some ideas as to why I am getting this when trying to restart Apache.

I have the following two lines in my httpd.conf file to load php:

LoadModule php5_module modules/libphp5.so
AddType application/x-httpd-php .php

Thank you for your thoughts.
~Robert

It is complaining on being unable to load the mysql dynamic library. Check that the file exists on your system and verify with commands such as ldd (not sure if exists on Solaris).

I think you are correct here is the ldd output from the php/bin directory:

/usr/local/php/bin
# ldd php
<deleted above output>
libmysqlclient.so.15 => (file not found)

I searched for the file:

# find / -name "libmysqlclient.so.15" -print
/usr/local/apache2/modules/libmysqlclient.so.15
/opt/mysql/mysql/lib/libmysqlclient.so.15
#

I copied it over to the apache2/modules directory from /opt/mysql/mysql/lib and still Apache is not seeing it.

The file exists on my system, how do I make Apache "see" it?

(Sorry if this is a newbie question)

Thank you for you help!

No, don't put it in the apache modules. Put a link (a copy) at the system library directory that is on the search path.

Use crle(1) to check what are on the search path.

use crle for a more permanent solution or you can quickly assign your $LD_LIBRARY_PATH variable to where this library is residing.

cbkihong:

I really appreciate all of your help! Here is what I have done, I have added a link in my /usr/lib directory to point to the libmysqlclient.so.15 file.

lrwxrwxrwx 1 root root 41 Apr 23 06:47 libmysqlclient.so.15 -> /opt/mysql/mysql/lib/libmysqlclient.so.15

Now when attempting to start apache I get the following:

/usr/local/apache2/bin>./apachectl start
httpd: Syntax error on line 114 of /usr/local/apache2/conf/httpd.conf: Cannot load /usr/local/apache2/modules/libphp5.so into server: ld.so.1: httpd: fatal: relocation error: file /usr/local/lib/libgd.so.2: symbol png_get_error_ptr: referenced symbol not found
/usr/local/apache2/bin>

I looks like the libgd is now complaining.

I did some reading on crle and I entered the following:

# crle -l /lib -l /usr/lib -l /opt/mysql/mysql/lib

I did a system reboot and tried to start apache again. It looks like I get the same libgd error:

Cannot load /usr/local/apache2/modules/libphp5.so into server: ld.so.1: httpd: fatal: relocation error: file /usr/local/lib/libgd.so.2: symbol png_get_error_ptr: referenced symbol not found

Thanks again guys for your help!

It looks like the /usr/local/lib/libgd.so.2 library file you have is not up to date enough and therefore does not include the symbol required. If you do an "ls -l of /usr/local/lib/libgd.so.2" you may find it a link to a library with more version information, e.g. /usr/local/lib/libgd.so.2.0.1, you can then locate a more up to date version and move the "/usr/local/lib/libgd.so.2" link to point to the newer version.

Tony, thanks I'll give that a try.

Here is a ls -l from /usr/local/lib

# cd /usr/local/lib
# ls -l libgd.*
-rw-r--r-- 1 bin bin 280944 Jan 17 2008 libgd.a
-rwxr-xr-x 1 bin bin 1201 Jan 17 2008 libgd.la
lrwxrwxrwx 1 root root 14 Apr 22 15:08 libgd.so -> libgd.so.2.0.0
lrwxrwxrwx 1 root root 14 Apr 22 15:08 libgd.so.2 -> libgd.so.2.0.0
-rwxr-xr-x 1 bin bin 266848 Jan 17 2008 libgd.so.2.0.0

Guess I get to go looking for something more recent.

Is your PHP precompiled or compiled by you? I think it would be easier for others to help if you tell us how you got that PHP installed.

Hello all. Apologies for not following-up sooner. Family responsibilities kind of took over.

I finally got Apache and PHP to work together.

I was using precompiled packages of Apache 2.2.11 and PHP 5.2.6. When I could not get Apache and PHP to work together I uninstalled the PHP package and compiled it myself with the following options:

./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql

For the most part this is working. However when I POST data that involves writing to a MySQL table, the POSTING PHP script runs VERY slowly.

I think this maybe a cURL issue.

But anyway, thank you all for your help!
~Robert