Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
php 5.1.2 cli segfault [solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
cdf
n00b
n00b


Joined: 30 Apr 2005
Posts: 40
Location: Southern California

PostPosted: Thu Mar 16, 2006 8:59 pm    Post subject: php 5.1.2 cli segfault [solved] Reply with quote

Just upgraded to php 5.1.2 yesterday. Today I noticed cli isn't working. I get the following errors:

Code:
# php -v
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/lib/php/extensions/no-debug-zts-20050922/openssl.so' - /usr/lib/php5/lib/php/extensions/no-debug-zts-20050922/openssl.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/lib/php/extensions/no-debug-zts-20050922/zip.so' - /usr/lib/php5/lib/php/extensions/no-debug-zts-20050922/zip.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP 5.1.2-gentoo (cli) (built: Mar 16 2006 12:20:00)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
Segmentation fault


Neither zip.so nor openssl.so exist in the directories it's looking for them. But there are over a dozen other extensions which seem to be working fine. I didn't change php.ini or any USE flags either.

I ran revdep-rebuild and nothing came up. I re-emerged php5 anyway but still the same problem.

I'm out of ideas. :-( Can anyone help?


Last edited by cdf on Mon May 01, 2006 9:48 pm; edited 1 time in total
Back to top
View user's profile Send private message
kashani
Advocate
Advocate


Joined: 02 Sep 2002
Posts: 2032
Location: San Francisco

PostPosted: Thu Mar 16, 2006 9:15 pm    Post subject: Reply with quote

If you're using the 2006.0 profile, +fastbuild was added to dev-lang/php. Instead of building the module and the cli seperately it attempts to build them at the same time. You may want to specify -fastbuild and rebuild assuming any of this applies.

You might also try deleting the zip.ini and openssl.ini that are int he /etc/php dirs... I'd had issues with them in the past.

kashani
_________________
Will personally fix your server in exchange for motorcycle related shop tools in good shape.
Back to top
View user's profile Send private message
cdf
n00b
n00b


Joined: 30 Apr 2005
Posts: 40
Location: Southern California

PostPosted: Thu Mar 16, 2006 9:24 pm    Post subject: on the right track... Reply with quote

Deleted:

Code:
/etc/php/cli-php5/ext/openssl.ini
/etc/php/cli-php5/ext/zip.ini
/etc/php/cli-php5/ext-active/openssl.ini
/etc/php/cli-php5/ext-active/zip.ini

And now I don't get the errors about failed extensions. :-) However, it still says "Segmentation fault" after executing my script. Example script test.php:
Code:
#!/usr/bin/php
<?php
echo "Hello world.";
?>

But I get:
Code:
# php test.php
Hello world.Segmentation fault


Any further ideas? At least it will run my scripts now...
Back to top
View user's profile Send private message
kashani
Advocate
Advocate


Joined: 02 Sep 2002
Posts: 2032
Location: San Francisco

PostPosted: Thu Mar 16, 2006 9:31 pm    Post subject: Reply with quote

what's an emerge -pv dev-lang/php look like?

kashani
_________________
Will personally fix your server in exchange for motorcycle related shop tools in good shape.
Back to top
View user's profile Send private message
cdf
n00b
n00b


Joined: 30 Apr 2005
Posts: 40
Location: Southern California

PostPosted: Thu Mar 16, 2006 9:42 pm    Post subject: emerge output Reply with quote

Code:
[ebuild   R   ] dev-lang/php-5.1.2  USE="apache2 bcmath berkdb bzip2 cjk cli crypt curl dba exif ftp gd gdbm iconv imap ldap mysql mysqli ncurses nls pcntl pcre posix readline sasl session sharedext simplexml sockets ssl threads tidy truetype xml xmlrpc xpm xsl zip zlib -adabas -apache -birdstep -calendar -cdb -cgi -ctype -curlwrappers -db2 -dbase -dbmaker -debug -discard-path -doc -empress -empress-bcs -esoob -fastbuild -fdftk -filepro -firebird -flatfile -force-cgi-redirect -frontbase -gd-external -gmp -hardenedphp -hash -hyperwave-api -informix -inifile -interbase -iodbc -ipv6 -java-external -kerberos -libedit -mcve -memlimit -mhash -ming -msql -mssql -oci8 -oci8-instant-client -odbc -pdo -pdo-external -pic -postgres -qdbm -recode -reflection -sapdb -sharedmem -snmp -soap -solid -spell -spl -sqlite -sybase -sybase-ct -sysvipc -tokenizer -vm-goto -vm-switch -wddx -xmlreader -xmlwriter -yaz" 0 kB

Total size of downloads: 0 kB
Back to top
View user's profile Send private message
cdf
n00b
n00b


Joined: 30 Apr 2005
Posts: 40
Location: Southern California

PostPosted: Fri Mar 17, 2006 3:27 am    Post subject: cgi-mode stopped working too! downgraded. Reply with quote

Things got even stranger. I was working on some PHP stuff through CGI/Apache and suddenly all PHP scripts would die without writing any output. I could live with segfaulting CLI but not CGI mode! So I downgraded.

Code:
# echo dev-lang/php-5.2.1 >> /etc/portage/package.mask
# emerge -v1a dev-lang/php


I'm back to 5.0.x now and things are working fine, both CLI and CGI.

But thanks for trying to help, Kashani. :-)
Back to top
View user's profile Send private message
kashani
Advocate
Advocate


