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

Re: [PHP] Standard placement of PHP libraries?



On Thursday 04 of August 2005 22:13, sean finney wrote:
> hi,
> > --with-config-file-scan-dir=%{_sysconfdir}/php.d, so registering the PHP
> > extensions is pretty easy. I think we could mimic apache2's layout:
> >
> > /etc/php5/apache/mods-available/500mysql.ini = config file installed from
> > Debian package
> >
> > /etc/php5/apache/php.d/500mysql.ini = symlink created by php5-modconf or
> > simply by postinst script
> >
> > I'm not sure if the "mods-available" is good name... We could also rename
> > "php.d" to "conf.d" like for apache and apache2 packages.
>
> i reported a wishlist bug about this a little over a year ago (#250686).

That why we should talk about it here :)

My proposition is 

/etc/php$VERSION/$SAPI/conf.d/$PRIORITY$PACKAGE - symlink
/etc/php$VERSION/modules/conf.d/$PRIORITY$PACKAGE - real file provided by 
package

The package should create symlink to the all known SAPIs in postinst script. 
The package should remove the symlink in postrm on 'remove' target. If real 
file exists in place of symlink it should be renamed to ".dpkg-tmp" file so 
it will not be readed by PHP. The package should remove the symlink or file 
placed manually on 'purge' target, included ".dpkg-tmp" copy.

An alternative is the symlinks would be created by dpkg itself. I'm against 
this solution because I want to have possibility of manually removing the 
symlink and placing the real file.

What doesn't mean "all known SAPIs"? It should be either hardcoded list of 
supported SAPIs by Debian packages (cli, cgi, apache, apache2) or list readed 
from other config file. The later brings new problem of (de)registering new 
SAPIs...

BTW, the PHP should be patched to ignore *.dpkg-* files in directory (i.e. 
package.dpkg-dist, package.dpkg-old, etc.). It is not critical if packages 
won't install real files into /etc/php$VERSION/$SAPI/conf.d directory.

> > Last, but not least: php5 package installs /etc/apache/conf.d/php5.conf
> > file. This is the problem related to any apache's modules. The problem
> > appears if package is removed but conffile still remains. Remember that
> > we have 4 flavours of Apache server
> > (/etc/{apache,apache-ssl,apache-perl,apache2}/conf.d) and I think we
> > shouldn't provide just one config file for 4 servers.
>
> each server could use the same config file, but it shouldn't be placed
> in the conf.d directory and instead symlinked.  during non-purge
> removal the symlinks could be removed and the file intact.

Are you sure? What if differences between apache.conf and apache2.conf will 
appear? Symlink from? I mean: where should be placed original 
file? /etc/php$VERSION/$SAPI/apache.conf or /etc/php$VERSION/apache.conf?

-- 
 .''`.    Piotr Roszatycki, Netia SA
: :' :    mailto:Piotr_Roszatycki@netia.net.pl
`. `'     mailto:dexter@debian.org
  `-



Reply to: