From 96d5500b130427195d0d3d4259d03faf83204a56 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 23 Sep 2014 17:57:31 +0200 Subject: php 5.6: provides nginx configuration --- nginx-fpm.conf | 6 ++++++ nginx-php.conf | 14 ++++++++++++++ php56.spec | 30 +++++++++++++++++++++++++++++- 3 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 nginx-fpm.conf create mode 100644 nginx-php.conf diff --git a/nginx-fpm.conf b/nginx-fpm.conf new file mode 100644 index 0000000..5b5f9be --- /dev/null +++ b/nginx-fpm.conf @@ -0,0 +1,6 @@ +# PHP-FPM FastCGI server +# network or unix domain socket configuration + +upstream php-fpm { + server 127.0.0.1:9000; +} diff --git a/nginx-php.conf b/nginx-php.conf new file mode 100644 index 0000000..9b01536 --- /dev/null +++ b/nginx-php.conf @@ -0,0 +1,14 @@ +# pass the PHP scripts to FastCGI server +# +# See conf.d/php-fpm.conf for socket configuration +# +index index.php index.html index.htm; + +location ~ \.php$ { + try_files $uri =404; + fastcgi_intercept_errors on; + fastcgi_index index.php; + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_pass php-fpm; +} diff --git a/php56.spec b/php56.spec index f764a9e..96c1534 100644 --- a/php56.spec +++ b/php56.spec @@ -99,6 +99,12 @@ %else %global with_httpd2410 0 %endif +# nginx 1.6 with nginx-filesystem +%if 0%{?fedora} >= 21 +%global with_nginx 1 +%else +%global with_nginx 0 +%endif %if 0%{?fedora} >= 12 || 0%{?rhel} >= 6 %global with_dtrace 1 @@ -127,7 +133,7 @@ Summary: PHP scripting language for creating dynamic web sites Name: php Version: 5.6.1 %if 0%{?snapdate:1}%{?rcver:1} -Release: 0.1.%{?snapdate}%{?rcver}%{?dist} +Release: 0.2.%{?snapdate}%{?rcver}%{?dist} %else Release: 1%{?dist}.2 %endif @@ -158,6 +164,8 @@ Source9: php.modconf Source10: php.ztsmodconf Source11: strip.sh Source12: php.conf2 +Source13: nginx-fpm.conf +Source14: nginx-php.conf # Configuration files for some extensions Source50: opcache.ini Source51: opcache-default.blacklist @@ -208,6 +216,10 @@ BuildRequires: httpd-devel >= 2.0.46-1, pam-devel # to ensure we are using httpd with filesystem feature (see #1081453) BuildRequires: httpd-filesystem %endif +%if %{with_nginx} +# to ensure we are using nginx with filesystem feature (see #1142298) +BuildRequires: nginx-filesystem +%endif BuildRequires: libstdc++-devel, openssl-devel %if 0%{?fedora} >= 11 || 0%{?rhel} >= 6 # For Sqlite3 extension @@ -334,6 +346,10 @@ Requires: httpd-filesystem >= 2.4.10 # php engine for Apache httpd webserver Provides: php(httpd) %endif +%if %{with_nginx} +# for /etc/nginx ownership +Requires: nginx-filesystem +%endif Obsoletes: php53-fpm, php53u-fpm, php54-fpm, php54w-fpm, php55u-fpm, php55w-fpm, php56u-fpm, php56w-fpm %description fpm @@ -1539,6 +1555,11 @@ sed -i -e 's:/run:/var/run:' $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/php-fpm install -m 755 -d $RPM_BUILD_ROOT%{_initrddir} install -m 755 %{SOURCE99} $RPM_BUILD_ROOT%{_initrddir}/php-fpm %endif +%if %{with_nginx} +# Nginx configuration +install -D -m 644 %{SOURCE13} $RPM_BUILD_ROOT%{_sysconfdir}/nginx/conf.d/php-fpm.conf +install -D -m 644 %{SOURCE14} $RPM_BUILD_ROOT%{_sysconfdir}/nginx/default.d/php.conf +%endif # Fix the link (cd $RPM_BUILD_ROOT%{_bindir}; ln -sfn phar.phar phar) @@ -1830,6 +1851,10 @@ fi %config(noreplace) %{_sysconfdir}/php-fpm.d/www.conf %config(noreplace) %{_sysconfdir}/logrotate.d/php-fpm %config(noreplace) %{_sysconfdir}/sysconfig/php-fpm +%if %{with_nginx} +%config(noreplace) %{_sysconfdir}/nginx/conf.d/php-fpm.conf +%config(noreplace) %{_sysconfdir}/nginx/default.d/php.conf +%endif %if %{with_systemd} %{_prefix}/lib/tmpfiles.d/php-fpm.conf %{_unitdir}/php-fpm.service @@ -1917,6 +1942,9 @@ fi %changelog +* Tue Sep 24 2014 Remi Collet 5.6.1-0.2.RC1 +- provides nginx configuration (see #1142298) + * Fri Sep 12 2014 Remi Collet 5.6.1-0.1.RC1 - php 5.6.1RC1 -- cgit