# How to install PHP56 (EoL)



## MattS (Apr 12, 2019)

TL;DR 
I know, I know, I know

I need to temporarily re-install php56.  Can this be done?


----------



## MattS (Apr 12, 2019)

This did the trick








						Reinstall orphaned packages
					

Once a package is "orphaned", is there any way to reinstall that same version?  I have PHP 5.4.45 installed and my hands are tied  ... I just can't upgrade to a later version until all the forum / CMS software I have installed fully supports it.




					forums.FreeBSD.org


----------



## marian_cerny (May 15, 2019)

I have extracted PHP 5.6 ports from the ports tree before it was removed and provided instructions how to install it.

I have also updated the version from 5.6.39 to the latest 5.6.40.

See: https://github.com/mariancerny/freebsd-ports-php56


----------



## serzar (Jul 8, 2019)

hello marian! thank you for the php56 ports

but i get the following error when i try to install pdo_mysql package 
i already have mysql.so located at the path.

Actually , i only need php56-openssl5.39 package for my server . can you by any chance upload/provide  php56 version 39 for us ?  

best regards ,





```
===>  Staging for php56-pdo_mysql-5.6.40
===>   php56-pdo_mysql-5.6.40 depends on file: /usr/local/include/php/main/php.h - found
===>   php56-pdo_mysql-5.6.40 depends on file: /usr/local/lib/php/20131226/pdo.so - found
Error: bad dependency syntax in RUN_DEPENDS
expecting: pattern:origin[@flavour][:target]
got: /usr/local/lib/php/20131226/mysql.so:
Errors with dependencies.
*** Error code 1

Stop.
make[1]: stopped in /usr/local/ports/php56/databases/php56-pdo_mysql
*** Error code 1
```





marian_cerny said:


> I have extracted PHP 5.6 ports from the ports tree before it was removed and provided instructions how to install it.
> 
> I have also updated the version from 5.6.39 to the latest 5.6.40.
> 
> See: https://github.com/mariancerny/freebsd-ports-php56


----------



## marian_cerny (Jul 17, 2019)

The issue with building pdo_mysql package has been fixed. You need to add the following line into /etc/make.conf:


```
mysql_DEPENDS=  databases/php${PHP_VER}-mysql
```

See https://github.com/mariancerny/freebsd-ports-php56/issues/1

And sorry, I can not provide any packages.


----------



## Gwyneth Llewelyn (Oct 4, 2019)

Thanks so much, marian_cerny — your package is absolutely phenomenal and very, very complete; so much so, that I was surprised at how flawless the build went (in spite of the many warnings regarding possible caveats). I've very successfully installed everything I needed under 11.2-RELEASE-p11


----------



## mariusvw (Apr 21, 2020)

Works great on FreeBSD 12.1-RELEASE-p8.
Using it for an offline system till we can upgrade it to php7.x

Many thanks!


----------



## maks (Jan 15, 2022)

Or you can download it from original PHP website https://www.php.net/releases/
Latest release for 5.6 was 5.6.40 https://www.php.net/distributions/php-5.6.40.tar.gz
Unpack it, get inside and run
`./configure`
then
`make install`
and you all set.


----------



## maks (Jan 15, 2022)

Or you can configure it with different options and extensions like this for Ngixn+FPM:
`./configure --with-config-file-path=/usr/local/etc/php-fpm/ --with-config-file-scan-dir=/usr/local/etc/php-fpm/ --with-fpm-user=user --with-fpm-group=group --with-curl --enable-mysqlnd --enable-mbstring --enable-soap --with-mcrypt --with-openssl --enable-calendar --with-gd --enable-inline-optimization --enable-sockets --enable-mbregex --enable-exif --with-jpeg-dir=/var/tmp --with-png-dir=/var/tmp --enable-bcmath --with-mhash --enable-zip --with-mysql --with-pdo-mysql --with-mysqli --enable-ftp --with-gettext --with-xmlrpc --enable-opcache --enable-fpm`
depends on your configuration and extensions for your website requirements
or type `./configure --help` and you will see all list of available options


----------



## Lamia (Jan 15, 2022)

I used to be in the same line of thought that such outdated pkgs should still be deployable and usable. But this is at the detriment of uninformed users on your website, where you are exploiting vulnerabilities in the version of PHP codebase. Perhaps your intentions are different.

The onus is now on the community to decide if this kind of thread should gain momentum.

My 2 cents!


----------

