Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:57512 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 67410 invoked from network); 25 Jan 2012 23:23:01 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Jan 2012 23:23:01 -0000 Authentication-Results: pb1.pair.com smtp.mail=robert@xarg.org; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=robert@xarg.org; sender-id=unknown Received-SPF: error (pb1.pair.com: domain xarg.org from 209.85.214.170 cause and error) X-PHP-List-Original-Sender: robert@xarg.org X-Host-Fingerprint: 209.85.214.170 mail-tul01m020-f170.google.com Received: from [209.85.214.170] ([209.85.214.170:49201] helo=mail-tul01m020-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 35/A0-61233-3DE802F4 for ; Wed, 25 Jan 2012 18:23:00 -0500 Received: by obbup3 with SMTP id up3so4797725obb.29 for ; Wed, 25 Jan 2012 15:22:57 -0800 (PST) MIME-Version: 1.0 Received: by 10.182.226.6 with SMTP id ro6mr17502358obc.3.1327533777241; Wed, 25 Jan 2012 15:22:57 -0800 (PST) Received: by 10.60.57.33 with HTTP; Wed, 25 Jan 2012 15:22:57 -0800 (PST) X-Originating-IP: [87.189.124.64] Date: Thu, 26 Jan 2012 00:22:57 +0100 Message-ID: To: PHP internals X-Gm-Message-State: ALoCoQnVe3nfN6Y3LVaB/qoGjQnIW0Lm5rphrBbKIbph67QjspKmnj/eWuSXoIPJ2QTp7GRVRXXe Content-Type: multipart/alternative; boundary=f46d04462f8838453804b7628b6d Subject: Shebang parsing From: robert@xarg.org (Robert Eisele) --f46d04462f8838453804b7628b6d Content-Type: text/plain; charset=ISO-8859-1 Hi, I currently work on a daemon implemented in PHP and as such, I want to keep all configurations in place while the php binary can be used by other cli scripts with the default /etc/php.ini file. I could recompile PHP and add a new folder to the folder which is scanned for php.ini files. A better idea would be a configuration with the shebang like this: #!/usr/local/php/bin/php -c /var/www/php.ini Unfortunately, this doesn't work on Linux due to a bug feature which keeps the shebang parameters as one string on argv[1]. There is already a ticket for this problem: https://bugs.php.net/bug.php?id=53034 My specific problem could be tackled in two ways: - Scan "." every time cli is called for a php.ini file or - Try to make argv interpretation more intelligent and parse/merge shebang parameters. The second solution, would also open the possebility to define constants or make use of all other cli parameters. Well, there's also a quick hack. We could change php_getopt() in order to make this a valid argument: php -c=/var/www/php.ini Anyway, I would provide a patch for the shebang parsing, but I wanted to put out my feelers what you think about this idea in general. I know, it's an OS problem, but we could work around this problem very quickly and improve the usability of cli scripts alot. Robert --f46d04462f8838453804b7628b6d--