Bug #18462 Updated: php -c /path/to/different/php.ini doesn't work
| From: | sniper@php.net | Date: | Tue, 23 Jul 2002 01:25:15 +0000 |
| Subject: | Bug #18462 Updated: php -c /path/to/different/php.ini doesn't work | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-14834@lists.php.net to get a copy of this message | ||
ID: 18462
Updated by: sniper@php.net
Reported By: ceo@l-i-e.com
-Status: Open
+Status: Feedback
Bug Type: PHP options/info functions
Operating System: RedHat 6.2
PHP Version: 4.2.1
New Comment:
That configure line would cause the default search path
for php.ini to be in /usr/local/lib. Before that, the current working
directory is searched, then the path pointed by PHPRC environment
variable, then the compiled in path..
Are you sure none of these were not used before when it worked?
Previous Comments:
------------------------------------------------------------------------
[2002-07-22 21:19:30] ceo@l-i-e.com
There seem to be TWO issues here:
1. Can the filename be included?
2. Does "#!/usr/local/bin -c/path -q" work?
I can only say this to both:
IT WORKED BEFORE!
I've had this running for over six months as a cron job, and
I'm just spewing out *exactly* what was in the files for all
that time. The *ONLY* change I made was to re-compile PHP
with 4.2.1 and a lot more extensions.
Even if you want to posit that the full filename only works
after 4.3.0-dev, and ignore the *FACT* that it worked for
the past six months there is *STILL* the issue of:
#!/usr/local/bin -c/different/path -q
suddenly breaking.
Yes, the work-around for altering the cron to have all the
junk in cron instead of in #! is an okay, if annoying,
work-around. I then have to remember to add the -c/whatever
if I ever decide to do it from the command line -- Which I
probably won't, so I'll waste time chasing down why it's
"broken"
But *EVEN* using:
#!/usr/local/bin/php -c/just/the/path -q
is BROKEN in 4.2.1 and was NOT BROKEN before.
Here is the *OLD* configure I used in 4.1.0 where it wasn't
broken:
./configure \
--with-jpeg-dir \
--with-tiff-dir \
--enable-ftp \
--enable-gd-imgstrttf \
--with-gd \
--with-ttf \
--with-freetype-dir=/usr/local \
--with-t1lib \
--with-imap \
--with-ldap \
--with-pgsql \
--without-mysql \
--enable-versioning \
--enable-memory-limit \
--with-kerberos \
--with-imap-ssl \
--with-pdflib
------------------------------------------------------------------------
[2002-07-22 20:35:30] sniper@php.net
Support for passing the filename for php.ini was added
in 4.3.0-dev... -c only accepts PATH to the php.ini in 4.2.x
------------------------------------------------------------------------
[2002-07-22 16:55:14] ceo@l-i-e.com
#1. It *DID* work JUST FINE for months and months before
this upgrade.
#2. I'm willing to try it without the 'php.ini' in the path,
but I suspect a complete path is needed, since some users
may have desired to have them all in one directory, with
different names.
Either way -- It worked just fine before, and doesn't now,
and it's a documented feature:
php -h
clearly outputs what it's supposed to do.
There may not have been a space between -c and the path
previously... I dinked with that both ways after it b
------------------------------------------------------------------------
[2002-07-21 19:28:12] edink@php.net
Correction: since -c takes path to php.ini, the command should be:
/usr/bin/php -c /home/pocketguide -q /path/to/harvest.php
------------------------------------------------------------------------
[2002-07-21 19:25:34] edink@php.net
I doubt that this has ever worked on Linux due to its shebang line
limitations (#!/usr/bin/php). It's limited to only one argument.
To get around this problem run your cronjob as:
/usr/bin/php -c /home/pocketguide/php.ini -q /path/to/harvest.php
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/18462
--
Edit this bug report at http://bugs.php.net/?id=18462&edit=1