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

Anonymous’s picture

It 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..

Mike_Waters’s picture

Could it be (from http://www.php.net/manual/en/migration53.incompatible.php):

"The behaviour of functions with by-reference parameters called by value has changed. Where previously the function would accept the by-value argument, a fatal error is now emitted. Any previous code passing constants or literals to functions expecting references, will need altering to assign the value to a variable before calling the function. "

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:

  foreach (module_implements($hook) as $module) {
    $function = $module .'_'. $hook;
    $result = call_user_func_array($function, $args);

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...

Mike_Waters’s picture

I'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.

kewlguy’s picture

I 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?

dawehner’s picture

Status: Active » Needs review
StatusFileSize
new578 bytes

The patch is trivial so fix it.

kewlguy’s picture

#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.

kewlguy’s picture

Ok, 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.

warning: Parameter 2 to hosting_task_confirm_form() expected to be a reference, value given in /var/aegir/hostmaster-HEAD/includes/form.inc on line 372.

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!

MichaelCole’s picture

StatusFileSize
new3 KB

The 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.

kewlguy’s picture

#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

PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20060613+lfs/sqlite3.so' - /usr/lib/php5/20060613+lfs/sqlite3.so: cannot open shared object file: No such file or directory in Unknown on line 0

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.

siliconmeadow’s picture

re: The attached script downgrades php5.3 to php 5.2 on Ubuntu 10.04.

Good work, Michael! Do you have any advice about how to configure our systems so that sudo apt-get upgrade doesn'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.2 file on my system.

haus’s picture

I 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

ergonlogic’s picture

FWIW, 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.

anarcat’s picture

Status: Needs review » Fixed

I committed the trivial patch I already had sitting in my tree. Reopen if this doesn't fix the issue.

nofuseto’s picture

I 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...

nicholasthompson’s picture

I also received that message - I simply changed &$node to $node... Seemed to work ok.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

snatcher’s picture

Status: Closed (fixed) » Active

Just 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?

Anonymous’s picture

Status: Active » Closed (fixed)

It's already been fixed in HEAD ready for the next release per #13

  • Commit ad40fd0 on dev-dns, dev-features, dev-log_directory, dev-migrate_aliases, dev-multiserver-install, dev-newsiteform, dev-nginx, dev-ports, dev-purgebackup, dev-restore, dev-services, dev-ssl, prod-koumbit, dev-ssl-ip-allocation-refactor, dev-1205458-move_sites_out_of_platforms, 7.x-3.x, dev-588728-views-integration, dev-1403208-new_roles, dev-helmo-3.x by anarcat:
    #761498 - fix 5.3 warning in hook_load
    
    

  • Commit ad40fd0 on dev-dns, dev-features, dev-log_directory, dev-migrate_aliases, dev-multiserver-install, dev-newsiteform, dev-nginx, dev-ports, dev-purgebackup, dev-restore, dev-services, dev-ssl, prod-koumbit, dev-ssl-ip-allocation-refactor, dev-1205458-move_sites_out_of_platforms, 7.x-3.x, dev-588728-views-integration, dev-1403208-new_roles, dev-helmo-3.x by anarcat:
    #761498 - fix 5.3 warning in hook_load