cover photo

elmussol

elmussol@elsmussols.org

beware wading too deeply into log files

 Xerta 
@Hubzilla Support Forum+ Whilst wading around in php.out trying to sort @Haakon Meland Eriksen (Parlementum) 's file upload problem, I notice tonnes of lines like this:

[25-Apr-2018 22:15:47 Europe/Madrid] PHP Warning:  rand() expects parameter 1 to be integer, float given in /var/www/hubzilla/Zotlabs/Lib/Enotify.php on line 757
[25-Apr-2018 22:15:47 Europe/Madrid] PHP Warning:  rand() expects parameter 1 to be integer, float given in /var/www/hubzilla/Zotlabs/Lib/Enotify.php on line 758


Does this mean anything important? I know not, but I thought I should bring it up.
  
I didn't think there were any 32-bit systems remaining. Will have a fix after brekky.
  
I still use a 32-bit .
php 7 vs php 5.6

 Xerta 
@Hubzilla Support Forum+ The machine I run this Hubzilla instance has this:

root@pendle:~# php -v                                                                                                                                                       
PHP 5.6.30-0+deb8u1 (cli) (built: Feb  8 2017 09:49:20)                                                                                                                    
Copyright (c) 1997-2016 The PHP Group                                                                                                                                      
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies                                                                                                              
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies


At the moment it also runs email, Nextcloud and Red Matrix (which will be taken down as soon as the Hubzilla instance is 100% ready for use).

I want to run php 7, it is an apt-get install away. What are the issues I need to think about in advance of this transition generally, and specifically with respect to Hubzilla and Red Matrix?
  
Running my node on PHP 7.2.4 with no problems so far.
  
Running my node on PHP 7.2, nginx and Postgresql 10 without critical issues.
  
i;m running on 7.2 as well. but he said he was using what's in his distribution. which is 7.0.
PHP help

 Xerta last edited: Wed, 21 Mar 2018 13:30:48 +0100  
Putting my very first PHP into a page and I have slightly confused myself. I've taken someone else's snippet and forming to my own purposes. So three variables $name, $email and $skype that are sent by email. I want one line of the email to be a comma-delimited line of the variables for easy copy and paste purposes into a CSV file that's being imported into a spreadsheet. I am using the concatenate operator and came up with this:

"Data: " . $name . "," . $email . "," $skype . "\n\n" . $otherstuff;

but it's choking on the commas I think.

How should thus be done?
 tech  PHP
  
it's missing a contatenation,
"," $skype

should be
"," . $skype

You should probably escape quotes in strings and quote the strings.

function esq($v)
{
return str_replace('"','""',$v);
}

echo 'data: "'.esq($v).'","'.esq($email).'","'.esq($skype).'","'."\n\n".$otherstuff;
  last edited: Tue, 14 Jul 2015 04:53:56 +0200  
oops, thomas' message was obscured in the fold, i missed it :)
  
Thanks all.