Joined: 02 Sep 2002
Posts: 2032
Location: San Francisco

PostPosted: Fri Mar 17, 2006 4:03 am    Post subject: Reply with quote

It's possible that threads are causing you issues, I missed that before. In any here are the use flags I use with 5.1.2. recode and readline seemed to be problematic for me in 5.1.1 which is why they are still out.

dev-lang/php -fastbuild -force-cgi-redirect -readline -recode -soap -threads bcmath cli ctype curl dba exif flatfile gd hardenedphp hash iconv libedit jpeg mhash mysql pcre pdo pear posix session simplexml spl tiff tokenizer truetype xml xmlrpc xsl zlib

kashani
_________________
Will personally fix your server in exchange for motorcycle related shop tools in good shape.
Back to top
View user's profile Send private message
cdf
n00b
n00b


Joined: 30 Apr 2005
Posts: 40
Location: Southern California

PostPosted: Fri Mar 17, 2006 4:24 am    Post subject: thanks Reply with quote

Thanks again. I'll try to remember that next time I upgrade. :-)
Back to top
View user's profile Send private message
kashani
Advocate
Advocate


Joined: 02 Sep 2002
Posts: 2032
Location: San Francisco

PostPosted: Fri Mar 17, 2006 5:06 am    Post subject: Reply with quote

For the hell of it and since I'm playing with PHP USE flags trying to get a smaller binary I pulled libedit out and added in readline. Still works fine for me... ah well.

kashani
_________________
Will personally fix your server in exchange for motorcycle related shop tools in good shape.
Back to top
View user's profile Send private message
cappaberra
Tux's lil' helper
Tux's lil' helper


Joined: 24 Aug 2003
Posts: 77
Location: California, USA

PostPosted: Mon Mar 20, 2006 6:44 pm    Post subject: Reply with quote

I'm having the same issues... I'm going to play with this a bit and see if I can figure it out.

-cappaberra
Back to top
View user's profile Send private message
Aries-Belgium
l33t
l33t


Joined: 08 Jul 2005
Posts: 730
Location: Willebroek, Belgium

PostPosted: Sat Apr 01, 2006 5:05 pm    Post subject: Reply with quote

I just had the same problem and I would like to share the solution with you guys:
I got the error that zip.so wasn't found, so I checked portage to see what package zip.so belongs to:
Code:
equery belongs zip.so

Found out that it was dev-php5/pecl-zip
I emerged it again and the error was resolved ...

I hope this is helpfull for you ...
_________________
Ep2.nl | Developers Community
Back to top
View user's profile Send private message
cappaberra
Tux's lil' helper
Tux's lil' helper


