<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://wiki.nginx.org/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://wiki.nginx.org/index.php?title=RedHatPHPFCGIInitScript&amp;feed=atom&amp;action=history</id>
		<title>RedHatPHPFCGIInitScript - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://wiki.nginx.org/index.php?title=RedHatPHPFCGIInitScript&amp;feed=atom&amp;action=history"/>
		<link rel="alternate" type="text/html" href="http://wiki.nginx.org/index.php?title=RedHatPHPFCGIInitScript&amp;action=history"/>
		<updated>2013-05-22T23:30:33Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.19.0</generator>

	<entry>
		<id>http://wiki.nginx.org/index.php?title=RedHatPHPFCGIInitScript&amp;diff=3277&amp;oldid=prev</id>
		<title>Oarmstrong: Check init script is executable</title>
		<link rel="alternate" type="text/html" href="http://wiki.nginx.org/index.php?title=RedHatPHPFCGIInitScript&amp;diff=3277&amp;oldid=prev"/>
				<updated>2013-02-20T12:08:42Z</updated>
		
		<summary type="html">&lt;p&gt;Check init script is executable&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr valign='top'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 12:08, 20 February 2013&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 84:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 84:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;/geshi&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;/geshi&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;Ensure that the init script is executable:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;pre&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;# chmod +x /etc/init.d/phpfcgi&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/pre&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Oarmstrong</name></author>	</entry>

	<entry>
		<id>http://wiki.nginx.org/index.php?title=RedHatPHPFCGIInitScript&amp;diff=1616&amp;oldid=prev</id>
		<title>Jkeife: /* PHP/FastCGI Init Script for Red Hat systems */</title>
		<link rel="alternate" type="text/html" href="http://wiki.nginx.org/index.php?title=RedHatPHPFCGIInitScript&amp;diff=1616&amp;oldid=prev"/>
				<updated>2012-02-22T17:12:12Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;PHP/FastCGI Init Script for Red Hat systems&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr valign='top'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 17:12, 22 February 2012&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 2:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 2:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Should work on RHEL, Fedora, CentOS.&amp;#160;  Tested on CentOS 5.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Should work on RHEL, Fedora, CentOS.&amp;#160;  Tested on CentOS 5.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;Note: Before running the init script you need to touch the pid file and change the ownership to the php user&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;pre&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;touch /var/run/phpfcgi.pid&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;chown php:php /var/run/phpfcgi.pid&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/pre&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Save this file as [{{#file: phpfcgi}} /etc/init.d/phpfcgi]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Save this file as [{{#file: phpfcgi}} /etc/init.d/phpfcgi]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Jkeife</name></author>	</entry>

	<entry>
		<id>http://wiki.nginx.org/index.php?title=RedHatPHPFCGIInitScript&amp;diff=311&amp;oldid=prev</id>
		<title>Admin: /* PHP/FastCGI Init Script for Red Hat systems */</title>
		<link rel="alternate" type="text/html" href="http://wiki.nginx.org/index.php?title=RedHatPHPFCGIInitScript&amp;diff=311&amp;oldid=prev"/>
				<updated>2011-01-28T23:40:56Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;PHP/FastCGI Init Script for Red Hat systems&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= PHP/FastCGI Init Script for Red Hat systems =&lt;br /&gt;
&lt;br /&gt;
Should work on RHEL, Fedora, CentOS.   Tested on CentOS 5.&lt;br /&gt;
&lt;br /&gt;
Save this file as [{{#file: phpfcgi}} /etc/init.d/phpfcgi]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;geshi lang=bash&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# Startup script for the PHP FastCGI server.&lt;br /&gt;
#&lt;br /&gt;
# chkconfig: 345 85 15&lt;br /&gt;
# description: PHP is an HTML-embedded scripting language&lt;br /&gt;
# processname: php&lt;br /&gt;
# config: /etc/php.ini&lt;br /&gt;
&lt;br /&gt;
# Source function library.&lt;br /&gt;
. /etc/rc.d/init.d/functions&lt;br /&gt;
&lt;br /&gt;
PHPFCGI=&amp;quot;/usr/bin/php-cgi&amp;quot;&lt;br /&gt;
FCGIPORT=&amp;quot;9000&amp;quot;&lt;br /&gt;
FCGIADDR=&amp;quot;127.0.0.1&amp;quot;&lt;br /&gt;
FCGI_WEB_SERVER_ADDRS=&amp;quot;127.0.0.1&amp;quot;&lt;br /&gt;
PHP_FCGI_CHILDREN=5&lt;br /&gt;
PHP_FCGI_MAX_REQUESTS=1000&lt;br /&gt;
ALLOWED_ENV=&amp;quot;PATH USER&amp;quot;&lt;br /&gt;
PHPUSER=php&lt;br /&gt;
PIDFILE=/var/run/phpfcgi.pid&lt;br /&gt;
&lt;br /&gt;
if [ -z &amp;quot;$PHP_FCGI_CHILDREN&amp;quot; ]; then&lt;br /&gt;
  PHP_FCGI_CHILDREN=5&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
ALLOWED_ENV=&amp;quot;$ALLOWED_ENV PHP_FCGI_CHILDREN PHP_FCGI_MAX_REQUESTS FCGI_WEB_SERVER_ADDRS&amp;quot;&lt;br /&gt;
&lt;br /&gt;
case &amp;quot;$1&amp;quot; in&lt;br /&gt;
  start)&lt;br /&gt;
        PHPFCGI_START=$&amp;quot;Starting ${NAME} service: &amp;quot;&lt;br /&gt;
        echo -n $PHPFCGI_START&lt;br /&gt;
&lt;br /&gt;
        # check for $PHPUSER, create if non-existent&lt;br /&gt;
        if [ -z &amp;quot;`id -u $PHPUSER 2&amp;gt; /dev/null`&amp;quot; ]; then&lt;br /&gt;
            useradd -s /sbin/nologin $PHPUSER&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        # clean environment&lt;br /&gt;
        E=&lt;br /&gt;
        for i in $ALLOWED_ENV; do E=&amp;quot;$E $i=${!i}&amp;quot;; done&lt;br /&gt;
        daemon --user $PHPUSER --pidfile $PIDFILE &amp;quot;env - $E $PHPFCGI -q -b $FCGIADDR:$FCGIPORT &amp;amp;&amp;gt; /dev/null &amp;amp;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        pid=`pidof php-cgi`&lt;br /&gt;
        if [ -n &amp;quot;$pid&amp;quot; ]; then&lt;br /&gt;
            echo $pid &amp;gt; $PIDFILE&lt;br /&gt;
            success $PHPFCGI_START&lt;br /&gt;
        else&lt;br /&gt;
            failure $PHPFCGI_START&lt;br /&gt;
        fi&lt;br /&gt;
        echo&lt;br /&gt;
        ;;&lt;br /&gt;
  stop)&lt;br /&gt;
        echo -n &amp;quot;Stopping php-fcgi: &amp;quot;&lt;br /&gt;
        killproc -p $PIDFILE phpfcgi&lt;br /&gt;
        echo&lt;br /&gt;
        ;;&lt;br /&gt;
  status)&lt;br /&gt;
        status phpfcgi&lt;br /&gt;
        ;;&lt;br /&gt;
  restart)&lt;br /&gt;
        $0 stop&lt;br /&gt;
        $0 start&lt;br /&gt;
        ;;&lt;br /&gt;
  *)&lt;br /&gt;
        echo &amp;quot;Usage: $0 {start|stop|status|restart}&amp;quot;&lt;br /&gt;
        exit 1&lt;br /&gt;
esac&lt;br /&gt;
&lt;br /&gt;
exit 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now you should be able to stop, start, and restart PHP with the usual Red Hat commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# service phpfcgi start&lt;br /&gt;
# service phpfcgi stop&lt;br /&gt;
# chkconfig phpfcgi on&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>