LinuxQuestions.org
Social Bookmarking all things Linux and Open Source
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris and OpenSolaris.
General Sun, SunOS and Sparc related questions also go here.

Notices

Reply
 
Thread Tools
Old 03-13-2009, 03:34 AM   #1
rajaniyer123
Member
 
Registered: Feb 2004
Location: BARODA, GUJARAT
Posts: 172
Thanked: 0
Error while starting Apache with PHP


[Log in to get rid of this advertisement]
HI

I have to implement Media Wiki on SOlaris 10 Server. In the same ref I have installed all the packages of PHP, Apache & Mysql.

Now after adding below entry in httpd.conf while starting apache it gives error.

httpd: Syntax error on line 113 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


I am able to start apache and view the test page by commenting php optiosn mentioned below.


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


Please suggest


Thanks
Rajan
rajaniyer123 is offline     Reply With Quote
Old 03-13-2009, 04:16 AM   #2
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 5,044
Thanked: 224
You don't have the gd ibrary installed.
How did you install php? If you have compile it from source you missed the "--with-gd" option. If you used the php package from sunfreeware you have to install also all the dependencies listed there.

Regards
bathory is offline     Reply With Quote
Old 03-13-2009, 05:20 AM   #3
rajaniyer123
Member
 
Registered: Feb 2004
Location: BARODA, GUJARAT
Posts: 172
Thanked: 0

Original Poster
Hi

I have installed from pkg format.

Also I have verified of all dependence packages, which were already installed as per Sun Freeware Site. Also the file /usr/local/lib/libgd.so.2 is there in specific location with proper permissions.

Thanks
Rajan
rajaniyer123 is offline     Reply With Quote
Old 03-13-2009, 05:42 AM   #4
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 5,044
Thanked: 224
To me it looks like an incompatibility between php and gd, or gd and libpng.
Which php version have you used? If you used the 5.2.6, try the older one 5.2.1 and see if it works. Of course you should uninstall first the installed php.
bathory is offline     Reply With Quote
Thanked by:
Old 03-14-2009, 01:28 PM   #5
rajaniyer123
Member
 
Registered: Feb 2004
Location: BARODA, GUJARAT
Posts: 172
Thanked: 0

Original Poster
Hi

Hi

Thanks for your great help !!!!!!!!!!!!

I have removed libpng now it works fine for me.

Thanks
Rajan
rajaniyer123 is offline     Reply With Quote
Old 04-07-2009, 07:21 AM   #6
ZignatZ
LQ Newbie
 
Registered: Apr 2009
Posts: 7
Thanked: 0
Hi everyone. REALLY sorry for the bump, but I have the same problem. This PHP is driving me crazy...

I'm trying to install MediaWiki on a Solaris 10 server too. I downloaded PHP 5.2.6 and Apache 2.2.11 and all their dependencies from sunfreeware.com. Long story short: I get the same error message as Rajan did when I add the LoadModule line to httpd.conf.

I tried removing the libpng package, but then Apache tells me that the ADI module structure 'php5_module' in the libphp5.so file is garbled and that it got a different signature than expected. The error probably means that libpng is missing, since I removed it...

Also, according to every Wiki installation guide, php.ini has to be copied to /etc/apache2 and that libphp5.so should be in /usr/apache2/libexec, but on sunfreeware it says that php.ini should be copied to /usr/local/php/lib and libphp5.so to /usr/local/apache2/modules, and the LoadModule line should use libphp5.so from the modules folder instead of libexec.
When I copy the files and change httpd.conf according to what's on sunfreeware, when I try to view html pages they appear blank. PHP pages appear blank too, with a 'Save File' dialog.

Thanks.
ZignatZ is offline     Reply With Quote
Old 04-07-2009, 07:57 AM   #7
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 5,044
Thanked: 224
Check httpd.conf to see if you have the following line:
Code:
AddType application/x-httpd-php .php
bathory is offline     Reply With Quote
Old 04-07-2009, 08:39 AM   #8
ZignatZ
LQ Newbie
 
Registered: Apr 2009
Posts: 7
Thanked: 0
I have it. Added it, along with the LoadModule line.
ZignatZ is offline     Reply With Quote
Old 04-07-2009, 08:58 AM   #9
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 5,044
Thanked: 224
If apache prompts you to save the php page, them it does not know how to handle .php files. Did you restart apache after editing httpd.conf?
Take a look also at error_log ot see if you find anything.
bathory is offline     Reply With Quote
Old 04-07-2009, 09:18 AM   #10
ZignatZ
LQ Newbie
 
