Q. I’m trying to upgrade my PHP version from 5.2.6 to 5.2.8 using portupgrade command. But I’m getting following errors:

*** Error code 1

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

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

Stop in /usr/ports/lang/php5.
** Command failed [exit code 1]: /usr/bin/script -qa /tmp/portupgrade.42275.0 env UPGRADE_TOOL=portupgrade UPGRADE_PORT=php5-pcre-5.2.6_2 UPGRADE_PORT_VER=5.2.6_2 make reinstall
—> Restoring the old version
pkg_add: warning: package ‘php5-pcre-5.2.6_2’ requires ‘php5-5.2.8’, but ‘php5-pcre-5.2.6_2’ is installed
** Fix the installation problem and try again.
[Updating the pkgdb in /var/db/pkg … – 62 packages found (-0 +1) . done] ** Listing the failed packages (-:ignored / *:skipped / !:failed)
! lang/php5 (php5-pcre-5.2.6_2) (install error)

How do I fix this problem and upgrade php5-pcre?

A. This is well known problem and can be fixed easily.

As of php 5.2.7, pcre extension is distributed with the core php5 package, and not as a standalone module anymore. Follow these steps to update your installation:

# pkg_delete -f php5-pcre-5.2.6
# pkgdb -F
# portupgrade php5-pcre

If you are using portmaster, enter:
# pkg_delete -f php5-pcre\*
# portmaster php5\*

If you are using pecl ports you might need to force an update on them, enter:
# portupgrade -f pecl\*
OR
# portmaster pecl\*

If you have the pecl hash, json and/or zip extensions you need to replace them with the php5 bundled ones, enter
# portupgrade -o archivers/php5-zip archivers/pecl-zip
# portupgrade -o devel/php5-json devel/pecl-json
# portupgrade -o security/php5-hash security/pecl-hash

OR
# portmaster -o archivers/php5-zip archivers/pecl-zip
# portmaster -o devel/php5-json devel/pecl-json
# portmaster -o security/php5-hash security/pecl-hash

Finally ,build your INDEX locally and you tried to build it after the php update commit, you need to rebuild it after you updated lang/php5:
# cd /usr/ports
# make index

References

  1. man page make, portmaster, portupgrade, /usr/ports/UPDATING

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 1 comment so far... add one


CategoryList of Unix and Linux commands
Disk space analyzersdf duf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Modern utilitiesbat exa
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg glances gtop jobs killall kill pidof pstree pwdx time vtop
Searchingag grep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
1 comment… add one
  • Meskalyn Feb 23, 2009 @ 4:43

    After a night of googling, I found my answer on your blog…

    Thanks for all this good BSD stuff you publish…

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum