Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Won't run using PHP 7.0 #41

Closed
f8ttyc8t opened this issue Mar 13, 2018 · 13 comments
Closed

Won't run using PHP 7.0 #41

f8ttyc8t opened this issue Mar 13, 2018 · 13 comments
Assignees
Labels
Milestone

Comments

@f8ttyc8t
Copy link

f8ttyc8t commented Mar 13, 2018

Because I needed to install a new Debian distro (Debian 9 Stretch), PHP 5.x is no longer part of my system.
Now I entirely fail to use control panel.
It seems to fail in MDB2#mysql part - causing error:
PHP Parse error: syntax error, unexpected 'new' (T_NEW) in /usr/share/php/MDB2.php on line 390

Have tried it with both versions (Control Panel 7.2.3 and 6.2 as well)
Any idea about how to run opensips control panel on a recent Linux distribution?

Thanks in advance!

(Btw. digging trough your great book "Building Telephony Systems with OpenSIPS, Second Edition" - which is a great source of help!)

@bogdan-iancu
Copy link
Member

@f8ttyc8t , yeah the Control Panel is not php 7 compatible mainly due the deprecated MDB2 . We plan to release a new version of CP for OpenSIPS 2.3, the CP 8.2.3 that will move to PDO for DB ops.

@f8ttyc8t
Copy link
Author

@bogdan-iancu , thank you very much for letting me know!
Looking forward to new version.

@artkos
Copy link
Contributor

artkos commented Aug 7, 2018

I got CP working quite easily with PHP 7.0, but there is some problem with Statics monitors cron job script.
Uncaught Error: Call to undefined method PDO::queryAll() in /var/www/opensips-cp/cron_job/get_opensips_stats.php:41

I think it is because you have changed to PDO and these are in PEAR/MDB2 style?
Also if you grep files with "PEAR" you can find few references at:
web/tools/users/alias_management/lib/alias_management.add.validate.php
web/tools/users/alias_management/template/alias_management.main.php
might want to check those also.

@bogdan-iancu
Copy link
Member

indeed, there is a bit of a cleanup needed :D, thanks for pointing it out

@artkos
Copy link
Contributor

artkos commented Aug 8, 2018

smonitor-diff.txt

diff file to fix cronjob script :)

@artkos
Copy link
Contributor

artkos commented Aug 8, 2018

And to eliminate cron to spam you with:

PHP Warning: Creating default object from empty value in /var/www/opensips-cp/config/db.inc.php on line 23

You could add following line to db.inc.php:
if (!isset($config)) $config = new stdClass();

@bogdan-iancu
Copy link
Member

Good job @artkos , thank you - do you want to pack your changes as a pull request, so you will be author of the changes ?

@bogdan-iancu
Copy link
Member

OK, all the left overs from MDB2 were addressed, so the code should be clean and totally migrated to PDO -> compatible with PHP 7

@bogdan-iancu bogdan-iancu self-assigned this Aug 8, 2018
@bogdan-iancu bogdan-iancu added this to the 8.2.4 milestone Aug 8, 2018
@devorel
Copy link

devorel commented Aug 14, 2018

i have problem too

Warning: count(): Parameter must be an array or an object that implements Countable in /usr/share/php/MDB2.php on line 826

Fatal error: Uncaught Error: Call to undefined method MDB2_Error::prepare() in /var/www/opensip/web/login.php:80 Stack trace: #0 {main} thrown in /var/www/opensip/web/login.php on line 80

@bogdan-iancu
Copy link
Member

@devorel , what version of OpenSIPS Control Panel are you using ?

@devorel
Copy link

devorel commented Aug 16, 2018 via email

@bogdan-iancu
Copy link
Member

You mean the master git branch ?

@devorel
Copy link

devorel commented Aug 16, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants