# php52 port



## lissyara (Apr 13, 2010)

hi!
I write simply patch for use php 5.2 from ports three
http://lissyara.su/patch/ports/php52/php.5.3-5.2.2010-04-12.16:27:04.diff
is anyone interested?


----------



## SirDice (Apr 13, 2010)

Maybe you could explain a little more what this patch does.


----------



## lissyara (Apr 13, 2010)

create php52-* ports
fix Mk/bsd.php.mk
to correct use, apply patch and add 

```
bsd-test# grep PHP_VER /etc/make.conf
PHP_VER=52
bsd-test#
```
I correct build some ports (not all, I'm working with it)

```
bsd-test# pkg_info | grep php52 | wc -l
      77
bsd-test#
```
not build

```
bsd-test# sh /tmp/1.sh
php52-pdo_firebird
php52-interbase
php52-ice
php52-phing
bsd-test#
```


----------



## SirDice (Apr 13, 2010)

Not how to apply it, what is it? What does it do?


----------



## lissyara (Apr 13, 2010)

lissyara said:
			
		

> create php52-* ports
> fix Mk/bsd.php.mk


=))


----------



## ls (Apr 14, 2010)

Not all users want global changes of version PHP and the given patch solves this problem.
Consider possibility of inclusion of a patch to ports tree.
As it seems to me, now PHP 5.3 yet has not reached to include it in ports and consequently it is necessary to remain on 5.2.12. The port lang/php52 is really necessary.

I have tested it, all is build successfully and works.


----------



## ls (Apr 14, 2010)

Also, in case of positive solution it is desirable to add in port here this patch http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/144859


----------



## urosgruber (Apr 15, 2010)

Is there any way that both 5.3 and 5.2 live together. I managed this before i upgrade ports with 5.3. I just change PREFIX before installing. But with both php52 and php53 in ports this is kinda impossible. I would be great if some sort of suffix for php php-cgi etc. could be used. Do you think this is possible with this patch. That way users can use either 5.2 or 5.3 just by changing path in cgi wrapper.


----------



## ls (Apr 18, 2010)

PR for lang/php52 was sent, who need PHP 5.2.12 can install from this files http://www.freebsd.org/cgi/query-pr.cgi?pr=145772


----------



## gilinko (Apr 18, 2010)

urosgruber said:
			
		

> Is there any way that both 5.3 and 5.2 live together. I managed this before i upgrade ports with 5.3. I just change PREFIX before installing. But with both php52 and php53 in ports this is kinda impossible. I would be great if some sort of suffix for php php-cgi etc. could be used. Do you think this is possible with this patch. That way users can use either 5.2 or 5.3 just by changing path in cgi wrapper.



As stated in the earlier long thread starting i august last year, PHP 5.2 is soon to reach it's EOL. Possibly in a few months or so. The developers of PHP only want one 5.X line to develop and patch.


----------



## lissyara (Apr 19, 2010)

except the developers still have users.
we have on the hosting, they still ask php4.
and they do not care what the developers want. They have websites and they should work


----------



## gilinko (Apr 19, 2010)

A good website should by this time now use at least php5. php4 has to my knowledge about 10 open CVE's of which two are classified as high. So if you are hosting applications that still use php4, you are open for some serious attacks from both local and remote users. And having websites that should work under php4 is not a defence for keeping it around, it's a show of bad developers.


----------



## lissyara (Apr 19, 2010)

can you explain it more then 100 humans who read this thread?
may be you can explain it all users who have their sites?


----------



## gilinko (Apr 19, 2010)

lissyara said:
			
		

> can you explain it more then 100 humans who read this thread?
> may be you can explain it all users who have their sites?



Sorry, but that's your job and responsibility if you are a hosting provider. And if they don't listen to you, then you have bad customers that may allow your servers to be breached. I only allow for php5 to be the one running, and is currently pushing them to verify against php 5.3.X.


----------



## lissyara (Apr 20, 2010)

So I have to say: 





> Our hosting service uses a bad operating system, fails to maintain the desired version of your php. We recommend you find another hosting provider who uses Debian/CentOS/...



Or you can rewrite your code (or someone else, and long no longer supported), or migrate to other versions.
==============
if it is not necessary specifically to you, or if you (your technical support) nothing more to do than to help users to rewrite the code/expel them from you hosting - you can continue to do that and more.

but do not prevent others, who have something to do.


----------



## fraenki (Apr 20, 2010)

lissyara said:
			
		

> hi!
> I write simply patch for use php 5.2 from ports three
> http://lissyara.su/patch/ports/php52/php.5.3-5.2.2010-04-12.16:27:04.diff
> is anyone interested?




Tested and works as expected. I'll be monitoring http://www.freebsd.org/cgi/query-pr.cgi?pr=145772. If it makes it's way to the ports tree I'm going to support it and help with maintenance.


fraenki


----------



## Demonster (Apr 23, 2010)

Thank you very much, Alex!
It helped me.

P.S. Developers must die in your blue childhood dreams


----------



## Daren (Apr 27, 2010)

Hi

Thanks for doing this - I have some software that is not 100% 5.3 tested in production.

The question is:

I have a lot of php based ports installed and need to "move" them to php52-*.  I tend to use portupgrade (but do not know it well enough!).  Is there a "magic" command I can use, as I've added the PHP_VER to make.conf and would like to update all the installed child ports in 1 go (preferably without uninstalling - re-installing) them.  Not too much to ask 

Thanks again


----------



## lissyara (Apr 27, 2010)

```
portupgrade -fo lang/php52 lang/php5
```


----------



## Daren (Apr 27, 2010)

Again, thanks.

So simple when the knowledge is there (I _really_ have to get round to dissecting that man page  )


----------



## Daren (Apr 27, 2010)

ooh..  that didn't really work 

It updated the main port, but not the child ports.  I guess I'll need to do those manually?


----------



## lissyara (Apr 27, 2010)

you can use simple script, to create list

```
xxx/php52-yyy xxx/php5-yyy
```
and update all


----------



## Daren (Apr 27, 2010)

All done now 

but.. (there's always a but, isn't there!)

There appears to be a problem with php-gd.  I have found a PR for this:

http://www.freebsd.org/cgi/query-pr.cgi?pr=145247&cat=ports

which has a patch against the main php5-gd port which I guess will need to be applied against the php52-gd port, although one user says it doesn't work, but there's no further follow-up.


----------



## Daren (Apr 28, 2010)

oops...

just noticed the patch is already part of the port.  But I'm still having failures when using tcpdf and a png image.

What happens now, is when I launch the script (which is using tcpdf to build a PDf file which has a couple of png images in it), the apache error log come back with:


```
[Wed Apr 28 10:56:06 2010] [notice] child pid 46871 exit signal Abort trap (6)
```

It's definitely related to png, as if I change one of the images to jpeg, and comment out the other (it has transparency, so can't be a jpeg) I get the output fine.


----------