Registered: Apr 2009
Posts: 7
Thanked: 0
Yeah, I restart apache every time I change something in httpd.conf. I get the same error as Rajan (That's kinda why I posted here instead of creating a new thread):

Quote:
Originally Posted by rajaniyer123 View Post
httpd: Syntax error on line 113 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
ZignatZ is offline     Reply With Quote
Old 04-07-2009, 10:08 AM   #11
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 5,044
Thanked: 224
Do you have libpng installed? What is the output of
Code:
pkginfo |grep png
ldd /usr/local/lib/libgd.so.2.0.0
bathory is offline     Reply With Quote
Old 04-11-2009, 11:23 AM   #12
mikeseungoh
LQ Newbie
 
Registered: Apr 2009
Posts: 1
Thanked: 0
Quote:
Originally Posted by bathory View Post
Do you have libpng installed? What is the output of
Code:
pkginfo |grep png
ldd /usr/local/lib/libgd.so.2.0.0
I'm sorry to jump in but i have exactly the same problem. I got php and all dependent software from sunfreeware on solaris 9.
I ran your commands and got the following:

application SMClibpng libpng
system SUNWpng PNG - Portable Network Graphics library


# ldd /usr/local/lib/libgd.so.2.0.0
libXpm.so.4 => /usr/lib/libXpm.so.4
libX11.so.4 => /usr/lib/libX11.so.4
libjpeg.so.62 => /usr/local/lib/libjpeg.so.62
libfontconfig.so.1 => /usr/local/lib/libfontconfig.so.1
libfreetype.so.6 => /usr/local/lib/libfreetype.so.6
libpng12.so.0 => /usr/local/lib/libpng12.so.0
libz.so => /usr/local/lib/libz.so
libm.so.1 => /usr/lib/libm.so.1
libc.so.1 => /usr/lib/libc.so.1
libXext.so.0 => /usr/openwin/lib/libXext.so.0
libsocket.so.1 => /usr/lib/libsocket.so.1
libnsl.so.1 => /usr/lib/libnsl.so.1
libdl.so.1 => /usr/lib/libdl.so.1
libexpat.so.0 => /usr/local/lib/libexpat.so.0
libgcc_s.so.1 => /usr/local/lib/libgcc_s.so.1
libiconv.so.2 => /usr/local/lib/libiconv.so.2
libmp.so.2 => /usr/lib/libmp.so.2
/usr/platform/SUNW,Sun-Fire-280R/lib/libc_psr.so.1

Thank you in advance for your help.
mikeseungoh is offline     Reply With Quote
Old 04-11-2009, 12:37 PM   #13
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 5,044
Thanked: 224
Here is the output of pkginfo for Sol10:
Quote:
pkginfo|grep png
GNOME2 SUNWpng Portable Network Graphics library
GNOME2 SUNWpng-devel Portable Network Graphics library - developer files
GNOME2 SUNWpng-devel-share Portable Network Graphics library - developer files - /usr/shar
As you see you miss the devel package, so I guess your best bet is to remove the png package (the SMClibpng from sunfreeware) and install the latest sources from libpng, using "/usr/local" in the ./configure script as a prefix:
Code:
./configure --prefix=/usr/local

Last edited by bathory; 04-11-2009 at 01:55 PM..
bathory is offline     Reply With Quote
Old 04-19-2009, 12:42 AM   #14
ZignatZ
LQ Newbie
 
Registered: Apr 2009
Posts: 7
Thanked: 0
Sorry for taking a long time to reply, I didn't have access to my server in the past two weeks/
Anyway, just ran the pkginfo you asked and I DO have the devel pkgs. Both of them.
ZignatZ is offline     Reply With Quote
Old 04-19-2009, 04:18 AM   #15
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 5,044
Thanked: 224
You have to uninstall the libpng package (SMClibpng) provided by Sunfreeware and use only the SUNWpng* from installation.

Regards
bathory is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

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
issue with starting Apache after php recompile lightpace Fedora 2 10-12-2007 05:26 PM
Proplems starting apache with php wisdom Linux - Software 1 11-17-2006 10:48 PM
Initial PHP configuration after starting MySQL and Apache studioq Linux - Newbie 2 09-28-2006 12:23 AM
Error starting Apache buddhahat Slackware 3 06-13-2005 09:59 PM
Error when starting Apache undefined symbol: __db_ndbm_fetch_4002 SimonT Debian 2 10-03-2004 01:10 AM


All times are GMT -5. The time now is 07:49 PM.

Main Menu
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
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration