[Fedora-php-devel-list] PHP 5.6 change proposal for F21 - Apache configuration

Remi Collet Fedora at FamilleCollet.com
Thu Apr 3 07:35:37 UTC 2014


Another change proposal.

===== /etc/httpd/conf.d/php.conf =====
=> provided by both php and php-fpm packages

#
# The following lines prevent .user.ini files from being viewed by Web
clients.
#
<Files ".user.ini">
    Require all denied
</Files>

#
# Allow php to handle Multiviews
#
AddType text/html .php

#
# Add index.php to the list of files that will be served as directory
# indexes.
#
DirectoryIndex index.php

# mod_php options
<IfModule  mod_php5.c>
    #
    # Cause the PHP interpreter to handle files with a .php extension.
    #
    <FilesMatch \.php$>
        SetHandler application/x-httpd-php
    </FilesMatch>

    #
    # Uncomment the following lines to allow PHP to pretty-print .phps
    # files as PHP source code:
    #
    #<FilesMatch \.phps$>
    #    SetHandler application/x-httpd-php-source
    #</FilesMatch>

    #
    # Apache specific PHP configuration options
    # those can be override in each configured vhost
    #
    php_value session.save_handler "files"
    php_value session.save_path    "/var/lib/php/session"
    php_value soap.wsdl_cache_dir  "/var/lib/php/wsdlcache"
</IfModule>


===== /etc/httpd/conf.d/php-fpm.conf =====
=> provided by php-fpm package

<IfModule !mod_php5.c>
    #
    # Cause the PHP interpreter to handle files with a .php extension.
    #
    <FilesMatch \.php$>
         SetHandler "proxy:fcgi://127.0.0.1:9000"
    </FilesMatch>
</IfModule>



Benefit: web applications could then require Apache AND (php OR php-fpm)
and admin can switch from httpd prefork MPM + mod_php to httpd threaded
MPM (worker or event) + php-fpm.


- except if using http authentication
(ex: phpMyAdmin, which could be easily changed to work with php-fpm)

- if using php_value, php_flag, those directives need to be
conditionalized, and also defined in .user.ini file for php-fpm.


Comments ?

Remi.




More information about the php-devel mailing list