php5-filter problem "Undefined symbol "php_pcre_exec"

zzatskl

Member

Thanks: 1
Messages: 46

#1
I have been trying to install Drupal 7 (D7) for sometime, so I deleted all the packages on my server and did a fresh install of all the ports.
Code:
Apache/2.2.21 (FreeBSD 8.1p6) mod_ssl/2.2.21 OpenSSL/0.9.8n DAV/2 PHP/5.3.8 with Suhosin-Patch
However, on running the D7 install.php in Firefox I get to the final button and it fails with this message in httpd-error.log:
Code:
/libexec/ld-elf.so.1: /usr/local/lib/php/20090626/filter.so: Undefined symbol "php_pcre_exec"
My extensions.ini file contains:
Code:
extension=ctype.so
extension=mysql.so
extension=session.so
extension=mbstring.so
extension=json.so
extension=bz2.so
extension=gd.so
extension=openssl.so
extension=pdf.so
extension=zlib.so
extension=mcrypt.so
extension=zip.so
extension=apc.so
extension=mysqli.so
extension=dom.so
extension=hash.so
extension=pdo.so
extension=pdo_mysql.so
extension=xml.so
extension=simplexml.so
extension=uploadprogress.so
extension=xmlwriter.so
extension=filter.so
I have reinstalled the php5-filter port (hence position at the bottom). Investingating further:
Code:
%pkg_info -W /usr/local/lib/php/20090626/filter.so
/usr/local/lib/php/20090626/filter.so was installed by package php5-filter-5.3.8
%
The other odd thing that happens when I press the last button during install.php is that a Firefox popup window comes up
Code:
You have chosen to open
install.php
which is a: PHP Script
from: [url]http://myD7site.domain[/url]
What should Firefox do with this file.....
Because the server is running various websites I didn't delete httpd.conf nor any other system or port configuration files. Could this be my problem? I have sucessfully installed D7 on a clean development server install of FreeBSD.
I'm at a loss now so any guidance would be very much appreciated.
 
OP
OP
zzatskl

zzatskl

Member

Thanks: 1
Messages: 46

#3
Thanks, but it appears to be for an older version of php than the 5.3.8 installed. I tried, first deinstalled php5-filter-5.3.8 then:
Code:
%pwd
/usr/ports/security/php52-filter
%make install clean
===>  php52-filter-5.2.17_3 cannot install: doesn't work with PHP version : 5 (Doesn't support PHP 4 5).
*** Error code 1

Stop in /usr/ports/security/php52-filter.
%
Looking at both versions Makefile, the creation date for php52-filter is 17 April 2010, while the apparent later version (?) php5-filter-5.3.8 is 10 Dec 2008. I'm confused:\. As mentioned I have php5-filter-5.3.8 working fine for D7 on a fresh install of FreeBSD for a development server.
Still scratching my head, any other ideas more than welcome please.
 

Abriel

Active Member

Thanks: 23
Messages: 119

#4
i would uninstall all extensions from
Code:
cd /usr/ports/lang/php5-extensions
make deinstall clean
then
Code:
portupgrade lang/php5-extensions
make config
select filter and install one more time
Code:
portmanager lang/php5-extensions
or
Code:
portupgrade security/php5-filter
and reinstall
i checked drupal on my system and it works.
 

Carpetsmoker

Daemon

Thanks: 180
Messages: 1,010

#5
Abriel said:
Try install
Code:
/usr/ports/security/php52-filter
i think it's newer.
This is PHP 5.2, zzatskl is running 5.3, so this is wrong.

Can you give me a list of all the ports you have installed? You can get it by running the % pkg_info command without arguments.
 
OP
OP
zzatskl

zzatskl

Member

Thanks: 1
Messages: 46

#6
Please find a list of my packages below (just enough to run my web services):
Code:
%pkg_info
apache-2.2.21       Version 2.2.x of Apache web server with prefork MPM.
apr-ipv6-devrandom-gdbm-db42-1.4.5.1.3.12_1 Apache Portability Library
autoconf-2.68       Automatically configure source code on many Un*x platforms
autoconf-wrapper-20101119 Wrapper script for GNU autoconf
automake-1.11.1     GNU Standards-compliant Makefile generator (1.11)
automake-wrapper-20101119 Wrapper script for GNU automake
awstats-7.0_2,1     Free real-time logfile analyzer to get advanced web statist
bigreqsproto-1.1.1  BigReqs extension headers
ca_root_nss-3.12.11_1 The root certificate bundle from the Mozilla Project
cmake-2.8.4_2       A cross-platform Makefile generator
curl-7.21.3_2       Non-interactive tool to get files from FTP, GOPHER, HTTP(S)
db42-4.2.52_5       The Berkeley DB package, revision 4.2
dovecot-1.2.17      Secure and compact IMAP and POP3 servers
expat-2.0.1_2       XML 1.0 parser written in C
freetype2-2.4.6     A free and portable TrueType font rendering engine
gdbm-1.9.1          The GNU database manager
gettext-0.18.1.1    GNU gettext package
gmake-3.82          GNU version of 'make' utility
help2man-1.40.4     Automatically generating simple manual pages from program o
inputproto-2.0.2    Input extension headers
jpeg-8_3            IJG's jpeg compression utilities
kbproto-1.0.5       KB extension headers
libICE-1.0.7,1      Inter Client Exchange library for X11
libSM-1.2.0,1       Session Management library for X11
libX11-1.4.4,1      X11 library
libXau-1.0.6        Authentication Protocol library for X11
libXaw-1.0.8,1      X Athena Widgets library
libXdmcp-1.1.0      X Display Manager Control Protocol library
libXext-1.3.0_1,1   X11 Extension library
libXmu-1.1.0,1      X Miscellaneous Utilities libraries
libXp-1.0.1,1       X print library
libXpm-3.5.9        X Pixmap library
libXt-1.0.9         X Toolkit library
libcheck-0.9.8      A unit test framework for C
libgcrypt-1.5.0     General purpose crypto library based on code used in GnuPG
libgpg-error-1.10   Common error values for all GnuPG components
libiconv-1.13.1_1   A character set conversion library
libidn-1.22         Internationalized Domain Names command line tool
libltdl-2.4         System independent dlopen wrapper
libmcrypt-2.5.8     Multi-cipher cryptographic library (used in PHP)
libpthread-stubs-0.3_3 This library provides weak aliases for pthread functions
libsigsegv-2.10     Handling page faults in user mode
libtool-2.4         Generic shared library support script
libxcb-1.7          The X protocol C-language Binding (XCB) library
libxml2-2.7.8_1     XML parser library for GNOME
libxslt-1.1.26_3    The XSLT C library for GNOME
m4-1.4.16,1         GNU m4
mime-support-3.51.1 MIME Media Types list
mutt-1.4.2.3_6      The Mongrel of Mail User Agents (part Elm, Pine, Mush, mh,
mysql-client-5.5.15 Multithreaded SQL database (client)
mysql-server-5.5.15_1 Multithreaded SQL database (server)
oniguruma-4.7.1     A BSDL Regular Expressions library compatible with POSIX/GN
p5-Authen-PAM-0.16_1 A Perl interface to the PAM library
p5-Locale-gettext-1.05_3 Message handling functions
p5-Net-SSLeay-1.41  Perl5 interface to SSL
p5-Net-XWhois-0.90_4 Whois Client Interface for Perl5
pcre-8.13_1         Perl Compatible Regular Expressions library
pdflib-7.0.4        A C library for dynamically generating PDF
pecl-APC-3.1.9_1    Alternative PHP Cache
pecl-pdflib-2.1.8   A PECL extension to create PDF on the fly
pecl-uploadprogress-1.0.1 Provides track progress of a file upload
perl-5.12.4_2       Practical Extraction and Report Language
php5-5.3.8          PHP Scripting Language
php5-bz2-5.3.8      The bz2 shared extension for php
php5-ctype-5.3.8    The ctype shared extension for php
php5-dom-5.3.8      The dom shared extension for php
php5-filter-5.3.8   The filter shared extension for php
php5-gd-5.3.8       The gd shared extension for php
php5-hash-5.3.8     The hash shared extension for php
php5-json-5.3.8     The json shared extension for php
php5-mbstring-5.3.8 The mbstring shared extension for php
php5-mcrypt-5.3.8   The mcrypt shared extension for php
php5-mysql-5.3.8    The mysql shared extension for php
php5-mysqli-5.3.8   The mysqli shared extension for php
php5-openssl-5.3.8  The openssl shared extension for php
php5-pdo-5.3.8      The pdo shared extension for php
php5-pdo_mysql-5.3.8 The pdo_mysql shared extension for php
php5-session-5.3.8  The session shared extension for php
php5-simplexml-5.3.8 The simplexml shared extension for php
php5-xml-5.3.8      The xml shared extension for php
php5-xmlwriter-5.3.8 The xmlwriter shared extension for php
php5-zip-5.3.8      The zip shared extension for php
php5-zlib-5.3.8     The zlib shared extension for php
phpMyAdmin-3.4.5    A set of PHP-scripts to manage MySQL over the web
pkg-config-0.25_1   A utility to retrieve information about installed libraries
png-1.4.8           Library for manipulating PNG images
portaudit-0.5.17    Checks installed ports against a list of security vulnerabi
portmaster-3.10     Manage your ports without external databases or languages
portupgrade-2.4.9.3,2 FreeBSD ports/packages administration and management tool s
postfix-2.8.5,1     A secure alternative to widely-used Sendmail
printproto-1.0.5    Print extension headers
procmail-3.22_7     A local mail delivery agent
python27-2.7.2_2    An interpreted object-oriented programming language
ruby+nopthreads-1.8.7.352_2,1 An object-oriented interpreted scripting language
t1lib-5.1.2_1,1     A Type 1 Rasterizer Library for UNIX/X11
webmin-1.560_1      Web-based interface for system administration for Unix
wget-1.13.4_1       Retrieve files from the Net via HTTP(S) and FTP
xcb-proto-1.6       The X protocol C-language Binding (XCB) protocol
xcmiscproto-1.2.1   XCMisc extension headers
xextproto-7.2.0     XExt extension headers
xf86bigfontproto-1.2.0 XFree86-Bigfont extension headers
xorg-macros-1.15.0  X.Org development aclocal macros
xproto-7.0.22       X11 protocol headers
xtrans-1.2.6        Abstract network code for X
%
 

Carpetsmoker

Daemon

Thanks: 180
Messages: 1,010

#7
Hmm, at first I thought maybe you had some old version of pcre or a "FrankenPHP" installation (with PHP modules from different PHP version), but this seems Ok.

What's the output of:
# ldd /usr/local/lib/php/20090626/filter.so

And:
# ldconfig -r | grep pcre
 
OP
OP
zzatskl

zzatskl

Member

Thanks: 1
Messages: 46

#8
Hum, this all getting beyond me so thanks for the help...,
Code:
%ldd /usr/local/lib/php/20090626/filter.so
/usr/local/lib/php/20090626/filter.so:
        libc.so.7 => /lib/libc.so.7 (0x800647000)
Code:
%ldconfig -r | grep pcre
        202:-lpcre.0 => /usr/local/lib/libpcre.so.0
        203:-lpcreposix.0 => /usr/local/lib/libpcreposix.so.0
        204:-lpcrecpp.0 => /usr/local/lib/libpcrecpp.so.0
%
 
OP
OP
zzatskl

zzatskl

Member

Thanks: 1
Messages: 46

#10
Yikes, I've now got this problem shown in my httpd-error-log:
Code:
[Fri Oct 07 20:55:54 2011] [notice] child pid 76331 exit signal Segmentation fault (11), possible coredump in /usr/local
[Fri Oct 07 20:55:56 2011] [notice] child pid 76336 exit signal Segmentation fault (11), possible coredump in /usr/local
[Fri Oct 07 20:55:56 2011] [notice] child pid 76335 exit signal Segmentation fault (11), possible coredump in /usr/local
[Fri Oct 07 20:55:56 2011] [notice] child pid 76334 exit signal Segmentation fault (11), possible coredump in /usr/local
[Fri Oct 07 20:55:56 2011] [notice] child pid 76333 exit signal Segmentation fault (11), possible coredump in /usr/local
[Fri Oct 07 20:55:57 2011] [notice] child pid 76337 exit signal Segmentation fault (11), possible coredump in /usr/local
[Fri Oct 07 20:55:58 2011] [notice] child pid 76338 exit signal Segmentation fault (11), possible coredump in /usr/local
[Fri Oct 07 20:55:59 2011] [notice] child pid 76339 exit signal Segmentation fault (11), possible coredump in /usr/local
I can't see the sign of any core dump in /usr/local. I'm not sure it has been caused by any of my attempts to rebuild php-filter, as the problem appeared hours after my last efforts. All my websites are down and when I try to restart apache:
Code:
%apachectl restart
/libexec/ld-elf.so.1: /usr/local/lib/libpcre.so.0: invalid file format
%
I've rebooted the server but the new problems remain. I have never had to fix a 'Segmentatio fault' before. I can still get terminal access to the server.
They say 'sugar' happens in three's. Help anybody please :(
 
OP
OP
zzatskl

zzatskl

Member

Thanks: 1
Messages: 46

#12
My original problem in the httpd-error-log file still remains
Code:
/libexec/ld-elf.so.1: /usr/local/lib/php/20090626/filter.so: Undefined symbol "php_pcre_exec"
I have rebuilt the ports as per Post 4 above. What I find frustrating is that I have a number Drupal 6 (D6) and other PHP based websites working fine. I can even install a fresh D6 site without this php-filter problem.
Any other ideas greatly received. Thanks.
 
OP
OP
zzatskl

zzatskl

Member

Thanks: 1
Messages: 46

#13
I've been thinking, could this be a problem with /var/db/mysql? I deleted all the ports on the server and rebuilt them, but did not recreate the mysql database as all the users of my website databases are held in this database. I suspect this maybe the problem because the drupal installation fails at the very last stage when it is trying to create the admin user. I notice a similar permissions problem when using phpMyAdmin to create a database user and database at the same time, I get this error message:
Code:
Error
SQL query:  Edit
GRANT ALL PRIVILEGES ON * . * TO 'testD7'@'localhost' WITH GRANT OPTION MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ;

MySQL said:
#1045 - Access denied for user 'root'@'localhost' (using password: YES)
But I can use mysqladmin and can connect to the mysql server from the command line:
Code:
%mysql -uroot -prootpassword
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 499
Server version: 5.5.15 Source distribution

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> status
--------------
mysql  Ver 14.14 Distrib 5.5.15, for FreeBSD8.1 (amd64) using  5.2

Connection id:          499
Current database:
Current user:           root@localhost
SSL:                    Not in use
Current pager:          more
Using outfile:          ''
Using delimiter:        ;
Server version:         5.5.15 Source distribution
Protocol version:       10
Connection:             Localhost via UNIX socket
Server characterset:    latin1
Db     characterset:    latin1
Client characterset:    latin1
Conn.  characterset:    latin1
UNIX socket:            /tmp/mysql.sock
Uptime:                 6 hours 25 min 22 sec

Threads: 1  Questions: 25240  Slow queries: 0  Opens: 519  Flush tables: 1  Open tables: 246  Queries per second avg: 1.091
--------------

mysql>
I found a way round the phpMyAdmin issue: I just create a user and database separately. It appears to be fine because Drupal installs all the tables in the database. FYI, these are the relevent users in the mysql database (I've omitted my website users for security):
Code:
mysql> SELECT User,Host FROM mysql.user;
+--------------+-----------+
| User         | Host      |
+--------------+-----------+
| root         | 127.0.0.1 |
| root         | localhost |
| testD7       | localhost |
+--------------+-----------+
15 rows in set (0.00 sec)
mysql>
Please let me know if I'm on to something? I'll try and find a method to delete and recreate the mysql and keep my websites users.
Is there any other configuration file, database or such like that could have remained on my system after I deleted and rebuilt all the ports?
Again any help or pointers greatly appreciated.
 

Carpetsmoker

Daemon

Thanks: 180
Messages: 1,010

#14
I've been thinking, could this be a problem with /var/db/mysql?
No.

What is going on is that the filter.so extension wants to execute a function from a shared library, but can't find that function in any shared library.

I installed the php5-filter extension, and it seems to work fine with this:

Code:
<?php

$filters = filter_list();
foreach($filters as $filter_name)
  printf("%s: %s\n", $filter_name, filter_id($filter_name));
print "\n\n";

var_dump(filter_var('asd@example.com', FILTER_VALIDATE_EMAIL));
print "\n";

var_dump(filter_var('asdf', FILTER_VALIDATE_EMAIL));
print "\n";
... Executed from the commandline.

I don't know what happened to your PHP, or to your pcre installation. I would try rebuilding the PHP5 port:
# cd /usr/ports/lang/php5 && make clean build deinstall install

It's important that you run the clean target so that all previous build files are completely removed.

The reason some applications or older version of Drupal do work is because they don't use the filter extension. This extension is fairly new (introduced with PHP 5.2).
 
OP
OP
zzatskl

zzatskl

Member

Thanks: 1
Messages: 46

#15
I have rebuilt lang/php5 as you suggested and also for good measure using:
Code:
portmanager /lang/php5 -f
to force a rebuild of all the dependencies, but the problem remains. I created a test-filter.php with your code which outputs:
Code:
%php test-filter.php
int: 257
boolean: 258
float: 259
validate_regexp: 272
validate_url: 273
validate_email: 274
validate_ip: 275
string: 513
stripped: 513
encoded: 514
special_chars: 515
full_special_chars: 522
unsafe_raw: 516
email: 517
url: 518
number_int: 519
number_float: 520
magic_quotes: 521
callback: 1024


/libexec/ld-elf.so.1: /usr/local/lib/php/20090626/filter.so: Undefined symbol "php_pcre_exec"
%
Does this offer any clues? Please let me know.
 
OP
OP
zzatskl

zzatskl

Member

Thanks: 1
Messages: 46

#16
BTW, your code works fine on my development server (a slice on my laptop drive), the last lines output are:
Code:
string(15) "asd@example.com"
bool(false)
so I haven't made any mistakes in coding on the live server where the problem resides.
 
OP
OP
zzatskl

zzatskl

Member

Thanks: 1
Messages: 46

#17
I keep thinking of "stubborn (port) stains" use "Flash". I have since upgraded to FreeBSD 8.2-RELEASE-p3, and then followed the instructions in:
Code:
# man portmaster | less -p reinstallation
to delete and rebuild my ports again. But the stubborn problem remains (at least now I can test for the problem with a useful bit of code, thanks for that :)).

Jail, a-hah, I thought! I'll isolate my www world in a Jail. But foiled at the first attempt. My /usr/src directory is completely empty? and I don't recall deleting it, maybe when I tried to delete all traces of Gnome?

Two Questions
1. Could a missing /usr/src be where my php5-filter problem lies?
2. How can I repopulate the /usr/src directory? Is it as simple as copying from another freshly installed system of the same OS version?

Please can anybody help as my last resort seems to be to approaching, a journey to the server farm, to reinstall the complete OS at great disruption :(
 

Carpetsmoker

Daemon

Thanks: 180
Messages: 1,010

#18
Honestly, I am quite baffled as to why your problem persists. As a "solution" you could try:

1) Make sure your ports tree is up to date

2) Save a list of installed ports using # pkg_info -aqo > ~/installed-ports

