# PHP upgrade from 5.2.8 to latest



## emadello (Jul 7, 2009)

Hello,

I just did "portsnap fetch update" and I want to upgrade the installed php 5.2.8 to the latest version fetched, here's "php -v" and "php-cgi -v"


```
srv50# php-cgi -v
PHP 5.2.8 with Suhosin-Patch 0.9.6.3 (cgi-fcgi) (built: Jan 23 2009 09:27:11)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
    with XCache v1.2.2, Copyright (c) 2005-2007, by mOo
srv50# php -v
PHP 5.2.8 with Suhosin-Patch 0.9.6.3 (cli) (built: Jan 23 2009 09:27:07)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
    with XCache v1.2.2, Copyright (c) 2005-2007, by mOo
```

How can i safely upgrade php keeping everything working (like fastcgi, xchache, etc..) ?


----------



## dennylin93 (Jul 7, 2009)

I'm using PHP as an Apache module, so my settings might differ from yours. I used `$ portupgrade php5`, and then `$ portupgrade php5-\*` for the extensions. For portmaster, `$ portmaster -Bd php5-\*` should work.


----------



## emadello (Jul 7, 2009)

```
srv50# portupgrade php5
portupgrade: Command not found.
```


----------



## emadello (Jul 7, 2009)

installing portupgrade from ports/ports-mgmt now.. will post updates after it finishes..


----------



## emadello (Jul 7, 2009)

same error.. command not found, i tried portupgrade php5 got no match


----------



## lyuts (Jul 7, 2009)

Do

```
rehash
```


----------



## dennylin93 (Jul 7, 2009)

Sorry, I forgot to mention that ports-mgmt/portmaster and ports-mgmt/portupgrade aren't part of the base system.


----------



## emadello (Jul 8, 2009)

ok i did "rehash" and portupgrade worked perfectly  upgraded to php 5.2.10 and all extensions, thanks alot for the help.


----------

