php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #52603 php-fpm default init script does not load php.ini
Submitted: 2010-08-14 07:21 UTC Modified: 2010-08-20 20:23 UTC
From: php at gigfa dot com Assigned: fat (profile)
Status: Not a bug Package: FPM related
PHP Version: 5.3.3 OS: Linux Debian 5.04
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: php at gigfa dot com
New email:
PHP Version: OS:

 

 [2010-08-14 07:21 UTC] php at gigfa dot com
Description:
------------
default php-fpm init script ( found in ./php-5.3.3/sapi/fpm/init.d.php-fpm after compilation ) does not load default php.ini file.
I think to get the problem fixed, we need to replace :
php_opts="--fpm-config $php_fpm_CONF"
with :
php_opts="-c %conf-path% --fpm-config $php_fpm_CONF"
in this file :
./php-5.3.3/sapi/fpm/init.d.php-fpm.in


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-08-14 12:18 UTC] fat@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: fat
 [2010-08-14 12:18 UTC] fat@php.net
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php

If you can provide more information, feel free to add it
to this bug and change the status back to "Open".

Thank you for your interest in PHP.


the default php.ini file is in %{prefix}/lib/php.ini and this file is loaded by 
PHP-FPM even when it's launched by the sapi/fpm/init.d.php-fpm script.

How do you see it's not loaded ?
 [2010-08-14 14:40 UTC] php at gigfa dot com
-Status: Feedback +Status: Assigned
 [2010-08-14 14:40 UTC] php at gigfa dot com
I have compiled php with this option :
./configure \
--enable-fpm \
--with-config-file-path=/etc/php5/php.ini

When I use phpinfo(); to see if the config file has loaded or not, I see :
Configuration File (php.ini) Path 	/etc/php5/php.ini
Loaded Configuration File 	(none)
 [2010-08-20 20:23 UTC] fat@php.net
-Status: Assigned +Status: Bogus
 [2010-08-20 20:23 UTC] fat@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

This not a bug.

./configure ... --with-config-file-path=/etc/php5/php.ini is wrong. You had the 
previous phpinfo output:

#php -i | grep Configuration
Configuration File (php.ini) Path => /etc/php5/php.ini
Loaded Configuration File => (none)


You have to set a directory path to  --with-config-file-path. PHP will search 
there for a php.ini file. In your case, you have to use

./configure ... --with-config-file-path=/etc/php5 is wrong and you'll have the 
following phpinfo output

#php -i | grep Configuration
Configuration File (php.ini) Path => /etc/php5
Loaded Configuration File => /etc/php5/php.ini
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC