Ubuntu 16.04, PHP 7 and Xataface

767 views
Skip to first unread message

Charles Sullivan

unread,
Aug 7, 2016, 3:21:09 PM8/7/16
to Xataface
I have been using Xataface for over a year now and love it. I recently upgraded to Ubuntu 16.04 and Xataface wouldn't work at all. The solutions are rather simple and should be put on the main Xataface page. PHP 7 won't work with any older versions of Xataface, one must update the Xataface folder with the latest version, AND "driver=mysqli" must be put in the conf.ini file. The Xataface upgrade only requires to overwrite the Xataface directory. It does not require to start from scratch with the installation process. The layout of the latest iteration looks a bit smoother too.

Rangan V

unread,
Aug 24, 2016, 3:27:44 PM8/24/16
to Xataface
Been facing a problem in the manual install of XATAface 2.1.2 under kubuntu 16.04 running MariaDB 10 and PHP 5.6.
The error I get
QUOTE
Warning: Missing argument 2 for Dataface_Table::loadTable(), called in /var/www/html/crm/xataface/Dataface/Application.php on line 2153 and defined in /var/www/html/crm/xataface/Dataface/Table.php on line 474

Notice: Undefined variable: name in /var/www/html/crm/xataface/Dataface/Table.php on line 475

Notice: Undefined variable: name in /var/www/html/crm/xataface/Dataface/Table.php on line 476

Warning: Missing argument 2 for Dataface_Table::loadTable(), called in /var/www/html/crm/xataface/Dataface/LinkTool.php on line 43 and defined in /var/www/html/crm/xataface/Dataface/Table.php on line 474

Notice: Undefined variable: name in /var/www/html/crm/xataface/Dataface/Table.php on line 475

Notice: Undefined variable: name in /var/www/html/crm/xataface/Dataface/Table.php on line 476

Fatal error: Uncaught exception 'Exception' with message 'In Dataface_Table::loadTable() expected first argument to be a string but received 'Dataface_Table'' in /var/www/html/crm/xataface/Dataface/Table.php:476 Stack trace: #0 /var/www/html/crm/xataface/Dataface/LinkTool.php(43): Dataface_Table::loadTable('ap_report') #1 /var/www/html/crm/xataface/Dataface/LinkTool.php(107): Dataface_LinkTool::getMask() #2 /var/www/html/crm/xataface/Dataface/Application.php(2878): Dataface_LinkTool::buildLink('', true, false) #3 /var/www/html/crm/xataface/Dataface/Application.php(2438): Dataface_Application->url('') #4 /var/www/html/crm/index.php(9): Dataface_Application->display() #5 {main} thrown in /var/www/html/crm/xataface/Dataface/Table.php on line 476
UNQUOTE

My conf.ini file
QUOTE
[_database]
    host=Localhost
    name=crm
    user=idpluser
    password=echidna
    driver=mysqli
[_tables]
ap_report=ap_report
[_auth]
users_table=Users
username_column=UserName
password_column=Password
UNQUOTE

Can you help please ?

regards

Rangan

Steve Hannah

unread,
Aug 25, 2016, 12:46:51 AM8/25/16
to xata...@googlegroups.com
Try using the latest Xataface from github.  It includes quite a few fixes since the last release, especially for clearing up warnings and errors on newer versions of PHP.

--
You received this message because you are subscribed to the Google Groups "Xataface" group.
Visit this group at https://groups.google.com/group/xataface.
To view this discussion on the web visit https://groups.google.com/d/msgid/xataface/6cde3a7f-3b09-45bb-8563-e33c0ea2606f%40googlegroups.com.



--
Steve Hannah
Web Lite Solutions Corp.

Rangan V

unread,
Aug 25, 2016, 2:11:58 PM8/25/16
to Xataface
Atta Boy, Steve.

Thanks for pointing me in the right direction. It worked! Obviously.

Thanks Again.

regards

Rangan
Message has been deleted
Message has been deleted

Alcides Chaux

unread,
Sep 17, 2016, 10:05:06 PM9/17/16
to Xataface
Dear Charles,

I'm facing the same issue, but your solution doesn't seem to be working for me. Any ideas on how to proceed or where to look for an answer?
Best,

Alcides

MMehaffey

unread,
Oct 5, 2016, 5:23:30 PM10/5/16
to Xataface
I have also been using Xataface 2.0.3 and now must upgrade to PHP7.0.  I kept my top level files in my application folder and just copied in the new xataface 2.1.3 file and unzipped it to replace the old version.  I made the additions to the conf.ini file, but the connection still isn't being made. 
I'm thinking this is because my connection string needs a port number, and since the mysql_connect() has been deprecated, the connection string won't work as is.  However, I'm not sure where/which files need to be updated to carry the additional port variable.

MMehaffey

unread,
Oct 6, 2016, 1:22:20 PM10/6/16
to Xataface
Here is the web error message for the xataface 2.1.3 and PHP 7 attempt:

Warning: mysqli_connect(): (HY000/2005): Unknown MySQL server host 'mywebserver:67585' (2) in /DB/xataface/xf/db/drivers/mysqli.php on line 2

Warning: mysqli_error() expects exactly 1 parameter, 0 given in /DB/xataface/xf/db/drivers/mysqli.php on line 10

Fatal error: Uncaught Exception: Error connecting to the database: in /DB/xataface/Dataface/Application.php:605 Stack trace: #0 /DB/xataface/Dataface/Application.php(1078): Dataface_Application->Dataface_Application(Array) #1 /DB/xataface/public-api.php(58): Dataface_Application::getInstance(NULL) #2 /DB/index.php(6): df_init('/...', 'xataface') #3 {main} thrown in /DB/xataface/Dataface/Application.php on line 605

And my conf.ini file:

[_database]
host = "mywebserver:67585"
name = "MyDB"
user = "root"
password = "password"
driver = "mysqli"


Thank you.

Steve Hannah

unread,
Oct 6, 2016, 2:58:35 PM10/6/16
to xata...@googlegroups.com
It says that the host you provided is incorrect.  Quadruple check that.

--
You received this message because you are subscribed to the Google Groups "Xataface" group.
Visit this group at https://groups.google.com/group/xataface.

MMehaffey

unread,
Oct 6, 2016, 3:12:21 PM10/6/16
to Xataface
The server host hasn't changed, its the same one that was working before the PHP upgrade.  That is the error message I get when the host variable contains the :port#.  If I remove the :port# from the host variable in the conf.ini file, then the error message is:

Warning: mysqli_connect(): (28000/1045): Access denied for user 'root'@'mywebserver' (using password: YES) in /DB/xataface/xf/db/drivers/mysqli.php on line 3

Warning: mysqli_error() expects exactly 1 parameter, 0 given in /DB/xataface/xf/db/drivers/mysqli.php on line 11

Fatal error: Uncaught Exception: Error connecting to the database: in /DB/xataface/Dataface/Application.php:605 Stack trace: #0 /DB/xataface/Dataface/Application.php(1078): Dataface_Application->Dataface_Application(Array) #1 /DB/xataface/public-api.php(58): Dataface_Application::getInstance(NULL) #2 /DB/index.php(6): df_init('...', 'xataface') #3 {main} thrown in /DB/xataface/Dataface/Application.php on line 605

MMehaffey

unread,
Oct 6, 2016, 4:05:28 PM10/6/16
to Xataface
Ok, the change that is now working was made in the mysqli.php file:


<?php
function xf_db_connect($host,$user,$pass){
        $port = "67585";
        $dbname = "MyDB";
        return mysqli_connect($host, $user, $pass, $dbname, $port);
}
...

Steve Hannah

unread,
Oct 6, 2016, 8:05:49 PM10/6/16
to xata...@googlegroups.com
Thanks for posting this.  I have fixed it in git so that the "hostname:port" notation will work correctly with mysqli now.  

Alternatively, you can also call
ini_set("mysqli.default_port", 67585);

at the beginning of your index.php file, and just leave the port off the "host" parameter.

Steve

Reply all
Reply to author
Forward
0 new messages