Joined: 24 Aug 2003
Posts: 77
Location: California, USA

PostPosted: Sun Apr 09, 2006 3:02 am    Post subject: Reply with quote

Here's what my errors look like:
Code:
user@linuxbox$ php -v
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/lib/php/extensions/no-debug-zts-20050922/openssl.so' - /usr/lib/php5/lib/php/extensions/no-debug-zts-20050922/openssl.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/lib/php/extensions/no-debug-zts-20050922/xmlreader.so' - /usr/lib/php5/lib/php/extensions/no-debug-zts-20050922/xmlreader.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP 5.1.2-gentoo (cli) (built: Mar 19 2006 21:11:06)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
user@linuxbox$

After executing the equery commands, here's the result:
Code:
user@linuxbox$ equery belongs xmlreader.so
[ Searching for file(s) xmlreader.so in *... ]
user@linuxbox$ equery belongs openssl.so
[ Searching for file(s) openssl.so in *... ]
dev-lang/ruby-1.8.4-r1 (/usr/lib/ruby/1.8/i686-linux/openssl.so)
user@linuxbox$

I re-emerged ruby, but that didn't help... :-\ I tried running the above commands as root too and that didn't make a difference. Any other suggestions to help with openssl or xmlreader? I'm thinking about re-emerging php with xmlreader disabled since I never use it... but I need openssl. Ideas? Thoughts? Best wishes? Free beer? ;-)
Back to top
View user's profile Send private message
cappaberra
Tux's lil' helper
Tux's lil' helper


Joined: 24 Aug 2003
Posts: 77
Location: California, USA

PostPosted: Sun Apr 09, 2006 3:57 am    Post subject: Reply with quote

hmm... just found a related thread. Very interesting indeed... check it out!

https://forums.gentoo.org/viewtopic-t-428132-highlight-nodebugzts20050922.html

-cappaberra
Back to top
View user's profile Send private message
llongi
Retired Dev
Retired Dev


Joined: 15 Apr 2004
Posts: 459
Location: Switzerland

PostPosted: Wed Apr 12, 2006 11:31 am    Post subject: Reply with quote

@cappaberra: your two errors actually come I think from two different issues.

