Heim  >  Artikel  >  php教程  >  nginx中查看关于php的配置和php

nginx中查看关于php的配置和php

WBOY
WBOYOriginal
2016-06-06 20:01:59833Durchsuche

1.查看当前使用的php的配置信息 在php项目的根目录下新建findini.php文件,内容如下: ?php phpinfo();? 然后在页面上访问就可以看到如下页面: 搜索Loaded Configuration File,即可查询到php目前使用的是什么配置文件。 2.关于php-fpm重启等操作 php 5.3.3

1.查看当前使用的php的配置信息

在php项目的根目录下新建findini.php文件,内容如下:

<?php phpinfo();
?>
然后在页面上访问就可以看到如下页面:

nginx中查看关于php的配置和php

搜索Loaded Configuration File,即可查询到php目前使用的是什么配置文件。

2.关于php-fpm重启等操作

php 5.3.3 源码中已经内嵌了 php-fpm,不用象以前的php版本一样专门打补丁了,只需要在configure的时候添加编译参数即可。
关于php-fpm的编译参数有 –enable-fpm –with-fpm-user=www –with-fpm-group=www –with-libevent-dir=libevent位置。
但是,php 5.3.3 下的php-fpm 不再支持 php-fpm 以前具有的 /usr/local/php/sbin/php-fpm (start|stop|reload)等命令,需要使用信号控制:

master进程可以理解以下信号

INT, TERM 立刻终止
QUIT 平滑终止
USR1 重新打开日志文件
USR2 平滑重载所有worker进程并重新载入配置和二进制模块

示例:
php-fpm 关闭:

kill -INT `cat /usr/local/php/var/run/php-fpm.pid`
php-fpm 重启:
kill -USR2 `cat /usr/local/php/var/run/php-fpm.pid`
查看php-fpm进程数:
ps aux | grep -c php-fpm

如果找不到对应的pid文件可以如下方式查找:

ps -aux|grep php-fpm

如下显示的即为主进程:

root     12030  0.0  0.0 129360  4076 ?        Ss   18:35   0:00 php-fpm: master process (/usr/local/php/etc/php-fpm.conf)
Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn
Vorheriger Artikel:php的memcached扩展Nächster Artikel:Linux上安装PHP的问题