RSS
 

set php allow_call_time_pass_reference in .htaccess

30 Mar

I just spent about an hour trying to figure this out, but when you have a php application that requires call time pass reference to be enabled, you can set in the .htaccess file.  The trick on some systems is that it must be set to “1″ and not “on” as is indicated on the PHP support forums. here’s the code:

php_flag allow_call_time_pass_reference 1

Whether or not you need to use “1″ or “on” seems to depend on the install and whether you’re using PHP version 4 or 5.

 
8 Comments

Posted in Apache, PHP

 

Leave a Reply

 
Please leave these two fields as-is:
 
  1. Jesse Donat

    September 17, 2007 at 11:15 am

    You just saved me some time! Thanks.

     
  2. sanguis

    December 12, 2007 at 3:25 pm

    didn’t work for me but I bet there is a good reason for that.

     
  3. dj.luiting

    May 1, 2008 at 6:13 am

    i was doing an install of another program, that said i needed this option. luckily i found your post after some google-ing.
    i first tried
    allow_call_time_pass_reference 1
    without php_flag at the beginning
    that didnt work
    thanks!

     
  4. Hassan Masood

    August 4, 2009 at 6:20 pm

    What to write in the HTaccess file other than that
    ‘ php_flag allow_call_time_pass_reference 1 ‘

    because when i create a htaccess file … i get at 404 page….

    Thanks
    Hassan

     
    • Jason

      August 11, 2009 at 3:51 pm

      Hey Hassan, your host server is probably not set to allow php settings in .htaccess. I would check with support for your host provider or if it’s your own server, check the forums for whatever OS you are using.

       
  5. Hermes

    February 3, 2010 at 3:34 pm

    FYI I tried using the string above:
    php_flag allow_call_time_pass_reference 1

    And it did not work for me. I had to use:
    php_flag allow_call_time_pass_reference on

    This is with PHP Version 5.1.6

     
  6. Hermes

    February 3, 2010 at 3:36 pm

    Oh! Important note about my comment above: I was modifying the vhost.conf file of a site on a Plesk installation rather than an .htaccess file, if that perhaps makes any difference.

     
  7. Jason

    February 3, 2010 at 5:16 pm

    @Hermes
    Thanks Hermes, I updated the page to indicate that it may be one or the other.