[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [PHP] Placement of PHP programs?

Matthew Palmer wrote:
> On Fri, 6 Sep 2002, Martin Schulze wrote:
> > The best thing would probably to split such a package properly:
> > 
> > /etc/$package/                for an apache.conf file and package configuration
> > /usr/share/$package/root/     for the DocumentRoot for this package
> > /usr/share/$package/include/  for additional include files[1]
> > /usr/share/$package/data/     for additional data files
> > /usr/share/doc/$package/      for documentation
> > 
> > Since PHP files, include files and data files are not arch-specific,
> > static and belong to a package they should be placed inside of the
> > /usr directory and not inside the /var directory
> I fully agree there.  I assume that the additional include files you speak
> of are those only intended for use within the package.  I wouldn't like to
> see every PHP package with include files have to add
> /usr/share/$package/include to PHP/s include_path.  <g>

Firstly, the directory /usr/share/$package/include/ in my proposal is
only meant for additional include files used in this particular
package.  Such files contain additional routines that are shared among
severaal PHP files and hence moved into a single include file which is
then included by all relevant pages with a statement like:

   // read the $includepath variable, which is set to /usr/share/$package/include/
   include ('/etc/<package>/config.inc');
   include ($includepath .'first.inc');
   include ($includepath .'second.inc');

I don't like it very much to modify the general include path of PHP,
however, that may be a workaround about resistant upstream files.

> This is something which has had a bit of debate - whether /var/www is for
> the admin or the distribution.  I'm inclined to go with your view - that
> it's for the admin, but I can't find any documentation which codifies that
> view.

/var/www is for both, unfortunately.  However, take phpgroupware or
mantis as an example.  It it very likely that they are not installed
as http://localhost/* but as http://vhost.domain/, hence, placing the
files into /var/www would make the files end up in the wrong host.

> > > And what about where in the docroot we put our program for accessability? 
> > 
> > In general it should not matter since you should probably use relative
> > pathnames within the namespace of the particular package.  Hence if it
> > is installed in /, the files are referenced as /foo.php, however, if
> > they're mapped into the web server as /bar/, then all files will be
> > referenced as /bar/foo.php.
> But the apache config will, by default, stick it somewhere in the
> webserver's space.

Which is fine.

>                     Should we be asking a question in Debconf ("where do you
> want to access this from using your web browser?"), pick something and use
> it, or don't do anything and let the user sort it out.  I'm a fan of option
> 1, with a default of the package name.

Why do you want to ask that question?  Given the large variety of
Apache configurations and other web server configurations, the package
will most likely not be able to hook itself properly into the correct
configuration.  Won't such a question not be confusing only?



The good thing about standards is that there are so many to choose from.
	-- Andrew S. Tanenbaum

Please always Cc to me when replying to me on the lists.

Reply to: