On 25/01/2013 2:44 a.m., Ali Jawad wrote:
> Thanks for that I did change the script to
>
> <?php
> $f = fopen( 'php://stdin', 'r' );
>
> while( $line = fgets( $f ) ) {
> echo "OK";
> }
>
>
> ?>
>
> while testing in command line using :
>
> /usr/bin/php myaclhelper.php
>
> Each time I press enter it returns OK, it keeps running and does not
> exit. However in squid log I get :
>
> The MyAclHelper helpers are crashing too rapidly, need help!
>
> What I think is wrong is that I need to identify what needs to handle
> the script, I.e. how does squid know this is a php script and not a
> perl script ?
Squid doesn't know. Squid passes the command line you configured in
external_acl_type to the OS.
The external_ac_type directive definition is:
external_acl_type <options> <%FORMAT codes> <command line>
Looking at your mail, I see you are testing with a different command
line syntax than the squid.conf contains.
You will get the same crash/abort that Squid sees if you ran the command
line:
/etc/squid/myaclhelper.php
NOTE 1: To run a script without specifying the interpreter on the
command line you need to add "#!/usr/bin/php" as the first line.
NOTE 2: also be aware that PHP is not a good language for Squid helpers.
PHP has a number of built-in timeouts (on std I/O sockets, on script
run-time, and on Zend engine run-time) which automatically shut down the
helper at various times from 30 seconds after starting to every hour.
These sudden shutdowns can also cause Squid problems.
Amos
Received on Thu Jan 24 2013 - 23:52:52 MST
This archive was generated by hypermail 2.2.0 : Fri Jan 25 2013 - 12:00:05 MST