Bug #18462 Updated: php -c /path/to/different/php.ini doesn't work

From: Date: Tue, 23 Jul 2002 01:19:31 +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-14833@lists.php.net to get a copy of this message
ID: 18462 Updated by: ceo@l-i-e.com Reported By: ceo@l-i-e.com -Status: Bogus +Status: Open Bug Type: PHP options/info functions Operating System: RedHat 6.2 PHP Version: 4.2.1 New Comment: 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 Previous Comments: ------------------------------------------------------------------------ [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 ------------------------------------------------------------------------ [2002-07-21 15:34:42] ceo@l-i-e.com The following weekly cron job worked fine until a recent upgrade/install of PHP 4.2.1 using: ./configure \ --enable-calendar \ --enable-bcmath \ --with-jpeg-dir \ --with-png-dir=/usr/local \ --with-tiff-dir \ --enable-ftp \ --with-gd=/usr/local \ --enable-gd-imgstrttf \ --with-ttf \ --with-freetype-dir=/usr/local \ --with-t1lib \ --with-imap \ --with-ldap \ --with-pgsql \ --with-mysql=/usr/src/mysql \ --disable-debug \ --with-kerberos \ --with-imap-ssl \ --with-pdflib \ --with-swf=/usr/src/libswf \ --with-xmlrpc=/usr/local \ --with-expat-dir=/usr/local \ --with-dom \ --with-zlib \ --enable-sockets ./harvest.php X-Powered-By: PHP/4.2.1^M Content-type: text/html^M ^M <br /> <b>Fatal error</b>: Failed opening required 'connect.inc' (include_path='.:/usr/local/lib/php') in <b>/home/www/pocketguide/cron/harvest.php</b> on line <b>6</b><br /> head ./harvest.php #!/usr/bin/php -c /home/pocketguide/php.ini -q <?php /* harvest.php Automatically harvest performers and dates from venue web-sites */ require 'connect.inc'; require 'publication.inc'; grep include_path /home/pocketguide/php.ini include_path = "./:/home/pocketguide/include/" ; UNIX: "/path1:/path2" Windows: "\path1;\path2" In essence, it would appear that the "-c" option is no longer working. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=18462&edit=1

« previous php.bugs (#14833) next »