1 %define apxs /usr/sbin/apxs1
2 Summary: Support for the PHP via FastCGI protocol for Apache webserver
7 Group: Applications/WWW
8 BuildRequires: apache1-devel >= 1.3.39
9 BuildRequires: rpmbuild(macros) >= 1.268
10 Requires: apache1-mod_fastcgi
11 Requires: php-fcgi >= 4:%{version}
12 Requires: php-fcgi-init
13 Provides: webserver(php) = %{version}
15 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
17 %define _sysconfdir %(%{apxs} -q SYSCONFDIR 2>/dev/null)
18 %define fcgiapp /usr/bin/php.fcgi
21 This virtual package provides support for the PHP via FastCGI
27 cat <<'EOF' > apache.conf
28 # setup via fastcgi to run php5
29 <IfModule mod_fastcgi.c>
30 # the server name is bogus actually, to satisfy mod_fastcgi
31 FastCgiExternalServer %{fcgiapp} -socket /var/run/php/fcgi.sock
32 ScriptAlias /php-fcgi %{fcgiapp}
33 <Location "/php-fcgi">
34 SetHandler fastcgi-script
38 Action application/x-httpd-php-fcgi /php-fcgi
41 # To register handler for .php in your config context:
42 #<IfModule mod_fastcgi.c>
43 # AddType application/x-httpd-php-fcgi .php
48 rm -rf $RPM_BUILD_ROOT
49 install -d $RPM_BUILD_ROOT%{_sysconfdir}/conf.d
50 cp -a apache.conf $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/90_php-fcgi.conf
53 rm -rf $RPM_BUILD_ROOT
56 %service -q apache restart
59 if [ "$1" = "0" ]; then
60 %service -q apache restart
64 %defattr(644,root,root,755)
65 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/*_php-fcgi.conf