Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Basically, I usually do something like this:

# portsnap fetch
# portsnap update

# portmaster -L | grep -B1 "New version"
    ===>>> php5-5.2.11
    ===>>> New version available: php5-5.2.12
# portmaster php5-5.2.11

But with PHP I've got about 40 modules and have to them one by one. Is there a better (and safe) way to do this?

Edit: well it turns out that this is what's needed:

# portmaster php5-extensions

It's amazing how hard that was to find out!

share|improve this question
up vote 6 down vote accepted
portmaster -db php5*
share|improve this answer
Just upgraded php itself, which ended in a segmentation fault. Executing this command saved my day. Thanks for sharing! – please delete me Aug 29 '13 at 20:45

Firstly I should say that I don't use portmaster, I use portupgrade, but then I build ports rather than use packages!

Portupgrade allows you to put:

portupgrade php\*

which will upgrade all the php ports. Portmaster may do the same thing.

Also you can give portsnap multiple commands in one go, so you can put

portsnap fetch update
share|improve this answer
I can just install portupgrade and use that then. There's no problem with using them together? – Gazzer Jan 24 '10 at 19:22
I don't know, as I've never used portmaster! If you use portupgrade then you can use the -P switch to use packages rather than ports where possible. – hmallett Jan 24 '10 at 19:42
Using the new package manager system (The old one was EOL in September 2014), ports and packages can work together without stepping on each other. Portmaster can use either. Portmaster does have one nice feature not in portupgrade, it will ask all of the config questions up front and then do the build, rather than the portupgrade default of doing the config question as each port is built. Having used portupgrade for years and then switching to portmaster recently, I find it nicer. – Walter Sep 26 '14 at 0:14

I rebuild/update all packages depending on php5 for safety. You need to specify the full pkg-name including version. Find out the exact version with pkg_info:

# pkg_info|grep php
php5-5.3.8          PHP Scripting Language

Then rebuild/update php and all ports depending on it with:

# portmaster -r php5-5.3.8
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.