I am getting some PHP warnings in $messages when installing aegir alpha6 on Fedora 12.
Here is one:
warning: Parameter 1 to hosting_nodeapi_platform_load() expected to be a reference, value given in /var/aegir/hostmaster-0.4-alpha6/includes/module.inc on line 483.
Line 483 is 'module_invoke_all()'. The called function is in the hostmaster profile, and the parameter in question is "&$node". It doesn't appear that the $node needs to be passed by reference, it is not modified.
This also occurred for other functions during the install (install.php), like 'hosting_db_server_nodeapi_server_presave()'.
Is this a bug, or something specific to my php install (version 5.3.2)?
Comments
Comment #1
Anonymous (not verified) commentedIt sounds like a PHP 5.3 thing. I have not seen this on any other installations (even CentOS) which use older PHP versions.
I don't know much about 5.3 but I see it causes a lot of grief with Drupal and OpenAtrium in general..
Comment #2
Mike_Waters commentedCould it be (from http://www.php.net/manual/en/migration53.incompatible.php):
Could it be that the called function ("hosting_nodeapi_platform_load) signature is incorrect, or is it abusing the fact that pre-5.3 PHP does not care if a reference is passed or not?
FYI
The error is at:
where $function is "hosting_nodeapi_platform_load"; do you know offhand if, when this call is made using this function, the $arg (which appears to be a $node object) should be passed as a reference or not? I don't have a debugger set up on this box...
Comment #3
Mike_Waters commentedI've looked at other implementations of hook_load, and none of them expect a reference.
So, changing the signature to expect pass by value (line 619 of hosting_nodeapi_platform_load() in hosting_client.module), nothing seems to have gone wrong (yet) and the warnings have disappeared.
Comment #4
kewlguy commentedI am also getting this error with PHP Version => 5.3.2-1ubuntu4
What would be the recommended action to take? Downgrade PHP?
Will this issue be fixed anytime soon?
Comment #5
dawehnerThe patch is trivial so fix it.
Comment #6
kewlguy commented#dereine
Thank you very much for the patch, though, I believe it may not be so simple to satisfy PHP 5.3.2, besides that, it is way beyond my skills.
When running the install.sh.txt script(from HEAD) there is much complaining about "PHP Deprecated: Comments starting with '#' are deprecated in /etc/php5/cli......." all over the place.
Also, provision did not download and drush/drush was not made executable.
For myself, I will need to look at rolling PHP5.3 back to 5.2 if I ever want to get my development box back on-line for development of my site. I'm running Ubuntu Desktop 10.04 and it comes default with PHP 5.3.2-1 so I'll likely use the alterations here in ubuntu forums to roll PHP5.3 back to PHP5.2 for now.
Thank you for the patch dereine! I will give it a shot before I do my php5.3 roll back just to see what happens.
Comment #7
kewlguy commentedOk, so I ran the patch from #5 by dereine against hostmaster and it took the error away from the aegir front page, though, there is a new error when I attempt to run the verify task.
Myself, I am going to need to leave this one alone simply because I can roll back my php to 5.2 and then I can get myself back to working on things that are not beyond my skills so that I can be successful at something this year. I need to pick my battles very carefully with drupal.
Thank you for your patience and understanding!
Comment #8
MichaelCole commentedThe attached script downgrades php5.3 to php 5.2 on Ubuntu 10.04.
I ran into this when creating an aegir install script for Quickstart.
After screwing around with error_reporting in php.ini to no effect, I found and cleaned up the attached script. This eliminated the warnings.
Comment #9
kewlguy commented#MichaelCole Fantastic script! Nice work!
I only had one hitch before setting up Aegir on Ubuntu 10.04 Desktop and that was from this error after running the script from #8
To solve this I looked to this bug report for ubuntu
So I renamed the sqlite3.ini, to remove the ini extension, in the folder /etc/php5/conf.d.
Now all I need to do is NOT let ubuntu upgrade the php5 packages.
Comment #10
siliconmeadow commentedGood work, Michael! Do you have any advice about how to configure our systems so that
sudo apt-get upgradedoesn't upgrade to 5.3 again? For some reason, it doesn't seem to be honouring the entries in the/etc/php/preferences.d/php5.2file on my system.Comment #11
haus commentedI used the instructions that come with the script to prevent automatic upgrade to php5.3 again: http://forum.ubuntuusers.de/topic/php-5-2-unter-lucid/#post-2459599
Comment #12
ergonlogicFWIW, I can confirm that this appears to be a PHP 5.3 issue. Downgrading to PHP 5.2 seems to have cleared up those warnings.
I found this discussion helpful in downgrading PHP from 5.3 to 5.2 on Ubuntu 10.04.
Comment #13
anarcat commentedI committed the trivial patch I already had sitting in my tree. Reopen if this doesn't fix the issue.
Comment #14
nofuseto commentedI upgraded to alpha8, i can:
- create new platforms and sites
- import old platforms and sites
But when I try to re-verify them or to run any other action on them I get:
warning: Parameter 2 to hosting_task_confirm_form() expected to be a reference, value given in /var/aegir/hostmaster-0.4-alpha8/includes/form.inc on line 372.
Which seems related to this issue...
Comment #15
nicholasthompsonI also received that message - I simply changed &$node to $node... Seemed to work ok.
Comment #17
snatcher commentedJust ran into this problem today with the same symptoms as post #14 above. Are there any plans to make Aegir php5.3 compatible in the near future?
Comment #18
Anonymous (not verified) commentedIt's already been fixed in HEAD ready for the next release per #13