PHP version 5.6 compatibility (DSM 6.0)

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
RichM
Posts: 4
Joined: Mon Apr 25, 2016 10:56 am

PHP version 5.6 compatibility (DSM 6.0)

Post by RichM »

Hi,

I am running Cacti 0.8.8b for a few years on a Synology NAS.

Since I updated to DSM 6.0 Cacti doesn't collect any data.

Everything else is working properly.
For example when trying to debug datasource I can see actual data collected from the monitored devices.

In cacti.log there is no new entry from data collection.
I made sure that the command "php ... poller.php" is still in the crontab.

What I noticed is when I run directly from the command line :
"php /volume1/web/cacti/poller.php" there is no output to the console.

Then I noticed that the new DSM replaced PHP 5.5 by PHP 5.6.

Are all my troubles caused by the version 5.6 ?
If so which is the workaround ?

Regards,

Richard.
altec
Posts: 3
Joined: Tue Apr 26, 2016 11:36 am

Re: PHP version 5.6 compatibility (DSM 6.0)

Post by altec »

I am running 0.8.8.g and I have exact same issue...
I really am clueless on where to look for the solution of this issue.

When I am running both poller and cmd.php nothing happens at all.
Does anyone has a clue where to start digging??
altec
Posts: 3
Joined: Tue Apr 26, 2016 11:36 am

Re: PHP version 5.6 compatibility (DSM 6.0)

Post by altec »

it has something to do with the php version indeed..... not sure yet what it is....
I have a workarround in place for now:

Code: Select all

cp /volume1/@appstore/PHP5.6/usr/local/bin/php56 /volume1/web/[your/cacti/path/]php56
chown http:users /volume1/web/[your/cacti/path/]php56
modify the /etc/crontab and change the poller execution path to the new PHP binary.


Log on to cacti and go to settings. Enter the new path of the php binary.

Et voila... everything is running again.
RichM
Posts: 4
Joined: Mon Apr 25, 2016 10:56 am

Re: PHP version 5.6 compatibility (DSM 6.0)

Post by RichM »

altec wrote:it has something to do with the php version indeed..... not sure yet what it is....
I have a workarround in place for now:

Code: Select all

cp /volume1/@appstore/PHP5.6/usr/local/bin/php56 /volume1/web/[your/cacti/path/]php56
chown http:users /volume1/web/[your/cacti/path/]php56
Thanks a lot it's a great discovery.
Look at the version under /usr/bin and under PHP5.6/usr/local/bin/php56

ash-4.3# /usr/bin/php --version
PHP 5.6.11 (cli) (built: Apr 18 2016 19:55:19)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies

ash-4.3# /volume1/@appstore/PHP5.6/usr/local/bin/php56 --version
PHP 5.6.17 (cli) (built: Mar 11 2016 18:03:14)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies

So far actually I only tried against v5.6.11 !

Please note that today I am offered version 5.6.20 -from officially version 5.6.17.

I will update and investigate further this week-end.

Regards,

Richard.
RichM
Posts: 4
Joined: Mon Apr 25, 2016 10:56 am

Re: PHP version 5.6 compatibility (DSM 6.0)

Post by RichM »

RichM wrote: So far actually I only tried against v5.6.11 !

Please note that today I am offered version 5.6.20 -from officially version 5.6.17.

I will update and investigate further this week-end.
My findings :
- /usr/bin/php comes with DSM 6.0 itself
- this /usr/bin/php is essential to package installation process. Don't mess with it ! (or be ready to dig the DSM .par file...)
- in DSM 5.2 php-cgi and php-fpm were also located under /usr/bin/
- in DSM 6.0, PHP package is installed under /volume1/@appstore/PHP5.6/usr/local/bin/php56 (symlinked to /usr/local/bin...)

So my recommendation would be to configure Cacti to use "/usr/local/bin/php56" in Cacti interface as well as in "crontab"
altec
Posts: 3
Joined: Tue Apr 26, 2016 11:36 am

Re: PHP version 5.6 compatibility (DSM 6.0)

Post by altec »

RichM wrote:
RichM wrote: So far actually I only tried against v5.6.11 !

Please note that today I am offered version 5.6.20 -from officially version 5.6.17.

I will update and investigate further this week-end.
My findings :
- /usr/bin/php comes with DSM 6.0 itself
- this /usr/bin/php is essential to package installation process. Don't mess with it ! (or be ready to dig the DSM .par file...)
- in DSM 5.2 php-cgi and php-fpm were also located under /usr/bin/
- in DSM 6.0, PHP package is installed under /volume1/@appstore/PHP5.6/usr/local/bin/php56 (symlinked to /usr/local/bin...)

So my recommendation would be to configure Cacti to use "/usr/local/bin/php56" in Cacti interface as well as in "crontab"
Thanks for your efforts :)
I will do a recheck on my env to make sure nothing is messed up after the digging I did.
noli
Posts: 9
Joined: Tue Jun 06, 2006 10:38 am

Re: PHP version 5.6 compatibility (DSM 6.0)

Post by noli »

This post is already getting old, but I'm happy to confirm that the solution to use /usr/local/bin/php56 instead of /usr/bin/php works perfectly, many many thanks for that !! :D
RichM
Posts: 4
Joined: Mon Apr 25, 2016 10:56 am

Re: PHP version 5.6 compatibility (DSM 6.0)

Post by RichM »

Hi

A quick note : beware of the "open_basedir" PHP parameter. It may prevent your script from running.

In DSM 6 this parameter is set in "Web Station", "PHP Parameters" tab. There you have the option to personalize the PHP open_basedir parameter.

For example in my settings this value ends by :
:/opt/bin/rrdtool:/usr/local/bin:

because I am using /usr/local/bin/php56.

Regards,
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests