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 ? Regards On Thu, Jan 24, 2013 at 12:02 PM, Amos Jeffries <squid3@xxxxxxxxxxxxx> wrote: > On 24/01/2013 10:44 p.m., Ali Jawad wrote: >> >> Hi >> Checking the db and echoing OK or ERR based on that is easy for me to >> implement in php, for now I did add the following : >> >> external_acl_type MyAclHelper %SRC /etc/squid/myaclhelper.php >> >> myaclhelper.php only contains >> <?php >> echo "OK"; >> ?> >> >> Later on I want to replace that with a mysqldb check and read stdin to >> obtain %SRC, but for now I just want this to work, when squid starts I >> get the following in the log : >> >> The MyAclHelper helpers are crashing too rapidly, need help! >> >> Any help with this simple setup please ? > > > > You need a loop. > > Please read the intro section from the link below on how helpers operate > under Squid: > http://wiki.squid-cache.org/Features/AddonHelpers#How_do_the_helpers_communicate_with_Squid.3F > > (I have just updated it to clarify the I/O criteria helpers must follow and > what the consequences are). > > Amos