Init script & the green [ OK ]PHP _SERVER[“USER”] and _SERVER[“HOME”] appear from nowherePHP-CGI Not working on CentOS 5?Single fastcgi/php-cgi server for multiple virtualhosts?how to spawn php-cgi automatically when it exits?How to set the httpd.conf when using php-fpm with php(5.3.8) and apache2?Why the php-cgi wrapper script for php-fpm? (Using virtualhost and suexec.)How to tell: Is it nginx or PHP-cgi which is slower?Can't start Hadoop from an init.d scriptPHP-FPM with Apache 2.2.22 and Ubuntu 12.10 - 500 Error, or returns text (not executing)FastCGI: “comm with server aborted: read failed” only for one specific file
Find the cipher used
Who was this character from the Tomb of Annihilation adventure before they became a monster?
Do atomic orbitals "pulse" in time?
How to compact two the parabol commands in the following example?
How can this triangle figure be modeled/drawn with TikZ?
Understanding integration over Orthogonal Group
What is the best way for a skeleton to impersonate human without using magic?
What are the implications of the new alleged key recovery attack preprint on SIMON?
Why in a Ethernet LAN, a packet sniffer can obtain all packets sent over the LAN?
tikz: not so precise graphic
On what legal basis did the UK remove the 'European Union' from its passport?
Make all the squares explode
Why was Endgame Thanos so different than Infinity War Thanos?
How does Howard Stark know this?
How to use structured binding in an array passed as arg to some function?
Is the schwa sound consistent?
List software from restricted, multiverse separately
"Right on the tip of my tongue" meaning?
How to minimise the cost of guessing a number in a high/low guess game?
c++ what does , means after if
Anatomically Correct Carnivorous Tree
Was this a power play by Daenerys?
Repair a file using Audacity?
How did Thanos not realise this had happened at the end of Endgame?
Init script & the green [ OK ]
PHP _SERVER[“USER”] and _SERVER[“HOME”] appear from nowherePHP-CGI Not working on CentOS 5?Single fastcgi/php-cgi server for multiple virtualhosts?how to spawn php-cgi automatically when it exits?How to set the httpd.conf when using php-fpm with php(5.3.8) and apache2?Why the php-cgi wrapper script for php-fpm? (Using virtualhost and suexec.)How to tell: Is it nginx or PHP-cgi which is slower?Can't start Hadoop from an init.d scriptPHP-FPM with Apache 2.2.22 and Ubuntu 12.10 - 500 Error, or returns text (not executing)FastCGI: “comm with server aborted: read failed” only for one specific file
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I am trying to install fast-cgi for nginx on an EC2 instance. I followed the steps explained here, but that is meant for Debian and does not work out of the box for a red-hat based system. I modified the script a bit to look like -
#!/bin/bash
### BEGIN INIT INFO
# Provides: php-fcgi
# Required-Start: $nginx
# Required-Stop: $nginx
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts php over fcgi
# Description: starts php over fcgi
### END INIT INFO
. /etc/rc.d/init.d/functions
(( EUID )) && echo .You need to have root priviliges.. && exit 1
BIND=/tmp/php.socket
USER=nginx
PHP_FCGI_CHILDREN=15
PHP_FCGI_MAX_REQUESTS=1000
PHP_CGI=/usr/bin/php-cgi
PHP_CGI_NAME=`basename $PHP_CGI`
PHP_CGI_ARGS="- USER=$USER PATH=/usr/bin PHP_FCGI_CHILDREN=$PHP_FCGI_CHILDREN PHP_FCGI_MAX_REQUESTS=$PHP_FCGI_MAX_REQUESTS $PHP_CGI -b $BIND"
RETVAL=0
start()
echo -n "Starting PHP FastCGI: "
#ORIGINAL LINE
#daemon $PHP_CGI --quiet --start --background --chuid "$USER" --exec /usr/bin/env -- $PHP_CGI_ARGS
#MODIFIED LINE
daemon --user=$USER $PHP_CGI -b $BIND&
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/php-fcgi
#echo "$PHP_CGI_NAME."
stop()
echo -n "Stopping PHP FastCGI: "
killall -q -w -u $USER $PHP_CGI
RETVAL=$?
echo "$PHP_CGI_NAME."
rm /var/lock/subsys/php-fcgi
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
*)
echo "Usage: php-fastcgi restart"
exit 1
;;
esac
exit $RETVAL
The problem I have now is -
service php-fcgi startkeeps the shell blocked. If I runservice php-fcgi start &and thenps aux, I see the php-cgi process running bound to the socket. I see the start command stop only when I executeservice php-fcgi stop. How do I solve this blocking issue? I have tried adding an&at the end of the line spawning the daemon. But other scripts do not seem to be doing this.
This is the most complicated script I am attempting to modify yet :-(- How do I get the script to display the green
[ OK ]? I checked scripts like httpd and saw that all they were doing was something as shown below. But I never see a green[ OK ]when I executephp-fcgi. I also discovered that puttingecho_successwithfunctionssourced displays the green[ OK ]but I do not see any other scripts in the/etc/rc.d/init.d/executingecho_successorecho_failure. What have I got wrong? - Also, How do i specify
PHP_FCGI_CHILDRENwithdaemon?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/
php fastcgi daemon shell-scripting init.d
add a comment |
I am trying to install fast-cgi for nginx on an EC2 instance. I followed the steps explained here, but that is meant for Debian and does not work out of the box for a red-hat based system. I modified the script a bit to look like -
#!/bin/bash
### BEGIN INIT INFO
# Provides: php-fcgi
# Required-Start: $nginx
# Required-Stop: $nginx
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts php over fcgi
# Description: starts php over fcgi
### END INIT INFO
. /etc/rc.d/init.d/functions
(( EUID )) && echo .You need to have root priviliges.. && exit 1
BIND=/tmp/php.socket
USER=nginx
PHP_FCGI_CHILDREN=15
PHP_FCGI_MAX_REQUESTS=1000
PHP_CGI=/usr/bin/php-cgi
PHP_CGI_NAME=`basename $PHP_CGI`
PHP_CGI_ARGS="- USER=$USER PATH=/usr/bin PHP_FCGI_CHILDREN=$PHP_FCGI_CHILDREN PHP_FCGI_MAX_REQUESTS=$PHP_FCGI_MAX_REQUESTS $PHP_CGI -b $BIND"
RETVAL=0
start()
echo -n "Starting PHP FastCGI: "
#ORIGINAL LINE
#daemon $PHP_CGI --quiet --start --background --chuid "$USER" --exec /usr/bin/env -- $PHP_CGI_ARGS
#MODIFIED LINE
daemon --user=$USER $PHP_CGI -b $BIND&
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/php-fcgi
#echo "$PHP_CGI_NAME."
stop()
echo -n "Stopping PHP FastCGI: "
killall -q -w -u $USER $PHP_CGI
RETVAL=$?
echo "$PHP_CGI_NAME."
rm /var/lock/subsys/php-fcgi
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
*)
echo "Usage: php-fastcgi restart"
exit 1
;;
esac
exit $RETVAL
The problem I have now is -
service php-fcgi startkeeps the shell blocked. If I runservice php-fcgi start &and thenps aux, I see the php-cgi process running bound to the socket. I see the start command stop only when I executeservice php-fcgi stop. How do I solve this blocking issue? I have tried adding an&at the end of the line spawning the daemon. But other scripts do not seem to be doing this.
This is the most complicated script I am attempting to modify yet :-(- How do I get the script to display the green
[ OK ]? I checked scripts like httpd and saw that all they were doing was something as shown below. But I never see a green[ OK ]when I executephp-fcgi. I also discovered that puttingecho_successwithfunctionssourced displays the green[ OK ]but I do not see any other scripts in the/etc/rc.d/init.d/executingecho_successorecho_failure. What have I got wrong? - Also, How do i specify
PHP_FCGI_CHILDRENwithdaemon?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/
php fastcgi daemon shell-scripting init.d
add a comment |
I am trying to install fast-cgi for nginx on an EC2 instance. I followed the steps explained here, but that is meant for Debian and does not work out of the box for a red-hat based system. I modified the script a bit to look like -
#!/bin/bash
### BEGIN INIT INFO
# Provides: php-fcgi
# Required-Start: $nginx
# Required-Stop: $nginx
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts php over fcgi
# Description: starts php over fcgi
### END INIT INFO
. /etc/rc.d/init.d/functions
(( EUID )) && echo .You need to have root priviliges.. && exit 1
BIND=/tmp/php.socket
USER=nginx
PHP_FCGI_CHILDREN=15
PHP_FCGI_MAX_REQUESTS=1000
PHP_CGI=/usr/bin/php-cgi
PHP_CGI_NAME=`basename $PHP_CGI`
PHP_CGI_ARGS="- USER=$USER PATH=/usr/bin PHP_FCGI_CHILDREN=$PHP_FCGI_CHILDREN PHP_FCGI_MAX_REQUESTS=$PHP_FCGI_MAX_REQUESTS $PHP_CGI -b $BIND"
RETVAL=0
start()
echo -n "Starting PHP FastCGI: "
#ORIGINAL LINE
#daemon $PHP_CGI --quiet --start --background --chuid "$USER" --exec /usr/bin/env -- $PHP_CGI_ARGS
#MODIFIED LINE
daemon --user=$USER $PHP_CGI -b $BIND&
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/php-fcgi
#echo "$PHP_CGI_NAME."
stop()
echo -n "Stopping PHP FastCGI: "
killall -q -w -u $USER $PHP_CGI
RETVAL=$?
echo "$PHP_CGI_NAME."
rm /var/lock/subsys/php-fcgi
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
*)
echo "Usage: php-fastcgi restart"
exit 1
;;
esac
exit $RETVAL
The problem I have now is -
service php-fcgi startkeeps the shell blocked. If I runservice php-fcgi start &and thenps aux, I see the php-cgi process running bound to the socket. I see the start command stop only when I executeservice php-fcgi stop. How do I solve this blocking issue? I have tried adding an&at the end of the line spawning the daemon. But other scripts do not seem to be doing this.
This is the most complicated script I am attempting to modify yet :-(- How do I get the script to display the green
[ OK ]? I checked scripts like httpd and saw that all they were doing was something as shown below. But I never see a green[ OK ]when I executephp-fcgi. I also discovered that puttingecho_successwithfunctionssourced displays the green[ OK ]but I do not see any other scripts in the/etc/rc.d/init.d/executingecho_successorecho_failure. What have I got wrong? - Also, How do i specify
PHP_FCGI_CHILDRENwithdaemon?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/
php fastcgi daemon shell-scripting init.d
I am trying to install fast-cgi for nginx on an EC2 instance. I followed the steps explained here, but that is meant for Debian and does not work out of the box for a red-hat based system. I modified the script a bit to look like -
#!/bin/bash
### BEGIN INIT INFO
# Provides: php-fcgi
# Required-Start: $nginx
# Required-Stop: $nginx
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts php over fcgi
# Description: starts php over fcgi
### END INIT INFO
. /etc/rc.d/init.d/functions
(( EUID )) && echo .You need to have root priviliges.. && exit 1
BIND=/tmp/php.socket
USER=nginx
PHP_FCGI_CHILDREN=15
PHP_FCGI_MAX_REQUESTS=1000
PHP_CGI=/usr/bin/php-cgi
PHP_CGI_NAME=`basename $PHP_CGI`
PHP_CGI_ARGS="- USER=$USER PATH=/usr/bin PHP_FCGI_CHILDREN=$PHP_FCGI_CHILDREN PHP_FCGI_MAX_REQUESTS=$PHP_FCGI_MAX_REQUESTS $PHP_CGI -b $BIND"
RETVAL=0
start()
echo -n "Starting PHP FastCGI: "
#ORIGINAL LINE
#daemon $PHP_CGI --quiet --start --background --chuid "$USER" --exec /usr/bin/env -- $PHP_CGI_ARGS
#MODIFIED LINE
daemon --user=$USER $PHP_CGI -b $BIND&
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/php-fcgi
#echo "$PHP_CGI_NAME."
stop()
echo -n "Stopping PHP FastCGI: "
killall -q -w -u $USER $PHP_CGI
RETVAL=$?
echo "$PHP_CGI_NAME."
rm /var/lock/subsys/php-fcgi
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
*)
echo "Usage: php-fastcgi restart"
exit 1
;;
esac
exit $RETVAL
The problem I have now is -
service php-fcgi startkeeps the shell blocked. If I runservice php-fcgi start &and thenps aux, I see the php-cgi process running bound to the socket. I see the start command stop only when I executeservice php-fcgi stop. How do I solve this blocking issue? I have tried adding an&at the end of the line spawning the daemon. But other scripts do not seem to be doing this.
This is the most complicated script I am attempting to modify yet :-(- How do I get the script to display the green
[ OK ]? I checked scripts like httpd and saw that all they were doing was something as shown below. But I never see a green[ OK ]when I executephp-fcgi. I also discovered that puttingecho_successwithfunctionssourced displays the green[ OK ]but I do not see any other scripts in the/etc/rc.d/init.d/executingecho_successorecho_failure. What have I got wrong? - Also, How do i specify
PHP_FCGI_CHILDRENwithdaemon?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/
php fastcgi daemon shell-scripting init.d
php fastcgi daemon shell-scripting init.d
edited May 2 at 2:54
Pang
15916
15916
asked Apr 15 '12 at 21:57
Lord Loh.Lord Loh.
54131023
54131023
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
Change the
daemonline to:daemon --user $USER --pidfile=$PIDFILE "$PHP_CGI -b $BIND &> /dev/null &"&> /dev/nullis equipvalent to>/dev/null 2>&1, means that
redirect both stdout and stderr to/dev/null.If that doesn't show the
[ OK ]flag, try this:if [ -n "$pid" ]; then
echo $pid > $PIDFILE
success "Starting php-cgi service"
else
failure "Starting php-cgi service"
fiTake a look at the
successfunction in the/etc/init.d/functions
for more details.The
stopfunction should change to:killproc -p $PIDFILE $PHP_CGI_NAMEInsert the
PHP_CGI_ARGSas an environment variable to thedaemonfunction:daemon --user $USER --pidfile=$PIDFILE "env - $PHP_CGI_ARGS
$PHP_CGI -b $BIND &> /dev/null &"
Moreover, to make it start automatically at boot, you should change the init info to the Red Hat based style:
# chkconfig: 345 85 15
# description: Running php-cgi
# processname: php-cgi
# config: /etc/sysconfig/php-cgi
There should be an echo after thesuccess,failureorwarningfunctions, as insuccess; echo "Good job!"
– mFeinstein
May 3 '17 at 0:55
As a side note, I can only print the[ OK ]message fromsuccessif I useecho, and I can't see how it should work otherwise after reading the code forsuccess... But, there are pieces of code showingsuccessmessages withoutechoI have no idea how it could work, so if someone understands it, please to tell me
– mFeinstein
May 9 '17 at 7:17
add a comment |
So, you're on a redhat based system, and you want a version of PHP that comes with FPM (the best way to do cgi on PHP >= 5.3)? Why don't you just install the packages from somewhere like IUS: http://iuscommunity.org/ , rather then trying to get a custom-built version working? The repository will allow you to stay up to date a lot easier, and will generally make your life easy.
Once the repo is installed, this is all you'd need to do: chkconfig php-fpm start; service php-fpm start, and you'll be all set.
Thank you for the suggestion. While this will help me with the fast CGI, I would still like to know how to write init scripts. I tried reading a few, but am not able to replicate their behavior.
– Lord Loh.
Apr 16 '12 at 17:26
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "2"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f379706%2finit-script-the-green-ok%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Change the
daemonline to:daemon --user $USER --pidfile=$PIDFILE "$PHP_CGI -b $BIND &> /dev/null &"&> /dev/nullis equipvalent to>/dev/null 2>&1, means that
redirect both stdout and stderr to/dev/null.If that doesn't show the
[ OK ]flag, try this:if [ -n "$pid" ]; then
echo $pid > $PIDFILE
success "Starting php-cgi service"
else
failure "Starting php-cgi service"
fiTake a look at the
successfunction in the/etc/init.d/functions
for more details.The
stopfunction should change to:killproc -p $PIDFILE $PHP_CGI_NAMEInsert the
PHP_CGI_ARGSas an environment variable to thedaemonfunction:daemon --user $USER --pidfile=$PIDFILE "env - $PHP_CGI_ARGS
$PHP_CGI -b $BIND &> /dev/null &"
Moreover, to make it start automatically at boot, you should change the init info to the Red Hat based style:
# chkconfig: 345 85 15
# description: Running php-cgi
# processname: php-cgi
# config: /etc/sysconfig/php-cgi
There should be an echo after thesuccess,failureorwarningfunctions, as insuccess; echo "Good job!"
– mFeinstein
May 3 '17 at 0:55
As a side note, I can only print the[ OK ]message fromsuccessif I useecho, and I can't see how it should work otherwise after reading the code forsuccess... But, there are pieces of code showingsuccessmessages withoutechoI have no idea how it could work, so if someone understands it, please to tell me
– mFeinstein
May 9 '17 at 7:17
add a comment |
Change the
daemonline to:daemon --user $USER --pidfile=$PIDFILE "$PHP_CGI -b $BIND &> /dev/null &"&> /dev/nullis equipvalent to>/dev/null 2>&1, means that
redirect both stdout and stderr to/dev/null.If that doesn't show the
[ OK ]flag, try this:if [ -n "$pid" ]; then
echo $pid > $PIDFILE
success "Starting php-cgi service"
else
failure "Starting php-cgi service"
fiTake a look at the
successfunction in the/etc/init.d/functions
for more details.The
stopfunction should change to:killproc -p $PIDFILE $PHP_CGI_NAMEInsert the
PHP_CGI_ARGSas an environment variable to thedaemonfunction:daemon --user $USER --pidfile=$PIDFILE "env - $PHP_CGI_ARGS
$PHP_CGI -b $BIND &> /dev/null &"
Moreover, to make it start automatically at boot, you should change the init info to the Red Hat based style:
# chkconfig: 345 85 15
# description: Running php-cgi
# processname: php-cgi
# config: /etc/sysconfig/php-cgi
There should be an echo after thesuccess,failureorwarningfunctions, as insuccess; echo "Good job!"
– mFeinstein
May 3 '17 at 0:55
As a side note, I can only print the[ OK ]message fromsuccessif I useecho, and I can't see how it should work otherwise after reading the code forsuccess... But, there are pieces of code showingsuccessmessages withoutechoI have no idea how it could work, so if someone understands it, please to tell me
– mFeinstein
May 9 '17 at 7:17
add a comment |
Change the
daemonline to:daemon --user $USER --pidfile=$PIDFILE "$PHP_CGI -b $BIND &> /dev/null &"&> /dev/nullis equipvalent to>/dev/null 2>&1, means that
redirect both stdout and stderr to/dev/null.If that doesn't show the
[ OK ]flag, try this:if [ -n "$pid" ]; then
echo $pid > $PIDFILE
success "Starting php-cgi service"
else
failure "Starting php-cgi service"
fiTake a look at the
successfunction in the/etc/init.d/functions
for more details.The
stopfunction should change to:killproc -p $PIDFILE $PHP_CGI_NAMEInsert the
PHP_CGI_ARGSas an environment variable to thedaemonfunction:daemon --user $USER --pidfile=$PIDFILE "env - $PHP_CGI_ARGS
$PHP_CGI -b $BIND &> /dev/null &"
Moreover, to make it start automatically at boot, you should change the init info to the Red Hat based style:
# chkconfig: 345 85 15
# description: Running php-cgi
# processname: php-cgi
# config: /etc/sysconfig/php-cgi
Change the
daemonline to:daemon --user $USER --pidfile=$PIDFILE "$PHP_CGI -b $BIND &> /dev/null &"&> /dev/nullis equipvalent to>/dev/null 2>&1, means that
redirect both stdout and stderr to/dev/null.If that doesn't show the
[ OK ]flag, try this:if [ -n "$pid" ]; then
echo $pid > $PIDFILE
success "Starting php-cgi service"
else
failure "Starting php-cgi service"
fiTake a look at the
successfunction in the/etc/init.d/functions
for more details.The
stopfunction should change to:killproc -p $PIDFILE $PHP_CGI_NAMEInsert the
PHP_CGI_ARGSas an environment variable to thedaemonfunction:daemon --user $USER --pidfile=$PIDFILE "env - $PHP_CGI_ARGS
$PHP_CGI -b $BIND &> /dev/null &"
Moreover, to make it start automatically at boot, you should change the init info to the Red Hat based style:
# chkconfig: 345 85 15
# description: Running php-cgi
# processname: php-cgi
# config: /etc/sysconfig/php-cgi
edited Aug 3 '12 at 5:47
answered Aug 3 '12 at 5:08
quantaquanta
43.5k15114196
43.5k15114196
There should be an echo after thesuccess,failureorwarningfunctions, as insuccess; echo "Good job!"
– mFeinstein
May 3 '17 at 0:55
As a side note, I can only print the[ OK ]message fromsuccessif I useecho, and I can't see how it should work otherwise after reading the code forsuccess... But, there are pieces of code showingsuccessmessages withoutechoI have no idea how it could work, so if someone understands it, please to tell me
– mFeinstein
May 9 '17 at 7:17
add a comment |
There should be an echo after thesuccess,failureorwarningfunctions, as insuccess; echo "Good job!"
– mFeinstein
May 3 '17 at 0:55
As a side note, I can only print the[ OK ]message fromsuccessif I useecho, and I can't see how it should work otherwise after reading the code forsuccess... But, there are pieces of code showingsuccessmessages withoutechoI have no idea how it could work, so if someone understands it, please to tell me
– mFeinstein
May 9 '17 at 7:17
There should be an echo after the
success, failure or warning functions, as in success; echo "Good job!"– mFeinstein
May 3 '17 at 0:55
There should be an echo after the
success, failure or warning functions, as in success; echo "Good job!"– mFeinstein
May 3 '17 at 0:55
As a side note, I can only print the
[ OK ] message from success if I use echo, and I can't see how it should work otherwise after reading the code for success... But, there are pieces of code showing success messages without echo I have no idea how it could work, so if someone understands it, please to tell me– mFeinstein
May 9 '17 at 7:17
As a side note, I can only print the
[ OK ] message from success if I use echo, and I can't see how it should work otherwise after reading the code for success... But, there are pieces of code showing success messages without echo I have no idea how it could work, so if someone understands it, please to tell me– mFeinstein
May 9 '17 at 7:17
add a comment |
So, you're on a redhat based system, and you want a version of PHP that comes with FPM (the best way to do cgi on PHP >= 5.3)? Why don't you just install the packages from somewhere like IUS: http://iuscommunity.org/ , rather then trying to get a custom-built version working? The repository will allow you to stay up to date a lot easier, and will generally make your life easy.
Once the repo is installed, this is all you'd need to do: chkconfig php-fpm start; service php-fpm start, and you'll be all set.
Thank you for the suggestion. While this will help me with the fast CGI, I would still like to know how to write init scripts. I tried reading a few, but am not able to replicate their behavior.
– Lord Loh.
Apr 16 '12 at 17:26
add a comment |
So, you're on a redhat based system, and you want a version of PHP that comes with FPM (the best way to do cgi on PHP >= 5.3)? Why don't you just install the packages from somewhere like IUS: http://iuscommunity.org/ , rather then trying to get a custom-built version working? The repository will allow you to stay up to date a lot easier, and will generally make your life easy.
Once the repo is installed, this is all you'd need to do: chkconfig php-fpm start; service php-fpm start, and you'll be all set.
Thank you for the suggestion. While this will help me with the fast CGI, I would still like to know how to write init scripts. I tried reading a few, but am not able to replicate their behavior.
– Lord Loh.
Apr 16 '12 at 17:26
add a comment |
So, you're on a redhat based system, and you want a version of PHP that comes with FPM (the best way to do cgi on PHP >= 5.3)? Why don't you just install the packages from somewhere like IUS: http://iuscommunity.org/ , rather then trying to get a custom-built version working? The repository will allow you to stay up to date a lot easier, and will generally make your life easy.
Once the repo is installed, this is all you'd need to do: chkconfig php-fpm start; service php-fpm start, and you'll be all set.
So, you're on a redhat based system, and you want a version of PHP that comes with FPM (the best way to do cgi on PHP >= 5.3)? Why don't you just install the packages from somewhere like IUS: http://iuscommunity.org/ , rather then trying to get a custom-built version working? The repository will allow you to stay up to date a lot easier, and will generally make your life easy.
Once the repo is installed, this is all you'd need to do: chkconfig php-fpm start; service php-fpm start, and you'll be all set.
answered Apr 16 '12 at 0:31
devicenulldevicenull
5,20312029
5,20312029
Thank you for the suggestion. While this will help me with the fast CGI, I would still like to know how to write init scripts. I tried reading a few, but am not able to replicate their behavior.
– Lord Loh.
Apr 16 '12 at 17:26
add a comment |
Thank you for the suggestion. While this will help me with the fast CGI, I would still like to know how to write init scripts. I tried reading a few, but am not able to replicate their behavior.
– Lord Loh.
Apr 16 '12 at 17:26
Thank you for the suggestion. While this will help me with the fast CGI, I would still like to know how to write init scripts. I tried reading a few, but am not able to replicate their behavior.
– Lord Loh.
Apr 16 '12 at 17:26
Thank you for the suggestion. While this will help me with the fast CGI, I would still like to know how to write init scripts. I tried reading a few, but am not able to replicate their behavior.
– Lord Loh.
Apr 16 '12 at 17:26
add a comment |
Thanks for contributing an answer to Server Fault!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f379706%2finit-script-the-green-ok%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown