# cgi.check_shebang_line default value

- Thread: https://externals.io/message/26560
- Original archive: https://news-web.php.net/php.internals/26560
- Started by Dmitry Stogov on 2006-11-14T10:42:08+00:00
- Messages: 9
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · RFCs at https://externals.io/rfc.md · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #26560 — Dmitry Stogov — 2006-11-14T10:42:08+00:00

URL: https://externals.io/message/26560#26560

Hi,

The following patch adds new INI directive for CGI SAPI.
It may enable/disable check for shebang line (#! /usr/bin/php) and as result
improve performance of FastCGI.

I set the default value for this directive to 1 (that means check file on
each request) to not break previous behavior.
However may be it is better to set default value to 0. That means break
previous behavior but improve performance by default.

Any suggestions?

Thanks. Dmitry.

> -----Original Message-----
> From: Dmitry Stogov [mailto:dmitry@php.net] 
> Sent: Tuesday, November 14, 2006 1:32 PM
> To: php-cvs@lists.php.net
> Subject: [PHP-CVS] cvs: php-src /sapi/cgi cgi_main.c 
> 
> 
> dmitry		Tue Nov 14 10:32:11 2006 UTC
> 
>   Modified files:              
>     /php-src/sapi/cgi	cgi_main.c 
>   Log:
>   cgi.* and fastcgi.* directives are moved to INI subsystem. 
> The new directive cgi.check_shebang_line can be used to 
> ommiting checnk for "#! /usr/bin/php" line.

---

## #26567 — Ilia Alshanetsky — 2006-11-14T14:31:13+00:00

URL: https://externals.io/message/26560#26567 · In reply to: #26560

I think people who want the performance can disable the check, but we  
should not break BC, certainly not at a patch level release.




> Hi,
>
> The following patch adds new INI directive for CGI SAPI.
> It may enable/disable check for shebang line (#! /usr/bin/php) and  
> as result
> improve performance of FastCGI.
>
> I set the default value for this directive to 1 (that means check  
> file on
> each request) to not break previous behavior.
> However may be it is better to set default value to 0. That means  
> break
> previous behavior but improve performance by default.
>
> Any suggestions?
>
> Thanks. Dmitry.
>
> > […]
> -- 
> 
> 

Ilia Alshanetsky

---

## #26576 — Marcus Boerger — 2006-11-14T20:15:23+00:00

URL: https://externals.io/message/26560#26576 · In reply to: #26560

Hello Dmitry,

  i thought we were avoiding new inisettings. And also having a new INI
option takes some time. So is the result really faster?

best regards
marcus

Tuesday, November 14, 2006, 11:42:08 AM, you wrote:

> Hi,

> The following patch adds new INI directive for CGI SAPI.
> It may enable/disable check for shebang line (#! /usr/bin/php) and as result
> improve performance of FastCGI.

> I set the default value for this directive to 1 (that means check file on
> each request) to not break previous behavior.
> However may be it is better to set default value to 0. That means break
> previous behavior but improve performance by default.

> Any suggestions?

> Thanks. Dmitry.

> > […]



Best regards,
 Marcus

---

## #26583 — Stanislav Malyshev — 2006-11-14T21:53:26+00:00

URL: https://externals.io/message/26560#26583 · In reply to: #26576

>   i thought we were avoiding new inisettings. And also having a new INI
> option takes some time. So is the result really faster?

Saves FS access per request. New INI cost is minimal. Now, I think 
avoiding INI makes most sense for INIs that change app behavior. This 
INI changes almost nothing except for allowing you to make things faster 
by removing check you don't use or alternatively enable check for some 
legacy script which uses #! where it really has no meaning but it always 
worked that way.
-- 
Stanislav Malyshev, Zend Products Engineer
stas@zend.com  http://www.zend.com/

---

## #26584 — Marcus Boerger — 2006-11-14T22:02:43+00:00

URL: https://externals.io/message/26560#26584 · In reply to: #26583

Hello Stanislav,

 why not use a command-line switch for itinstead an INI option?

best regards
marcus

Tuesday, November 14, 2006, 10:53:26 PM, you wrote:

> > […]

> Saves FS access per request. New INI cost is minimal. Now, I think 
> avoiding INI makes most sense for INIs that change app behavior. This 
> INI changes almost nothing except for allowing you to make things faster 
> by removing check you don't use or alternatively enable check for some 
> legacy script which uses #! where it really has no meaning but it always 
> worked that way.
> -- 
> Stanislav Malyshev, Zend Products Engineer
> stas@zend.com  http://www.zend.com/




Best regards,
 Marcus

---

## #26585 — Pierre — 2006-11-14T22:05:01+00:00

URL: https://externals.io/message/26560#26585 · In reply to: #26584

Hello,


> Hello Stanislav,
>
>  why not use a command-line switch for itinstead an INI option?

An ini setting is perfectly valid in this case, it can/should be set
to off in 5.2.x and enabled in head. A command line options is really
a bad alternative.

--Pierre

---

## #26586 — Stanislav Malyshev — 2006-11-14T22:11:11+00:00

URL: https://externals.io/message/26560#26586 · In reply to: #26584

>  why not use a command-line switch for itinstead an INI option?

Because FCGI can't use command-line switches in many situations. And 
even if it's allowed it's usually harder to set and easier to miss.
-- 
Stanislav Malyshev, Zend Products Engineer
stas@zend.com  http://www.zend.com/

---

## #26598 — Derick Rethans — 2006-11-15T08:31:39+00:00

URL: https://externals.io/message/26560#26598 · In reply to: #26567

> I think people who want the performance can disable the check, but we should
> not break BC, certainly not at a patch level release.

I agree there.

Derick

---

## #26620 — Richard Lynch — 2006-11-15T20:33:06+00:00

URL: https://externals.io/message/26560#26620 · In reply to: #26560

> The following patch adds new INI directive for CGI SAPI.
> It may enable/disable check for shebang line (#! /usr/bin/php) and as
> result
> improve performance of FastCGI.
>
> I set the default value for this directive to 1 (that means check file
> on
> each request) to not break previous behavior.
> However may be it is better to set default value to 0. That means
> break
> previous behavior but improve performance by default.

For sure, default to non-BC-breaking setting of 1.
That shouldn't even be a question. :-)

Is another .ini setting worth 4% increase in performance?
Not to me, but I'm not the guy that needs 4% CGI improvement on any
servers I run :-)
But another .ini setting doesn't bother me as it does some, so I'm
fine with that.

Killing shebang entirely in 6.0 --- I dunno...  Seems like there's
probably a lot of cron jobs out there relying on it, that nobody will
think of when you ask them, but as soon as you pull the plug, you're
gonna get a zillion complaints...

And as far as not including it in the php.ini, that seems to me like
it would cause more problems than solutions.  It ends up seeming to
php.ini readers like an "Undocumented Feature" or something, and you
just generate more questions than adding one more setting to php.ini

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
