There were several vital changes and updates related to PHP, php-extensions and php5-* dependency packages thus I couldn’t expect the upgrades to be a piece of cake. In fact, famous *** Error code 1 showed up without much delay even this time I checked /usr/ports/UPDATING (along with the lessons I took from apache22 upgrade) before doing anything and followed the instructions in “20100409″ before running the portupgrade utility on my FreeBSD 8.0 box;
20100409: AFFECTS: users of lang/php5 As of PHP 5.3, a few extensions were removed from or included into the core PHP5 package. Follow the steps below to update your installation. 1) Delete the following packages (if installed): - php5-dbase - php5-ncurses - php5-pcre - php5-spl - php5-ming - php5-mhash 2) Rebuild lang/php5 and all ports that depend on it.
Error output;
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/portupgrade20100604-12921-10e5tqz-0 env UPGRADE_TOOL=portupgrade UPGRADE_PORT=php5-filter-5.2.11_1 UPGRADE_PORT_VER=5.2.11_1 make ** Fix the problem and try again. ---> Skipping 'lang/php5-extensions' (php5-extensions-1.3) because a requisite package 'php5-filter-5.2.11_1' (security/php5-filter) failed (specify -k to force) ** Listing the failed packages (-:ignored / *:skipped / !:failed) ! mail/php5-imap (php5-imap-5.2.11_1) (missing header) ! security/php5-filter (php5-filter-5.2.11_1) (missing header) * lang/php5-extensions (php5-extensions-1.3)
If we check MOVED file, we see that php5-filter is now also the part of the core php5;
# grep "php5-filter" /usr/ports/MOVED security/pecl-filter|security/php5-filter|2008-12-11|Now bundled in php5
Naturally, I tried to proceed on my way by forcing the deletion of php5-filter via pkg_delete -f php5-filter\*, updating the pkgdb with pkgdb -Fu and retrying the portupgrade procedure that first seemed to be working as the complaints dropped to just php5-imap package. But as a matter of fact this was only the beginning of a new struggle that would never result in victory because pcre which has been integrated in the base of PHP5.3 didn’t stop to generate new errors as I strived to remove php5-imap and compile php5-extensions many times from scratch. In one way or another, pcre always prevented the upgrade to be accomplished successfully.
By no means, a more serious assay should be considered because this issue had to be more related to the bundled pcre change in PHP5 itself rather than the extensions or the packages.
Below is the solution and the sequence worked for me. But before giving a try, get the list of your existing php5-* packages by pkg_info command surely in order to recover your applications depending on these packages, later in the end of the solution.
Insert WITH_BUNDLED_PCRE=”YES” variable into your /etc/make.conf or alternatively into pkgtools.conf for portupgrade.
# cd /usr/local # pkg_delete -f php5* # rm -r etc/php # rm -r lib/php # rm -r include/php # cd /usr/ports/lang/php5 # make install clean # cd /usr/ports/lang/php5-extensions # make install clean
Finally update your pkgdb to confirm and fix the earlier dependencies we have deleted, which are required by your other existing packages;
# pkgdb -Fu [Updating the pkgdb <format:bdb_btree> in /var/db/pkg ... - 284 packages found (-0 +1) . done] Fixed. (-> php5-xmlrpc-5.3.2_1) Stale dependency: postfixadmin-2.3_1 -> php5-mbstring-5.3.2_1 (converters/php5-mbstring): php5-mysqli-5.3.2_1 (score:33%) ? ([y]es/[n]o/[a]ll) [no] Install stale dependency? ([y]es/[n]o/[a]ll) [yes] [Gathering depends for converters/php5-mbstring .................................................. done] ---> Installing 'php5-mbstring-5.3.2_1' from a port (converters/php5-mbstring) ---> ... ---> ...
Check your php state;
# php -v Failed loading /usr/local/lib/php/20090626/eaccelerator.so: Cannot open "/usr/local/lib/php/20090626/eaccelerator.so" Warning: Directive 'register_long_arrays' is deprecated in PHP 5.3 and greater in Unknown on line 0 Warning: Directive 'magic_quotes_gpc' is deprecated in PHP 5.3 and greater in Unknown on line 0 PHP 5.3.2 with Suhosin-Patch (cli) (built: Jun 4 2010 13:07:23) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
Complete your missing dependencies, reinstall the packages such as eaccelerator for which you have to place their *.so in their new location, edit php.ini file and comment out the directives below which are deprecated in PHP 5.3.2;
;register_long_arrays = On (arround line 433) ;magic_quotes_gpc = On (arround line 454)
Final check;
# php -v PHP 5.3.2 with Suhosin-Patch (cli) (built: Jun 4 2010 13:07:23) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies with eAccelerator v0.9.6.1, Copyright (c) 2004-2010 eAccelerator, by eAccelerator
Resolved.






RSS feed for comments on this post.




