After installing FreePBX 12 in a Debian Jessie (8.0) Distro I see in freepbx.log the following warnings generated by the script ‘/var/www/html/admin/modules/dashboard/scheduler.php’ installed in the crontab to run every minute;
[2015-Jun-02 11:27:10] [PHP-DEPRECATION_WARNING] (/usr/share/php/DB/common.php:2200) - Non-static method DB::isManip() should not be called statically, assuming $this from incompatible context
[2015-Jun-02 11:27:10] [PHP-DEPRECATION_WARNING] (/usr/share/php/DB/common.php:2200) - Non-static method DB::isManip() should not be called statically, assuming $this from incompatible context
[2015-Jun-02 11:27:10] [PHP-DEPRECATION_WARNING] (/usr/share/php/DB/common.php:1217) - Non-static method DB::isError() should not be called statically, assuming $this from incompatible context
[2015-Jun-02 11:27:10] [PHP-DEPRECATION_WARNING] (/usr/share/php/DB/common.php:1292) - Non-static method DB::isError() should not be called statically, assuming $this from incompatible context
[2015-Jun-02 11:27:10] [PHP-DEPRECATION_WARNING] (/usr/share/php/DB.php:1387) - Non-static method DB::isError() should not be called statically, assuming $this from incompatible context
[2015-Jun-02 11:28:17] [PHP-DEPRECATION_WARNING] (/usr/share/php/DB/common.php:2200) - Non-static method DB::isManip() should not be called statically, assuming $this from incompatible context
[2015-Jun-02 11:28:17] [PHP-DEPRECATION_WARNING] (/usr/share/php/DB/common.php:2200) - Non-static method DB::isManip() should not be called statically, assuming $this from incompatible context
[2015-Jun-02 11:28:17] [PHP-DEPRECATION_WARNING] (/usr/share/php/DB/common.php:1217) - Non-static method DB::isError() should not be called statically, assuming $this from incompatible context
[2015-Jun-02 11:28:17] [PHP-DEPRECATION_WARNING] (/usr/share/php/DB/common.php:1292) - Non-static method DB::isError() should not be called statically, assuming $this from incompatible context
[2015-Jun-02 11:28:17] [PHP-DEPRECATION_WARNING] (/usr/share/php/DB.php:1387) - Non-static method DB::isError() should not be called statically, assuming $this from incompatible context
My PHP version is 5.6.7 and I already have in my php.ini this configuration;
that should disable that kind of warnings, so I suppose that is FreePBX that is forcing the display of DEPRECATED warnings. Can anyone tell me how can I disable these warnings?
Apart from upgrading to FreePBX 13, there is no other workaround to disable these warnings?
My logs are growing with unnecessary information every minute.
I’ve tried to downgrade PHP from v5.6 to version v5.4, as suggested by dicko, but encountered some unmet dependencies problems with libapache2-mod-php5, so this may be the push that I need to upgrade to FreePBX 13. Do you consider that 13 is stable enough for a production environment? Is there any roadmap as when 13 will be the new stable version?
Reading package lists… Done
Building dependency tree
Reading state information… Done
Calculating upgrade… php5-json is already the newest version.
php5-json set to manually installed.
php5-readline is already the newest version.
php5-readline set to manually installed.
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
apache2.2-common : Breaks: libapache2-mod-php5 (< 5.5.0~beta4-3) but 5.4.36-0+deb7u1 is to be installed
dpkg : Breaks: libapache2-mod-php5 (< 5.6.4+dfsg-3~) but 5.4.36-0+deb7u1 is to be installed
php5-common : Conflicts: php5-json
php5-json : Depends: phpapi-20131226
Breaks: php5-common (< 5.5.0~rc1+dfsg-1~) but 5.4.36-0+deb7u1 is to be installed
php5-readline : Depends: phpapi-20131226
Depends: php5-common (= 5.6.7+dfsg-1) but 5.4.36-0+deb7u1 is to be installed
Depends: php5-cli (= 5.6.7+dfsg-1) but 5.4.36-0+deb7u1 is to be installed
E: Broken packages
If you have already done this downgrade can you tell me what I’m doing wrong?
@dicko you are leading this user on a wild goose chase. This will still generate the same depreciated warning in PHP 5.4. In fact the message goes all the way down as low as PHP 5.2.
@tm1000 I have another box with FreePBX distro installed and I don’t see the warnings that I see in Debian Jessie. As you use PHP 5.3 in FreePBX distro I assume that at least in PHP 5.3 these warnings disappear.
You need to disable strict errors in php.ini. FreePBX does not enable these be default until 13. In 12 and lower the system would be enabling these, through php.ini or other means
@dicko I tried everything that I could think of and still are unable to install libapache2-mod-php5 from wheezy in my jessie distro. I was able to install PHP 5.4 from wheezy and can use it from the command line but I’m unable to execute PHP code via Apache due to the lack of libapache2-mod-php5.
I’m sorry @jmpg , I didn’t have that problem, but as is pointed out it is all unnecessary either ignore the clutter or as I suggested redirect it to the bit bucket.
In my case I needed php 5.4 for other software (Avantfax) and never had those errors spat at me (asterisk 11 FreePBX 12 Jessie from apt-get dist-upgrade what was originally I can’t remember gotta love Debian for that) .
--- /usr/share/php/DB.php.original 2015-06-03 12:43:01.680808885 +0100
+++ /usr/share/php/DB.php 2015-06-03 15:56:28.194226505 +0100
@@ -589,7 +589,7 @@
*
* @return bool whether $value is DB_Error object
*/
- function isError($value)
+ static function isError($value)
{
return is_object($value) && is_a($value, 'DB_Error');
}
@@ -625,7 +625,7 @@
*
* @return boolean whether $query is a data manipulation query
*/
- function isManip($query)
+ static function isManip($query)
{
$manips = 'INSERT|UPDATE|DELETE|REPLACE|'
. 'CREATE|DROP|'
now I only need to find a way to shut up the following warning that appears in freepbx_debug:
2015-Jun-03 16:31:01 /usr/share/php/DB/mysql.php:240
[DEPRECATION_WARNING]: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead