Home
Help
Search
Login
Register
OPNsense Forum
»
English Forums
»
General Discussion
»
[SOLVED] PHP with mysql support missing
« previous
next »
Print
Pages: [
1
]
Author
Topic: [SOLVED] PHP with mysql support missing (Read 7081 times)
josepgb
Newbie
Posts: 1
Karma: 0
[SOLVED] PHP with mysql support missing
«
on:
January 21, 2016, 05:16:42 pm »
Hi,
I installed opnsense, and I have a captive portal page wich needs php56-mysql activated.
I launched it and I get this error
Fatal error: Call to undefined function mysql_connect() in /var/etc/captiveportal_cpzone.html on line 23
I see the php56-mysql package is acivated, but somehow it does not have any effect on the captive portal page.
Any help on how to activate it?
Tks
«
Last Edit: January 22, 2016, 07:12:00 am by franco
»
Logged
AdSchellevis
Administrator
Hero Member
Posts: 907
Karma: 184
Re: PHP with mysql support missing
«
Reply #1 on:
January 21, 2016, 11:09:22 pm »
Hi Tks,
You're probably using a custom template which includes "captiveportal_cpzone.html" somewhere, the mysql_connect doesn't appear to be in our codebase.
The upcoming new version (16.1) will implement a completely redesigned captive portal, please pay attention before doing an upgrade because the old method of including code into the template won't function any more.
(an easier, more secure template option is available)
Regards,
Ad
Logged
franco
Administrator
Hero Member
Posts: 17661
Karma: 1611
Re: PHP with mysql support missing
«
Reply #2 on:
January 22, 2016, 07:11:51 am »
Hi there,
The extension can be activated by modifying /usr/local/etc/rc.php_ini_setup changing:
-PHPMODULES="dom xml simplexml"
+PHPMODULES="dom xml simplexml mysql"
I saw your post over at pfSense, it's true that mysql will be removed with PHP 7.0 so please do consider migrating to mysqli instead. I will make both packages available for 16.1. They will need to be installed from the command line, because they have been removed from the standard package:
#pkg install php56-mysql
#pkg install php56-mysqli
If you need tighter support consider writing a plugin, which can automatically install dependencies and other required files:
https://github.com/opnsense/plugins
There will also be an improvement for autoloading extensions today, so that with 16.1 you won't have to edit the above file anymore.
http://stackoverflow.com/questions/17986647/upgrade-php-mysql-code-to-use-mysqli-instead
Hope that helps,
Franco
«
Last Edit: January 22, 2016, 08:30:59 am by franco
»
Logged
franco
Administrator
Hero Member
Posts: 17661
Karma: 1611
Re: [SOLVED] PHP with mysql support missing
«
Reply #3 on:
January 22, 2016, 09:39:40 am »
The extended extension support has been added and will be available in 16.1:
https://github.com/opnsense/core/commit/29dc0b5e4d049eeeb9cb8aeff3e91b3217427193
Logged
Print
Pages: [
1
]
« previous
next »
OPNsense Forum
»
English Forums
»
General Discussion
»
[SOLVED] PHP with mysql support missing