PHP upgrade

dvl@

Developer
This thread (http://forums.freebsd.org/showthread.php?p=77589) seems related, but the solution posted there was not useful here.

I've tried the upgrade process from the ports/UPDATING entry of 20100409. Failed.

Current problem is demonstrated by:

Code:
# php
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20090626/json.so' - Cannot open "/usr/local/lib/php/20090626
/json.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20090626/spl.so' - Cannot open "/usr/local/lib/php/20090626
/spl.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20090626/pcre.so' - Cannot open "/usr/local/lib/php/20090626
/pcre.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20090626/simplexml.so' - Cannot open "/usr/local/lib/php/20090626
/simplexml.so" in Unknown on line 0

Other issues: security/php5-filter fails to compile:

Code:
/bin/sh /usr/ports/security/php5-filter/work/php-5.3.2/ext/filter/libtool --mode=compile cc  -I. -I/usr/ports/security/php5-filter
/work/php-5.3.2/ext/filter -DPHP_ATOM_INC -I/usr/ports/security/php5-filter/work/php-5.3.2/ext/filter/include -I/usr/ports/security/php5-filter
/work/php-5.3.2/ext/filter/main -I/usr/ports/security/php5-filter/work/php-5.3.2/ext/filter -I/usr/local/include/php -I/usr/local/include
/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib  
-DHAVE_CONFIG_H  -O2 -pipe -fno-strict-aliasing   -c /usr/ports/security/php5-filter/work/php-5.3.2/ext/filter/logical_filters.c -o 
logical_filters.lo
 cc -I. -I/usr/ports/security/php5-filter/work/php-5.3.2/ext/filter -DPHP_ATOM_INC -I/usr/ports/security/php5-filter/work/php-5.3.2/ext/filter
/include -I/usr/ports/security/php5-filter/work/php-5.3.2/ext/filter/main -I/usr/ports/security/php5-filter/work/php-5.3.2/ext/filter -I/usr
/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext 
-I/usr/local/include/php/ext/date/lib -DHAVE_CONFIG_H -O2 -pipe -fno-strict-aliasing -c /usr/ports/security/php5-filter/work/php-5.3.2/ext
/filter/logical_filters.c  -fPIC -DPIC -o .libs/logical_filters.o
In file included from /usr/ports/security/php5-filter/work/php-5.3.2/ext/filter/logical_filters.c:25:
/usr/local/include/php/ext/pcre/php_pcre.h:27:26: error: pcrelib/pcre.h: No such file or directory
In file included from /usr/ports/security/php5-filter/work/php-5.3.2/ext/filter/logical_filters.c:25:
/usr/local/include/php/ext/pcre/php_pcre.h:37: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
/usr/local/include/php/ext/pcre/php_pcre.h:38: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
/usr/local/include/php/ext/pcre/php_pcre.h:44: error: expected specifier-qualifier-list before 'pcre'
/usr/ports/security/php5-filter/work/php-5.3.2/ext/filter/logical_filters.c: In function 'php_filter_validate_regexp':
/usr/ports/security/php5-filter/work/php-5.3.2/ext/filter/logical_filters.c:412: error: 'pcre' undeclared (first use in this function)
/usr/ports/security/php5-filter/work/php-5.3.2/ext/filter/logical_filters.c:412: error: (Each undeclared identifier is reported only once
/usr/ports/security/php5-filter/work/php-5.3.2/ext/filter/logical_filters.c:412: error: for each function it appears in.)
/usr/ports/security/php5-filter/work/php-5.3.2/ext/filter/logical_filters.c:412: error: 're' undeclared (first use in this function)
/usr/ports/security/php5-filter/work/php-5.3.2/ext/filter/logical_filters.c:413: error: 'pcre_extra' undeclared (first use in this function)
/usr/ports/security/php5-filter/work/php-5.3.2/ext/filter/logical_filters.c: In function 'php_filter_validate_email':
/usr/ports/security/php5-filter/work/php-5.3.2/ext/filter/logical_filters.c:500: error: 'pcre' undeclared (first use in this function)
/usr/ports/security/php5-filter/work/php-5.3.2/ext/filter/logical_filters.c:500: error: 're' undeclared (first use in this function)
/usr/ports/security/php5-filter/work/php-5.3.2/ext/filter/logical_filters.c:501: error: 'pcre_extra' undeclared (first use in this function)
*** Error code 1
1 error
*** Error code 1

Stop in /usr/ports/security/php5-filter.
[root@ngaio:/usr/ports/security/php5-filter] #
Ideas? Suggestions?
 
I would run pkg_info -W on the missing .so files to see which ports you need to (re)build.

I have two of them:

Code:
# pkg_info -W json.so
/usr/local/lib/php/20090626/json.so was installed by package php5-json-5.3.2
# pkg_info -W simplexml.so
/usr/local/lib/php/20090626/simplexml.so was installed by package php5-simplexml-5.3.2

The errors in your second block of data point to the missing pcre.so, so resolving the errors in the first block should clear up the other issue.
 
Code:
# pkg_info -W json.so
pkg_info: json.so: file is not in PATH
# pkg_info -W spl.so
pkg_info: spl.so: file is not in PATH
# pkg_info -W pcre.so
pkg_info: pcre.so: file is not in PATH
[root@ngaio:/usr/ports/security/php5-filter] # pkg_info -W simplexml.so
pkg_info: simplexml.so: file is not in PATH
[root@ngaio:/usr/ports/security/php5-filter] #
But, FWIW, I did something similar earlier.

Code:
# portupgrade -f pecl-json php5-simplexml
** Port marked as IGNORE: devel/pecl-json:
        cannot install: doesn't work with PHP version : 5 (Doesn't support PHP 5)
 
And, FWIW, attempts to upgrade php5-simplexml gives:

Code:
In file included from /usr/local/include/php/ext/spl/spl_iterators.h:27,
                 from /usr/ports/textproc/php5-simplexml/work/php-5.3.2/ext/simplexml/sxe.c:31:
/usr/local/include/php/ext/pcre/php_pcre.h:27:26: error: pcrelib/pcre.h: No such file or directory
In file included from /usr/local/include/php/ext/spl/spl_iterators.h:27,
                 from /usr/ports/textproc/php5-simplexml/work/php-5.3.2/ext/simplexml/sxe.c:31:
/usr/local/include/php/ext/pcre/php_pcre.h:37: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
/usr/local/include/php/ext/pcre/php_pcre.h:38: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
/usr/local/include/php/ext/pcre/php_pcre.h:44: error: expected specifier-qualifier-list before 'pcre'
 
FBSDin20Steps said:
Try deleting php5-filter-5.2.12_1 in /var/db/pkg... I've just done it. For me it compiles without errors right now.

php5-filter is not installed.

Code:
# ls -l /var/db/pkg/*filter*
ls: /var/db/pkg/*filter*: No such file or directory
 
ProFTP said:
Code:
portupgrade -rRfN security/php5-filter

Code:
In file included from /usr/ports/security/php5-filter/work/php-5.3.2/ext/filter/logical_filters.c:25:
/usr/local/include/php/ext/pcre/php_pcre.h:27:26: error: pcrelib/pcre.h: No such file or directory
In file included from /usr/ports/security/php5-filter/work/php-5.3.2/ext/filter/logical_filters.c:25:
/usr/local/include/php/ext/pcre/php_pcre.h:37: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
/usr/local/include/php/ext/pcre/php_pcre.h:38: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
/usr/local/include/php/ext/pcre/php_pcre.h:44: error: expected specifier-qualifier-list before 'pcre'
/usr/ports/security/php5-filter/work/php-5.3.2/ext/filter/logical_filters.c: In function 'php_filter_validate_regexp':
/usr/ports/security/php5-filter/work/php-5.3.2/ext/filter/logical_filters.c:412: error: 'pcre' undeclared (first use in this function)
/usr/ports/security/php5-filter/work/php-5.3.2/ext/filter/logical_filters.c:412: error: (Each undeclared identifier is reported only once
/usr/ports/security/php5-filter/work/php-5.3.2/ext/filter/logical_filters.c:412: error: for each function it appears in.)
/usr/ports/security/php5-filter/work/php-5.3.2/ext/filter/logical_filters.c:412: error: 're' undeclared (first use in this function)
/usr/ports/security/php5-filter/work/php-5.3.2/ext/filter/logical_filters.c:413: error: 'pcre_extra' undeclared (first use in this function)
/usr/ports/security/php5-filter/work/php-5.3.2/ext/filter/logical_filters.c: In function 'php_filter_validate_email':
/usr/ports/security/php5-filter/work/php-5.3.2/ext/filter/logical_filters.c:500: error: 'pcre' undeclared (first use in this function)
/usr/ports/security/php5-filter/work/php-5.3.2/ext/filter/logical_filters.c:500: error: 're' undeclared (first use in this function)
/usr/ports/security/php5-filter/work/php-5.3.2/ext/filter/logical_filters.c:501: error: 'pcre_extra' undeclared (first use in this function)
*** Error code 1
1 error
*** Error code 1

Stop in /usr/ports/security/php5-filter.
** Command failed [exit code 1]: /usr/bin/script -qa /tmp/portupgrade20100414-45279-192p2nb-0 env make
** Fix the problem and try again.
** Listing the failed packages (-:ignored / *:skipped / !:failed)
        ! security/php5-filter  (missing header)
 
if this error may be due to the fact that you're not updated ...
...then, you can try:
Code:
portupgrade -rRf php5

and:
Code:
pkg_info  | grep '^php5*' | awk '{print $1}' | xargs portupgrade -f || pkgdb -fFu && portsclean -CLPP
helped me...
 
php5-json-5.3.2 and php5-simplexml-5.3.2 should not be a problem; these provide json.so and simplexml.so.

Your pcre.so should probably have been removed by step 1) of the procedure in /usr/ports/UPDATING (a pkg_delete of php5-pcre should have taken care of it).

Did you use 'make deinstall' to remove those ports, or 'pkg_delete'? The latter is always preferable, because it removes the files installed by the port when it was installed.
 
ProFTP said:
if this error may be due to the fact that you're not updated ...
...then, you can try:
Code:
portupgrade -rRf php5

FWIWand:
Code:
pkg_info  | grep '^php5*' | awk '{print $1}' | xargs portupgrade -f || pkgdb -fFu && portsclean -CLPP
helped me...

FWIW, I have upgraded PHP5 several times over the past 24 hours trying to fix this. ;)

It's running now. :)
 
dvl@ said:
FWIW, I have upgraded PHP5 several times over the past 24 hours trying to fix this. ;)

It's running now. :)

That just finished:

Code:
[Updating the pkgdb <format:dbm_hash> in /var/db/pkg ... - 698 packages found (-0 +1) . done]
--->  Skipping 'lang/php5-extensions' (php5-extensions-1.1) because a requisite package 'pecl-hash-1.3' (security/pecl-hash) failed (specify -k to force)
** Listing the failed packages (-:ignored / *:skipped / !:failed)
        - devel/pecl-json (marked as IGNORE)
        - security/pecl-hash (marked as IGNORE)
        * lang/php5-extensions (php5-extensions-1.1)

and FWIW:

Code:
 # php
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20090626/json.so' - Cannot open "/usr/local/lib/php/20090626/json.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20090626/spl.so' - Cannot open "/usr/local/lib/php/20090626/spl.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20090626/pcre.so' - Cannot open "/usr/local/lib/php/20090626/pcre.so" in Unknown on line 0

But I'm about to try the second part of the suggestion from above.
 
The results of the second step:

Code:
# pkg_info  | grep '^php5*' | awk '{print $1}' | xargs portupgrade -f || pkgdb -fFu && portsclean -CLPP
Stale dependency: php5-extensions-1.1 --> php5-simplexml-5.3.2 -- manually run 'pkgdb -F' to fix, or specify -O to force.
--->  Updating the pkgdb
[Rebuilding the pkgdb <format:dbm_hash> in /var/db/pkg ... - 698 packages found (-0 +698) . done]
--->  Checking the package registry database
Stale dependency: php5-extensions-1.1 -> php5-simplexml-5.3.2 (textproc/php5-simplexml):
php5-sockets-5.3.2 (score:37%) ? ([y]es/[n]o/[a]ll) [no] a
Fixed. (-> php5-sockets-5.3.2)
Stale dependency: php5-extensions-1.1 -> pecl-filter-0.11.0 (security/php5-filter):
pecl-json-1.2.1 (score:29%) ? ([y]es/[n]o/[a]ll) [no] a
Fixed. (-> pecl-json-1.2.1)
Cleaning out /usr/ports/*/*/work...
Delete /usr/ports/graphics/ilmbase/work
Delete /usr/ports/graphics/linux-f8-dri/work
Delete /usr/ports/security/php5-filter/work
Delete /usr/ports/security/courier-authlib-base/work
Delete /usr/ports/textproc/gnome-doc-utils/work
Delete /usr/ports/textproc/rarian/work
done.
Cleaning out /usr/ports/packages...
cd: can't cd to /usr/ports/packages/All
find: /usr/ports/packages: No such file or directory

But still:

Code:
# php
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20090626/json.so' - Cannot open "/usr/local/lib/php/20090626
/json.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20090626/spl.so' - Cannot open "/usr/local/lib/php/20090626
/spl.so" in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20090626/pcre.so' - Cannot open "/usr/local/lib/php/20090626
/pcre.so" in Unknown on line 0

# which php
/usr/local/bin/php
# ls -l /usr/local/bin/php
-rwxr-xr-x  1 root  wheel  2678524 Apr 14 19:23 /usr/local/bin/php
# date
Wed Apr 14 20:41:13 BST 2010
#

Searching, I find:

Code:
# find /usr/local/lib/php -name json.so
/usr/local/lib/php/20060613/json.so

# find /usr/local/lib/php -name spl.so
/usr/local/lib/php/20060613/spl.so

# find /usr/local/lib/php -name pcre.so
/usr/local/lib/php/20060613/pcre.so

But then it is interesting who owns those:
Code:
# pkg_info -W /usr/local/lib/php/20060613/json.so
/usr/local/lib/php/20060613/json.so was installed by package pecl-json-1.2.1
# pkg_info -W /usr/local/lib/php/20060613/spl.so
# pkg_info -W /usr/local/lib/php/20060613/pcre.so
#

spl and pcre do not belong to any package.

But it's not like I can upgrade pecl-json:

Code:
# portupgrade -f pecl-json
** Port marked as IGNORE: devel/pecl-json:
        cannot install: doesn't work with PHP version : 5 (Doesn't support PHP 5)
** Listing the failed packages (-:ignored / *:skipped / !:failed)
        - devel/pecl-json (marked as IGNORE)
 
Code:
pkg_delete -f php5*

cd /usr/ports/lang/php5/
make install
cp /usr/ports/lang/php5/work/php-5.3.2/ext/pcre/pcrelib/pcre.h /usr/local/include/php/ext/pcre/
make clean
cd /var/db/ports
rm -rf php5-extensions
cd /usr/ports/lang/php5-extensions/
make install clean

Thats what I did before.
 
gkontos said:
Code:
pkg_delete -f php5*

cd /usr/ports/lang/php5/
make install
cp /usr/ports/lang/php5/work/php-5.3.2/ext/pcre/pcrelib/pcre.h /usr/local/include/php/ext/pcre/
make clean
cd /var/db/ports
rm -rf php5-extensions
cd /usr/ports/lang/php5-extensions/
make install clean

Thats what I did before.

Tried that. Fails:

Code:
In file included from /usr/ports/security/php5-filter/work/php-5.3.2/ext/filter/logical_filters.c:25:
/usr/local/include/php/ext/pcre/php_pcre.h:27:26: error: pcrelib/pcre.h: No such file or directory
In file included from /usr/ports/security/php5-filter/work/php-5.3.2/ext/filter/logical_filters.c:25:
/usr/local/include/php/ext/pcre/php_pcre.h:37: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
/usr/local/include/php/ext/pcre/php_pcre.h:38: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
/usr/local/include/php/ext/pcre/php_pcre.h:44: error: expected specifier-qualifier-list before 'pcre'
/usr/ports/security/php5-filter/work/php-5.3.2/ext/filter/logical_filters.c: In function 'php_filter_validate_regexp':
/usr/ports/security/php5-filter/work/php-5.3.2/ext/filter/logical_filters.c:412: error: 'pcre' undeclared (first use in this function)
/usr/ports/security/php5-filter/work/php-5.3.2/ext/filter/logical_filters.c:412: error: (Each undeclared identifier is reported only once
/usr/ports/security/php5-filter/work/php-5.3.2/ext/filter/logical_filters.c:412: error: for each function it appears in.)
/usr/ports/security/php5-filter/work/php-5.3.2/ext/filter/logical_filters.c:412: error: 're' undeclared (first use in this function)
/usr/ports/security/php5-filter/work/php-5.3.2/ext/filter/logical_filters.c:413: error: 'pcre_extra' undeclared (first use in this function)
/usr/ports/security/php5-filter/work/php-5.3.2/ext/filter/logical_filters.c: In function 'php_filter_validate_email':
/usr/ports/security/php5-filter/work/php-5.3.2/ext/filter/logical_filters.c:500: error: 'pcre' undeclared (first use in this function)
/usr/ports/security/php5-filter/work/php-5.3.2/ext/filter/logical_filters.c:500: error: 're' undeclared (first use in this function)
/usr/ports/security/php5-filter/work/php-5.3.2/ext/filter/logical_filters.c:501: error: 'pcre_extra' undeclared (first use in this function)
*** Error code 1
1 error
*** Error code 1

Stop in /usr/ports/security/php5-filter.
*** Error code 1

Stop in /usr/ports/lang/php5-extensions.
*** Error code 1

Stop in /usr/ports/lang/php5-extensions.
 
Back
Top