3) move /usr/local to /usr/local.orig (mv /usr/local /usr/local.orig)

4) move /var/db/pkg to /var/db/pkg.orig

5) Now reinstall all the ports. You mentioned using both portmaster and portmanager. Portmanager hasn't been updated in years. I would recommend using portmaster.
In any case, you can reinstall all ports from the saved file with: # portmaster `xargs < ~/installed-ports`

Note: Just to be clear, the system won't be usable while you're doing this. Nothing is permanently deleted though, you can move /usr/local.orig or /var/db/pkg.orig back in case of disaster.

1. Could a missing /usr/src be where my php5-filter problem lies?
No, this bears absolutely no relation what-so-ever.
On a fresh install, /usr/src/ is often empty, from memory the installer asks you if you want to install the source, or you have to select it explicitly ... In any casing, an empty /usr/src/ is no problem.

2. How can I repopulate the /usr/src directory? Is it as simple as copying from another freshly installed system of the same OS version?
The most common method is using csup. The FreeBSD handbook has a chapter on this:
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/cvsup.html

tl;dr version: Copy /usr/share/examples/cvsup/standard-supfile to another location (i.e. ~/standard-supfile), open the file in an editor, change the update host, run # csup stable-supfile, and fetch coffee while it updates.
 
OP
OP
zzatskl

zzatskl

Member

Thanks: 1
Messages: 46

#19
Success, problem resolved :)

I also feel a lot happier with my server now, having a clean /usr/local directory with only the ports I need as a web server server. I've also learnt a lot about port management along the way.

BTW, the /usr/src directory built successfully with the given instructions. I can go onto create a Jail now to securily isolate my websites.

Big thank you all round.
 

PeterSprague

New Member


Messages: 19

#21
Another possible simple solution

Try bumping the
Code:
max_execution_time = 60
in your /usr/local/etc/php.ini.

apachectl restart

Worked for me, after the more involved solutions failed.

Peter
 
Top