# the whole php/apache module issue



## Tomse (Feb 17, 2014)

Not really knowing if I should address this to the mailing list or here, or both, I'll start here though.

Since adding the apache module to the PHP package (pkgng) is an issue.
And I can't really seem to find whether this has been debated before.

Would it be a big problem creating and adding, lets call it, php5-mod-apache as a package? 
Seeing how many times the php/apache module question has been asked, it could be very useful.

Is there a reason why it hasn't been added or are there someone working towards achieving this already?

What would it take to make this happen?
* someone to maintain the package
* I guess someone with the knowledge of C, to strip down the php5 package into the mod_php5.so file.
* would it step over the toes of the php/ports maintainers ?

any constructive comments are welcome


----------



## SirDice (Feb 17, 2014)

Tomse said:
			
		

> Would it be a big problem creating and adding, lets call it, php5-mod-apache as a package?


Yes, the package name would still be php5-x.y.x.tgz so there would be no way to differentiate between a package with and without the Apache module. And what if I use Apache 2.0 or 2.4 instead of 2.2?



> Is there a reason why it hasn't been added or are there someone working towards achieving this already?


The reason is sort of outlined above, there are multiple Apache versions and the module needs to be built against a specific version. There's also no way to tell the difference as all the packages will be named the same.


----------



## dpejesh (Feb 17, 2014)

Here's a good video which explains what's happening with the ports tree and an explanation of why this is currently a problem, and how it'll be solved after the legacy tools go away.


----------



## Tomse (Feb 17, 2014)

Thanks for the answers. 

My first response to @SirDice would be php5-mod-apache22 / php5-mod-apache24.  But Baptiste (in the video) talks against this (all the version numbers), at least that's what I understand from his talk.

Though PHP is out in php53. php5, php55 in the ports.  So.. we'd end up with (at least in this example) 6 modules.

Could this be fixed with an "intelligent" package?  Having all 6 modules in a single package.  Letting a script check which versions of PHP/Apache is installed, and then install that module.

Sorry, @dpejesh, if the video answers the question, I have a hard time following some of the stuff he's talking about (too techincal for me, at least for now).


----------



## dpejesh (Feb 17, 2014)

Basically what he's saying is currently when packages are built their dependencies are hard coded to the exact port/version.  So when you build a php5 package, it will depend strictly on apache22-2.2.26 so you can't try to use apache24 instead because of the hard dependency.  This is due to how the legacy pkg_* tools work.  Towards the end of the video he talks about how pkgng will allow Provides/Requires directives.  So php53/php5/php55 all will 'require' apache, while apach22 and apache24 will both 'provide' apache.  This will allow you to interchange packages that 'provide' something to packages that 'require' it.  As far as I understand this will be possible once the pkg_* tools are no longer supported, but until then we're stuck in this limbo state where it hasn't been implemented because it would break them.


----------



## Tomse (Feb 18, 2014)

Thank you for clarifying.

It's good to know that this will eventually be fixed.

cheers


----------

