|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-03-13 14:19 UTC] schwarz at power-netz dot de
Description: ------------ php 5.1.2 does not search in /home/user/public_html/xxx/ for the php.ini if the script lies i.e. here /home/user/public_html/xxx/script.php Same as bug #33882 from 2005 Notes: We have renamed the php-cgi.ini to php5-cgi.ini to be able to use php4 and php5 on the same system. Source has been changed since 5.0.0 and worked up to/including 5.0.3 without any problems. Expected result: ---------------- bash-2.04# pwd /home/benderircde/public_html bash-2.04# strace php5 /home/benderircde/public_html/php5/info.php 2>&1 | grep php5-cgi.ini open("/home/benderircde/public_html/php5/php5-cgi.ini", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/local/apache/conf//php5-cgi.ini", O_RDONLY) = 3 lstat64("/usr/local/apache/conf/php5-cgi.ini", {st_mode=S_IFREG|0644, st_size=25282, ...}) = 0 <tr><td class="e">Configuration File (php.ini) Path </td><td class="v">/usr/local/apache/conf/php5-cgi.ini </td></tr> Actual result: -------------- bash-2.04# pwd /home/benderircde/public_html bash-2.04# strace php5 /home/benderircde/public_html/php5/info.php 2>&1 | grep php5-cgi.ini open("/home/benderircde/public_html/php5-cgi.ini", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/local/apache/conf//php5-cgi.ini", O_RDONLY) = 3 lstat64("/usr/local/apache/conf/php5-cgi.ini", {st_mode=S_IFREG|0644, st_size=25282, ...}) = 0 <tr><td class="e">Configuration File (php.ini) Path </td><td class="v">/usr/local/apache/conf/php5-cgi.ini </td></tr> PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 08:00:01 2025 UTC |
You are right, php4 and 5.0.3 don't seek inside the script dir directly. The Apache sets the current directory to the scripts directory and php4 + 5.0.3 try to open "./php-cgi.ini" which 5.1.2 does not try. Pls see here for the difference: bash-2.04# pwd /home/benderircde/public_html/php5 bash-2.04# cd /home/benderircde/public_html/php5 bash-2.04# strace php5 /home/benderircde/public_html/php5/info.php 2>&1 | grep php5-cgi.ini open("/usr/local/apache/conf//php5-cgi.ini", O_RDONLY) = 3 lstat64("/usr/local/apache/conf/php5-cgi.ini", {st_mode=S_IFREG|0644, st_size=25282, ...}) = 0 <tr><td class="e">Configuration File (php.ini) Path </td><td class="v">/usr/local/apache/conf/php5-cgi.ini </td></tr> bash-2.04# strace php5.0.3 /home/benderircde/public_html/php5/info.php 2>&1 | grep php5-cgi.ini open("./php5-cgi.ini", O_RDONLY) = 3 lstat64("/home/benderircde/public_html/php5/php5-cgi.ini", {st_mode=S_IFREG|0644, st_size=339, ...}) = 0 <tr><td class="e">Configuration File (php.ini) Path </td><td class="v">/home/benderircde/public_html/php5/php5-cgi.ini </td></tr> bash-2.04# strace php /home/benderircde/public_html/php5/info.php 2>&1 | grep php-cgi.ini open("./php-cgi.ini", O_RDONLY) = 3 lstat64("/home/benderircde/public_html/php5/php-cgi.ini", {st_mode=S_IFREG|0644, st_size=339, ...}) = 0 <tr><td class="e">Configuration File (php.ini) Path </td><td class="v">/home/benderircde/public_html/php5/php-cgi.ini </td></tr> bash-2.04#Works fine here: mike@honeybadger:~/development/testimonials$ strace -o t ../php/5.1/sapi/cgi/php -i >/dev/null; grep "\.ini" t; rm t; lstat64("/home/mike/development/php/5.1/sapi/cgi/php-cgi.ini", 0xbfedf5fc) = -1 ENOENT (No such file or directory) open("/home/mike/development/php/5.1/sapi/cgi/php-cgi.ini", O_RDONLY) = -1 ENOENT (No such file or directory) lstat64("/home/mike/development/testimonials/php-cgi.ini", 0xbfedf5fc) = -1 ENOENT (No such file or directory) open("/home/mike/development/testimonials/php-cgi.ini", O_RDONLY) = -1 ENOENT (No such file or directory) lstat64("/home/mike/development/php/5.1/sapi/cgi/php.ini", {st_mode=S_IFLNK|0777, st_size=13, ...}) = 0 readlink("/home/mike/development/php/5.1/sapi/cgi/php.ini", "../../php.ini", 4096) = 13 lstat64("/home/mike/development/php/5.1/php.ini", {st_mode=S_IFREG|0644, st_size=103, ...}) = 0 open("/home/mike/development/php/5.1/php.ini", O_RDONLY) = 3 lstat64("/home/mike/development/php/5.1/sapi/cgi/php.ini", {st_mode=S_IFLNK|0777, st_size=13, ...}) = 0 readlink("/home/mike/development/php/5.1/sapi/cgi/php.ini", "../../php.ini", 4096) = 13 lstat64("/home/mike/development/php/5.1/php.ini", {st_mode=S_IFREG|0644, st_size=103, ...}) = 0 write(1, "Configuration File (php.ini) Pat"..., 33) = 33