php-fpm -t检查配置文件时指向不存在的配置文件

回复 收藏

php编译参数:'./configure' '--prefix=/proj/server/php' '--with-config-file-path=/proj/server/php/etc' '--with-config-file-scan-dir=/proj/server/php/etc/conf.d' '--enable-fpm' '--with-fpm-user=deng' '--with-fpm-group=deng' '--enable-soap' '--with-openssl' '--with-openssl-dir' '--with-mcrypt' '--with-pcre-regex' '--with-zlib' '--with-iconv' '--with-bz2' '--enable-calendar' '--with-curl' '--with-cdb' '--enable-dom' '--enable-exif' '--with-pcre-dir' '--enable-ftp' '--with-gd' '--with-jpeg-dir' '--with-png-dir' '--with-freetype-dir' '--with-gettext' '--with-gmp' '--with-mhash' '--enable-mbstring' '--with-libmbfl' '--with-onig' '--enable-pdo' '--with-pdo-mysql=mysqlnd' '--with-zlib-dir' '--with-readline' '--enable-session' '--enable-shmop' '--enable-simplexml' '--enable-sockets' '--enable-sysvmsg' '--enable-sysvsem' '--enable-sysvshm' '--enable-wddx' '--with-libxml-dir' '--with-xsl' '--enable-zip' '--enable-mysqlnd' '--with-mysql-sock=/tmp/mysql.sock' '--with-mysqli=/proj/server/mysql/bin/mysql_config' '--without-pear'

编译完成后,配置文件无法正常指向/proj/server/php/etc/php-fpm.conf,导致每次检查配置文件时会报错。如下:

[root@localhost ~]# /proj/server/php/sbin/php-fpm -t

[02-Aug-2017 15:00:52] ERROR: failed to open configuration file '/usr/local/php/etc/php-fpm.conf': No such file or directory (2)

[02-Aug-2017 15:00:52] ERROR: failed to load configuration file '/usr/local/php/etc/php-fpm.conf'

[02-Aug-2017 15:00:52] ERROR: FPM initialization failed

查看phpinfo图如下:QQ图片20170802150716.png使用strace进行跟踪发现:

open("/usr/local/php/etc/php-fpm-fcgi.ini", O_RDONLY) = -1 ENOENT (No such file or directory)

open("/usr/local/php/etc/php.ini", O_RDONLY) = -1 ENOENT (No such file or directory)

openat(AT_FDCWD, "/usr/local/php/etc/conf.d", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 ENOENT (No such file or directory)

mmap(NULL, 323584, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f12fab6f000

求助:能够将检查配置时指向编译时指定的目录,不然每次修改ini文件,或者增加模块,无法生效。

2017-08-02 15:08 举报
已邀请:

回复帖子,请先登录注册

退出全屏模式 全屏模式 回复
评分
可选评分理由: