diff options
author | Michael Orlitzky <mjo@gentoo.org> | 2016-01-21 19:30:25 -0500 |
---|---|---|
committer | Michael Orlitzky <mjo@gentoo.org> | 2016-01-21 19:45:28 -0500 |
commit | 1d1a53e19a9dab621249c1cdf698e2aec30d5d1a (patch) | |
tree | fb9afb0896d493eca11909ad01dc8d20c2bf9ffb /src | |
parent | Replace custom bindir handling with the new autotools magic. (diff) | |
download | eselect-php-1d1a53e19a9dab621249c1cdf698e2aec30d5d1a.tar.gz eselect-php-1d1a53e19a9dab621249c1cdf698e2aec30d5d1a.tar.bz2 eselect-php-1d1a53e19a9dab621249c1cdf698e2aec30d5d1a.zip |
Add 70_mod_php.conf.in to the project source.
We are currently shipping 70_mod_php.conf as part of the Gentoo ebuild
for eselect-php. This introduces a potential disconnect between the
path in php.eselect and the path in 70_mod_php.conf. By adding the
conf file to the project, we are able to ensure that they are both
set to the same value. Moreover, the new autotools directory magic
lets us set them both based on @localstatedir@. So, for example, in
the conf file we have "@localstatedir@/lib/eselect-php/mod_php.conf"
and in php.eselect we have "@localstatedir@/lib/eselect-php".
We have followed the PHP project's lead in assuming that
$localstatedir will be set to (for example) /var and not /var/lib.
See Gentoo bug 572002. For testing, you should now use something like,
./configure --bindir=/usr/bin --sysconfdir=/etc --localstatedir=/var
Of course, the ebuild for eselect-php will automatically pass the
correct values to ./configure.
Diffstat (limited to 'src')
-rw-r--r-- | src/70_mod_php.conf.in | 24 | ||||
-rw-r--r-- | src/php.eselect.in.in | 2 |
2 files changed, 25 insertions, 1 deletions
diff --git a/src/70_mod_php.conf.in b/src/70_mod_php.conf.in new file mode 100644 index 0000000..4b97354 --- /dev/null +++ b/src/70_mod_php.conf.in @@ -0,0 +1,24 @@ +<IfDefine PHP> + # The mod_php.so symlink is controlled by + # eselect-php. However, the module name changed from + # php5_module to php7_module so we can't blindly load whatever + # is there. Instead we let eselect-php manage a small + # configuration file that loads the appropriate module. + Include "@localstatedir@/lib/eselect-php/mod_php.conf" + + # Tell apache that mod_php should handle PHP files. + # + # NOTE: Avoiding AddHandler/AddType for security (bug + # #538822). Please read the related news item! + <FilesMatch "\.(php|php[57]|phtml)$"> + SetHandler application/x-httpd-php + </FilesMatch> + + # PHP source files which are meant to be displayed as + # syntax-highlighted source code. + <FilesMatch "\.phps$"> + SetHandler application/x-httpd-php-source + </FilesMatch> + + DirectoryIndex index.php index.phtml +</IfDefine> diff --git a/src/php.eselect.in.in b/src/php.eselect.in.in index e24cd39..689b1db 100644 --- a/src/php.eselect.in.in +++ b/src/php.eselect.in.in @@ -332,7 +332,7 @@ get_sapi_active_target() { # write_mod_php_conf() { local target="${1}" - local conf_dir="${EROOT}"/var/lib/eselect-php + local conf_dir="@localstatedir@/lib/eselect-php" local conf_path="${conf_dir}/mod_php.conf" @MKDIR_P@ "${conf_dir}" || die "failed to create ${conf_dir}" |