The first, the one about openssl.so, is because with PHP 5.1.2, we've made the openssl extension to never be shared and to always be compiled directly in the PHP binary, since it was causing problems when shared. Now Portage never deletes/changes files in /etc, and those files are the ones that control which PHP extensions shall get loaded or not, so there still is the file that says "load the shared openssl extension", but the extension itself doesn't anymore exist. Just execute the following to fix that:
Code:
rm -f /etc/php/*-php5/ext-active/openssl.ini && rm -f /etc/php/*-php5/ext/openssl.ini


For the xmlreader issue, the causes can be two. If you compiled PHP 5.1.2 with the "xmlreader" USE flag disabled, then the problem is the same as above and just removing the files as above (xmlreader.ini instead of openssl.ini) should solve it.
If this is not the case, the other cause could be that your extension_dir value in php.ini doesn't match the real one (this can happen if you don't etc-update correctly, or sometimes with dispatch-conf it seems). Check what the directory on your system really is (ls /usr/lib/php5/lib/php/extensions/), see the name of the directory there, and check if it's the same you see as extension_dir value in your PHP5's php.inis.
_________________
Best regards, Luca.
Back to top
View user's profile Send private message
cappaberra
Tux's lil' helper
Tux's lil' helper


Joined: 24 Aug 2003
Posts: 77
Location: California, USA

PostPosted: Wed Apr 12, 2006 2:19 pm    Post subject: Reply with quote

CHTEKK, thanks for your response! Your detailed explanation does sound correct. Just deleting the files does solve the problem, and I checked my extensions directory many-a-time and it is correct.. Is there any documentation somewhere about what previous dynamic extensions are now compiled into the binary?

Thanks,
cappaberra
Back to top
View user's profile Send private message
llongi
Retired Dev
Retired Dev


Joined: 15 Apr 2004
Posts: 459
Location: Switzerland

PostPosted: Wed Apr 12, 2006 7:26 pm    Post subject: Reply with quote

cappaberra wrote:
Is there any documentation somewhere about what previous dynamic extensions are now compiled into the binary?


No, not really. Watch planet.gentoo.org where I normally announce big changes to the PHP packages, as well as upcoming updates etc. on my blog, in the future it's planned to create an utility that should help to ease the management of turning extensions on/off, and that checks which extensions really exist/are available and disables the ones that are not (basically a tool to manage the symlinks from ext-active/ to ext/).
_________________
Best regards, Luca.
Back to top
View user's profile Send private message
cdf
n00b
n00b


Joined: 30 Apr 2005
Posts: 40
Location: Southern California

PostPosted: Mon May 01, 2006 9:47 pm    Post subject: removed tidy => working now Reply with quote

Taking a wild guess based on another forum thread, I removed the 'tidy' USE flag and recompiled, and the segfault went away. I had to remove the tidy.ini files inside /etc/php/*-php5/* however. Portage didn't remove them automatically (due to /etc being protected?).
Back to top
View user's profile Send private message
dfannin
n00b
n00b


Joined: 04 May 2003
Posts: 13
Location: Northern California

PostPosted: Mon Jun 05, 2006 7:17 pm    Post subject: Reply with quote

I was seeing the same problem with both php4/5 (running as cgi builds in apache2). PHP page performance was deathly slow , and the apache error log was showing:
Code:

[Mon Jun 05 12:03:07 2006] [error] [client 192.168.10.3] PHP Warning:  Unknown(): Unable to load dynamic library '/usr/lib/php4/lib/php/extensions/no-debug-zts-20020429/ldap.so' - /usr/lib/php4/lib/php/extensions/no-debug-zts-20020429/ldap.so: cannot open shared object file: No such file or directory in Unknown on line 0
[Mon Jun 05 12:03:10 2006] [error] [client 192.168.10.3] PHP Warning:  Unknown(): Unable to load dynamic library '/usr/lib/php4/lib/php/extensions/no-debug-zts-20020429/openssl.so' - /usr/lib/php4/lib/php/extensions/no-debug-zts-20020429/opelnssl.so: cannot open shared object file: No such file or directory in Unknown on line 0


An easy way to see this is to run php -v using the cli command.


I deleted the related .ini files for ldap and openssl by using the follwing commands:

Code:

rm -i /etc/php/*php*/ext-active/openssl.ini
rm -i /etc/php/*php*/ext/openssl.ini
rm -i /etc/php/*php*/ext-active/ldap.ini
rm -i /etc/php/*php*/ext/ldap.ini


This cleared the error messages, but I am still getting slow performace (but no error messages). revdep-rebuild didn't catch anything,
I also recompiled php5 without tidy (-tidy). Apache now starts, but php4 is still very low on initalization.

WTF! I wish the php folks had given a heads up around this change. This will cause a lot of working systems to break.
Back to top
View user's profile Send private message
su
n00b
n00b


Joined: 09 Jan 2007
Posts: 4
Location: South Africa

PostPosted: Mon Mar 19, 2007 11:03 am    Post subject: Reply with quote

Aries-Belgium wrote:
I just had the same problem and I would like to share the solution with you guys:
I got the error that zip.so wasn't found, so I checked portage to see what package zip.so belongs to:
Code:
equery belongs zip.so

Found out that it was dev-php5/pecl-zip
I emerged it again and the error was resolved ...

I hope this is helpfull for you ...


I have the same thing, but with php-5.2.1-r3 and pecl-fileinfo

When trying to remerge 'fileinfo', however, I get the following compile errors:

Code:
....
 i686-pc-linux-gnu-gcc -I. -I/var/tmp/portage/pecl-fileinfo-1.0.3/work/Fileinfo-1.0.3 -DPHP_ATOM_INC -I/var/tmp/portage/pecl-fileinfo-1.0.3/work/Fileinfo-1.0.3/include -I/var/tmp/portage/pecl-fileinfo-1.0.3/work/Fileinfo-1.0.3/main -I/var/tmp/portage/pecl-fileinfo-1.0.3/work/Fileinfo-1.0.3 -I/usr/lib/php5/include/php -I/usr/lib/php5/include/php/main -I/usr/lib/php5/include/php/TSRM -I/usr/lib/php5/include/php/Zend -I/usr/lib/php5/include/php/ext -I/usr/lib/php5/include/php/ext/date/lib -DHAVE_CONFIG_H -O3 -march=pentium4 -funroll-loops -pipe -c /var/tmp/portage/pecl-fileinfo-1.0.3/work/Fileinfo-1.0.3/fileinfo.c  -fPIC -DPIC -o .libs/fileinfo.o
/var/tmp/portage/pecl-fileinfo-1.0.3/work/Fileinfo-1.0.3/fileinfo.c:124:42: macro "ZEND_ME_MAPPING" requires 4 arguments, but only 3 given
/var/tmp/portage/pecl-fileinfo-1.0.3/work/Fileinfo-1.0.3/fileinfo.c:125:49: macro "ZEND_ME_MAPPING" requires 4 arguments, but only 3 given
/var/tmp/portage/pecl-fileinfo-1.0.3/work/Fileinfo-1.0.3/fileinfo.c:125: error: `ZEND_ME_MAPPING' undeclared here (not in a function)
/var/tmp/portage/pecl-fileinfo-1.0.3/work/Fileinfo-1.0.3/fileinfo.c:125: error: initializer element is not constant
/var/tmp/portage/pecl-fileinfo-1.0.3/work/Fileinfo-1.0.3/fileinfo.c:125: error: (near initialization for `finfo_class_functions[0]')
/var/tmp/portage/pecl-fileinfo-1.0.3/work/Fileinfo-1.0.3/fileinfo.c:125: error: syntax error before "ZEND_ME_MAPPING"
/var/tmp/portage/pecl-fileinfo-1.0.3/work/Fileinfo-1.0.3/fileinfo.c:126:41: macro "ZEND_ME_MAPPING" requires 4 arguments, but only 3 given
/var/tmp/portage/pecl-fileinfo-1.0.3/work/Fileinfo-1.0.3/fileinfo.c:127:45: macro "ZEND_ME_MAPPING" requires 4 arguments, but only 3 given
/var/tmp/portage/pecl-fileinfo-1.0.3/work/Fileinfo-1.0.3/fileinfo.c:128: error: initializer element is not constant
/var/tmp/portage/pecl-fileinfo-1.0.3/work/Fileinfo-1.0.3/fileinfo.c:128: error: (near initialization for `finfo_class_functions[1]')
/var/tmp/portage/pecl-fileinfo-1.0.3/work/Fileinfo-1.0.3/fileinfo.c:129: error: syntax error before '}' token
make: *** [fileinfo.lo] Error 1

!!! ERROR: dev-php5/pecl-fileinfo-1.0.3 failed.
Call stack:
  ebuild.sh, line 1546:   Called dyn_compile
  ebuild.sh, line 937:   Called src_compile
  ebuild.sh, line 1255:   Called php-ext-pecl-r1_src_compile
  php-ext-pecl-r1.eclass, line 38:   Called php-ext-source-r1_src_compile
  php-ext-source-r1.eclass, line 49:   Called die

!!! Unable to make code
!!! If you need support, post the topmost build error, and the call stack if relevant.


Any help? Much appreciated, thank you.
Back to top
View user's profile Send private message
su
n00b
n00b


Joined: 09 Jan 2007
Posts: 4
Location: South Africa

PostPosted: Mon Mar 19, 2007 12:16 pm    Post subject: Reply with quote

Never mind. I came right installing pecl-fileinfo-1.0.4 instead using 'ACCEPT_KEYWORDS="~x86"'

Thanks anyway for all the pointers in this thread, it at least led me in the right direction.

Ciao.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum