CentOS下Nginx+PHP7 安装及配置(4)

if [ -n "$try" ] ; then
                        echo " failed. Use force-quit"
                        exit 1
                else
                        echo " done"
                fi
        ;;

status)
                if [ ! -r $php_fpm_PID ] ; then
                        echo "php-fpm is stopped"
                        exit 0
                fi

PID=`cat $php_fpm_PID`
                if ps -p $PID | grep -q $PID; then
                        echo "php-fpm (pid $PID) is running..."
                else
                        echo "php-fpm dead but pid file exists"
                fi
        ;;

force-quit)
                echo -n "Terminating php-fpm "

if [ ! -r $php_fpm_PID ] ; then
                        echo "warning, no pid file found - php-fpm is not running ?"
                        exit 1
                fi

kill -TERM `cat $php_fpm_PID`

wait_for_pid removed $php_fpm_PID

if [ -n "$try" ] ; then
                        echo " failed"
                        exit 1
                else
                        echo " done"
                fi
        ;;

restart)
                $0 stop
                $0 start
        ;;

reload)

echo -n "Reload service php-fpm "

if [ ! -r $php_fpm_PID ] ; then
                        echo "warning, no pid file found - php-fpm is not running ?"
                        exit 1
                fi

kill -USR2 `cat $php_fpm_PID`

echo " done"
        ;;

*)
                echo "Usage: $0 {start|stop|force-quit|restart|reload|status}"
                exit 1
        ;;

esac

八、启动php-fpm程序

/etc/init.d/php-fpm start

# 修改套接字文件权限
chown -R /var/run/php-fpm/

九、相关错误处理

错误一:configure: error: GD build test failed. Please check the config.log for details

在本地已经安装了 gd 和 gd-devel 库以后,还是出现该错误,那么可能是编译工具找不到相关库(jpeg、gd),应该在编译参数后面添加  LDFLAGS='-L /usr/path_to/lib' 如果是 64 位的系统应该写为: LDFLAGS='-L /usr/lib64'  然后重新 configure 即可。

# example
./configure --prefix=/usr/server/php --enable-opcache --enable-opcache --enable-opcache --with-mysqli=mysqlnd --with-mysqli=mysqlnd LDFLAGS='-L /usr/lib64'

Linux公社的RSS地址https://www.linuxidc.com/rssFeed.aspx

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/0229a5ad7555fc4369ef6b9cc82a3bee.html