0.04.25/b - test-threaded

The forum for help and support with FreeNATS as well as any useful hints and tips
Post Reply
aday
Posts: 10
Joined: Sun Jun 08, 2008 3:02 am
Location: Australia/Melbourne
Contact:

0.04.25/b - test-threaded

Post by aday » Tue Jul 01, 2008 4:52 am

Hi

Noticed somthing weird once I unpacked 0.04.25/b from source.

Since I wasn't getting any updates by cron I decided to try and figure out why by running test-threaded.sh
This is the result:

root@kasumi:/var/www/nms/bin# ./test-threaded.sh
Parse error: syntax error, unexpected '=', expecting ')' in /var/www/nms/base/tests/dns.inc.php on line 139

Looking at dns.inc.php on line 139

Code: Select all

        function ReadDomainLabels($offset,&$counter=0)
        {
It only started happening in 0.04.25/b - It's a complete reinstall, not an upgrade.

Any ideas?
web:// aday.net.au

dave
Site Admin
Posts: 260
Joined: Fri May 30, 2008 9:09 pm
Location: UK
Contact:

Re: 0.04.25/b - test-threaded

Post by dave » Tue Jul 01, 2008 9:08 am

Hi Aday,

Erm well it certainly looks like a problem with the PHP code though it seems to work ok in my environment here.

I wonder if it doesn't like the pointer variable default. Hmm.

Are you running the virtual appliance or a source install?

Regards,

Dave.

dave
Site Admin
Posts: 260
Joined: Fri May 30, 2008 9:09 pm
Location: UK
Contact:

Re: 0.04.25/b - test-threaded

Post by dave » Tue Jul 01, 2008 5:45 pm

Arrrrr! The PHP DNS API is PHP 5 only as it uses pass-by-reference with default values.

Looking at your output you seem to be running the source install so I'm guessing you've got PHP 4? (php -v should find out).

I thought I had tested it under PHP 4 but looking at that environment it's actually 5.0.2. Whoops.

I'll go and have a look at fixing it now.

Regards,

Dave.

dave
Site Admin
Posts: 260
Joined: Fri May 30, 2008 9:09 pm
Location: UK
Contact:

Re: 0.04.25/b - test-threaded

Post by dave » Tue Jul 01, 2008 6:30 pm

Ok well I have patched the dns.inc.php and released 0.04.26a. I've done it as an alpha because although I only changed two lines in the file and it works fine I may have lost the development-control plot and there may be other stealth changes in files (though I don't think so).

You may want to just download 0.04.26a and copy the server/base/tests/dns.inc.php over the top of your installed one.

Let me know if it doesn't work but you can always just rename/move dns.inc.php, replace it with an empty file (touch dns.inc.php) and then as long as you don't actually configure any DNS tests it shouldn't cause any errors.

Cheers,

Dave.

aday
Posts: 10
Joined: Sun Jun 08, 2008 3:02 am
Location: Australia/Melbourne
Contact:

Re: 0.04.25/b - test-threaded

Post by aday » Wed Jul 02, 2008 1:58 am

Yeah, I'm using php4 (mostly because a few other app's on this server still use legacy php4 code, ugghh)
Actually come to think of it, I should have realized. :)

aday@kasumi:~$ php -v
PHP 4.4.4-8+etch4 (cli) (built: Jun 30 2007 21:02:54)

Anyway,
Just copied over dns.inc.php from alpha - and it works !

Thanks Dave!
web:// aday.net.au

dave
Site Admin
Posts: 260
Joined: Fri May 30, 2008 9:09 pm
Location: UK
Contact:

Re: 0.04.25/b - test-threaded

Post by dave » Wed Jul 02, 2008 4:34 pm

Great - glad to hear it!

Not that I doubted for a moment it would work of course :oops:

I really will try and make sure version 0.x releases remain (as advertised) PHP 4 compatible.

I can't be certain about version 1 though as I'm pretty certain that (knowing what I do now) I have used various PHP 5 features. Certainly at the moment the nodeside push script uses stream_set_context() to post the data using PHP (rather than relying on cURL) so this may require a rethink.

Good luck with the system (not that you need it).

Cheers,

Dave.

Post Reply