How can I release freebsd with apache php application files?

Polytropon freebsd at
Thu May 5 10:24:51 UTC 2016

On Thu, 5 May 2016 11:56:25 +0200, Mathe Eliel wrote:
>  am happy to come to this great community of developers. I have a concern
> on releasing freebsd. I am making an application in php and html that
> interfaces some other applications on freebsd. Now I made a release by some
> commands provided by FreeBSD like make buildworld, make release, ... then I
> got the files: .iso and .img . Now, when I installed them, the php files
> that were written in the first system were not found and the /usr/local
> directory was empty. How can I release FreeBSD thus I may find all the
> files I added and all the ports or packages I downloaded? I was inspired by
> pfsense which is a fork of FreeBSD. Thank you very much.

The key is that both PHP and your application files are not part
of the FreeBSD OS. The "make release" procedure creates an installation
media for FreeBSD, but it usually does not include "3rd party programs"
which reside in the /usr/local subtree. For this component, you should
create a port for your application, and define Apache, PHP (and what
other utilities you might need) as dependencies. Then you can create
a package. Add this package as well as the dependency packages to the
installation media and have them installed via pkg (afterwards).

Always keep in mind that /usr/local is _not_ part of the OS. This is
pkg's domain. :-)

Another solution, probably not "very correct", is to make an image from
a system where you've installed FreeBSD, Apache, PHP, your application
and its dependencies. Then you just use a script to prepare installation
disks (partitioning and newfs), then extract those images to the desired
partition(s) as needed.

For creating a port, see the "FreeBSD Porter's Handbook":

Probably "6.15. Web Applications, Apache and PHP" will help:

It's much easier than it sounds, and it will free you from lots of tasks
including dependency tracking, package registration, configuration files,
and updating.

Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...

More information about the freebsd-questions mailing list