Skip navigation

allow call time pass reference in php.ini for TYPO3 on Dreamhost

Wanting to publish an RSS feed on a TYPO3 site recently I ran into errors relating to the php configuration of Dreamhost.  To solve this I followed the instruction for using your own modified version of php.ini on the wiki which essentially copies the latest Dreamhost version of php.cgi and php.ini into a newly created cgi-bin directory.

Here’s the error received from the extension kik_rssfeeds

Warning: Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration of xml_set_object(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. in /home/<snip>/typo3conf/ext/kik_rssfeeds/pi1/class.tx_kikrssfeeds_pi1.php on line 793

Using this Dreamhost discussion post as my basis I created my php-copy.sh script locally on my Mac in Smultron so it looked like this:

#!/bin/sh
CGIFILE="$HOME/replace_your_domain.co.uk/cgi-bin/php.cgi"
INIFILE="$HOME/</code><code>replace_your_domain</code><code>.co.uk/cgi-bin/php.ini"
rsync -a /dh/cgi-system/php5.cgi "$CGIFILE"
# REMOVE THE FOLLOWING LINE TO CREATE THE UPDATE-ONLY SCRIPT:
cp /etc/php5/cgi/php.ini "$INIFILE"
perl -p -i -e '
s/.*post_max_size.*/post_max_size = 100M/;
s/.*upload_max_filesize.*/upload_max_filesize = 100M/;
s/.*allow_call_time_pass_reference =.*/allow_call_time_pass_reference = On/;
' "$INIFILE"

I copied the contents to my clipboard, opened a Terminal window, ssh’ed into my account and created the script file in my home directory like this:

vim php-copy.sh

Then hit i (to enter Insert mode), paste, hit Escape and type:wq to write the file and quit Vim.

.htaccess files were edited and similarly created as per the wiki instructions and the site retested (using a Draft Workspace).

Problem solved unless you’re using one of the many TYPO3 extensions which still use fopen instead of cURL.  For maximum ease I suggest you change e.g. from to tw_rssfeed to kik_rssfeeds.

The final part of the wiki article takes you through creating an update script and getting it called weekly by the cron process.  This important step ensures that you’re using Dreamhost’s latest version of PHP.

The copied and altered php-copy.sh script from above becomes php-update.sh

#!/bin/sh
CGIFILE="$HOME/replace_your_domain.co.uk/cgi-bin/php.cgi"
INIFILE="$HOME/replace_your_domain.co.uk/cgi-bin/php.ini"
rsync -a /dh/cgi-system/php5.cgi "$CGIFILE"
perl -p -i -e '
s/.*post_max_size.*/post_max_size = 100M/;
s/.*upload_max_filesize.*/upload_max_filesize = 100M/;
s/.*allow_call_time_pass_reference =.*/allow_call_time_pass_reference = On/;
' "$INIFILE"

If you’re confident you can keep on top of any PHP vulnerabilities that occur you could ignore this but don’t be tempted to stop here if you’re a crontab virgin.  The instructions work out-of-the-box and if you’ve got this far you shouldn’t have any problems.

1 response so far ↓

  • 1 giovanni // Aug 22, 2009 at 8:37 am

    Have you an email address where I can contact you about typo3 and DreamHost?
    Thanks anyway, and apologizes for the post but have not found your email address

Leave a Comment