# How to change/force to other version of php ?



## bryn1u (Aug 5, 2017)

Helo guys,

I have been looking for how to change default version of php-56 into php-71 sine long but i can't find proper answer. Im using pkg to install sofetware. For example when i want to install nextcloud from package it always goes to install with php-56 but i have installed php-71. How can i change it ?

Thanks for help,
Best regards,


----------



## Wozzeck.Live (Aug 5, 2017)

You can't mixte pkg and ports installation, or if you use ports installation along with PKG you must always keep the default port options to maintain the compatibility with precompiled packages.

Today the default version of php for PKG system is 5.6 and you can't modify that

If you install php 71, then you must rebuild manually all ports depending on php 56 to link them with the new PHP version

Eventually you can override the default PHP version by adding in /etc/make.conf


```
DEFAULT_VERSIONS+= php=7.1
```

But this is not absolutely necessary. All my systems are built against  php 7.1 without this option in make.conf
Generally when a port is still claiming for a previous version, there is likely another problems.
Sometimes you need to deinstall the previous package before rebuilding the new to clean all former linkages.

The other option should be to keep the base system with standard PKG and so PHP 56 and to install PHP 71 in a dedicated jail.


----------



## bryn1u (Aug 6, 2017)

Im not using ports. I install software with pkg. But when i want to install nextcloud then is installing nextcloud with php-56 i have no influence on it !


----------



## bryn1u (Aug 6, 2017)

I dont want to install two version (but its possible). I want to change default version to php-71 !


----------



## Wozzeck.Live (Aug 6, 2017)

If you want to change the default version of php you must use port system
You won't be able to use packages


----------



## bryn1u (Aug 6, 2017)

"Today the default version of php for PKG system is 5.6 and you can't modify that"

Yes, you are right. I need to install nextcloud manually


----------

