阿哥论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 409|回复: 0

Apache httpd server 2.4.10 and PHP-FPM 5.6 in Fedora 21

[复制链接]
 楼主| 发表于 2015-4-17 16:39:30 | 显示全部楼层 |阅读模式
apache httpd server 2.4.10 and PHP-FPM 5.6 in Fedora 21   
[size=1.2em]
Since the update in Fedora 21 of httpd version 2.4.10 and php 5.6.0RC3, you can avoid using mod_php. php-fpm works "out of the box", with default provided configuration.

[size=1.2em]
Installation:
# yum remove php
# yum install php-fpm httpd
Services:
# systemctl start php-fpm.service
# systemctl start httpd.service
Test
# echo '<?php phpinfo()' >/var/www/html/info.php
You should see the message :  Server API: FPM/FastCGI
Configuration
The default provided configuration now work in Fedora 21.
You can use the same in Fedora 19 and 20, applying some change to your PHP configuration file  /etc/httpd/conf.d/php.conf
Disable the php_* directives, when mod_php is not loaded:
# mod_php options
<IfModule  mod_php5.c>
    ...
    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>
Enable redirect the execution of php scripts to php-fpm service:
# Redirect to local php-fpm if mod_php is not available
<IfModule !mod_php5.c>
    <FilesMatch \.php$>
        SetHandler "proxy:fcgi://127.0.0.1:9000"
    </FilesMatch>
</IfModule>
Apache httpd server optimisation
Time to leave the prefork MPM in /etc/httpd/conf.modules.d/00-mpm.conf
LoadModule mpm_event_module modules/mod_mpm_event.so
For packagers
php-fpm only pull httpd-filesystem, for user creation and configuration directory ownership and can still be used without httpd, for example with  nginx. Despite I still think than Apache httpd server still the best server to package web applications, mostly as it allows to drop a configuration file, per application, with global alias.
I encourage you to test your applications with this configuration, especially to ensure than all php_* directives are properly conditionalized..
Next step will be to drop the dependency on mod_php and give back the choice to our users.
Conclusion
This feature finally drop the difficulty to use PHP-FPM and other Apache MPM. A pity that it is not available in httpd version provided by RHEL/CentOS-7 or by RHSCL 1.1.


Apache httpd server 2.4.10 and PHP-FPM 5.6 in Fedora 21   
摘自:http://blog.famillecollet.com/po ... ?utm_source=tuicool

该会员没有填写今日想说内容.
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表