# /etc/make.conf and DEFAULT_VERSIONS



## ikbendeman (Dec 12, 2013)

So far in my /etc/make.conf I have 
	
	



```
DEFAULT_VERSIONS=python=2.7 python2=2.7 python3=3.3
```
I would like to set the default version of PHP to PHP 5.5. What flag should I use? I'm having issues getting apache22 to work with any version of PHP but I had it working on my last install, so I don't quite understand.


----------



## ShelLuser (Dec 12, 2013)

Although there are ways to enforce this the best way that I discovered is to start by installing PHP and then install the rest which should be using it. Or, if you already have PHP installed you could use a utility such as portmaster to tell it to switch to another version while making sure that all dependencies are kept in place (see portmaster(8), you'll want to check the -o option).


----------



## ikbendeman (Dec 15, 2013)

What are the ways of enforcing it?


----------



## ShelLuser (Dec 23, 2013)

Sorry for the late response, I totally overlooked this post.

Basically by using the approach I mentioned earlier. If you start by installing a specific PHP version then all ports will automatically use that (unless of course you're using something which is marked broken or deprecated). Their dependency is for "PHP to be present, but do not pinpoint this to a specific version.


----------



## SirDice (Dec 23, 2013)

The DEFAULT_VERSIONS 'knob' is rather new. It's purpose is indeed to set default versions for various parts/toolkits. But not everything has been done yet. Most still use a rather non-standardized way, look in /usr/ports/Mk/ to, in this case, bsd.php.mk. A little under the top remarks you find:

```
DEFAULT_PHP_VER?=       5
```
Below that is a bit of code to differentiate between the versions, 52, 53 and 55. So setting it to 55 would force PHP 5.5.x, even if the php5 port would move onto 5.6 (or something). 

/etc/make.conf:

```
DEFAULT_PHP_VER?=       55
```
Would force the default version to 5.5 unless a port specifically requests a different version.


----------

