Auction install problem?

A place for users and developers of the Xataface to discuss and receive support.

Postby tim » Wed May 23, 2007 9:06 am

Hi,

I come across your Dataface scripts and in particular your Auction script today, and I thought I would try to install them, but for the life of me I can't work out what:

Warning: Cannot use a scalar value as an array in /usr/home/.sites/70/site4/web/Dataface/Table.php on line 1789

Warning: Invalid argument supplied for foreach() in /usr/home/.sites/70/site4/web/Dataface/Table.php on line 1789

is trying to tell me.

I am using version 0.1 dev 3 of the Auction script and Dataface 0.7.1

I was able to go through your very educational "Faculty" tutorial and that worked fine, so the above errors shouldn't have anything to do with a server config issue.

I have Dataface installed in the root directory and the Auction scripts installed in a directory called "auctions". I believe I referencing the right places in the .ini files etc, as I am not getting errors relating to such issues.

I can enter the login area of the Auction script and edit the "Auction Settings" fine, but if I try to register before hand, I do get a lot more errors such as:

Warning: Cannot use a scalar value as an array in /usr/home/.sites/70/site4/web/Dataface/Table.php on line 1789

Warning: Invalid argument supplied for foreach() in /usr/home/.sites/70/site4/web/Dataface/Table.php on line 1789

Fatal error: [pear_error: message="Parse error: Unknown action :s on line 1 select * from bids where username='$username' ^ found: "s"" code=0 mode=return level=notice prefix="" info=""]
On line 182 of file /usr/home/.sites/70/site4/web/Dataface/Relationship.php in function printstacktrace()
On line 102 of file /usr/home/.sites/70/site4/web/Dataface/Relationship.php in function _init(array(select * from bids where username='$username'))
On line 1366 of file /usr/home/.sites/70/site4/web/Dataface/Table.php in function dataface_relationship(users,bids,array(select * from bids where username='$username'))
On line 2634 of file /usr/home/.sites/70/site4/web/Dataface/Table.php in function _loadrelationshipsinifile()
On line 752 of file /usr/home/.sites/70/site4/web/Dataface/QuickForm.php in function relationships()
On line 1361 of file /usr/home/.sites/70/site4/web/Dataface/QuickForm.php in function _build()
On line 30 of file /usr/home/.sites/70/site4/web/actions/register.php in function validate() in /usr/home/.sites/70/site4/web/Dataface/Relationship.php on line 182


Been chasing my tail a bit now, so I am hoping you can put me back on track. I think what you are doing here is pretty cool and worthy of some extra time to try to get it working :)


Thanks

Tim
tim
 
Posts: 6
Joined: Wed Dec 31, 1969 5:00 pm

Postby shannah » Wed May 23, 2007 10:25 am

Hi Tim,

It looks as though the SQL parser in Dataface is having some trouble.Ê I have seen this happen before when for some reason dataface didn't get installed correctly, or there are some files with permissions issues.

Can you let me know:

1. Mysql version

2. PHP version

3. Server type (e.g. Apache, IIS / Windows / Linux etc..)

Try reinstalling Dataface... and particular check the status of the lib/SQL/Parser files.Ê e.g. make sure that they are all readable by the web server.

Please let me know how it goes.Ê If you have found a bug in Dataface, I'd like to squash it.

-Steve

--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby tim » Wed May 23, 2007 10:02 pm

Hi Steve,

Thanks for your reply.

I am running:

Apache
PHP 4.4.7
MysQL 4.1.18

I went through the whole install process again, tried a few different variations, but the same warnings are still present.

I see that some files/folders are owned by www instead of me after installation, my templates_c folder under df_auction is such folder, and set to 755 as the file permission. Tried to change permissions to 777 but I can't chown the folder. So unsure if that's the problem?

I note I need LDAP for parts of Auction to work, is that an option I can turn off, or a MUST? If it's a must, then my provider doesn't have LDAP enabled by default and probably won't enable it, thus I might be wasting my time trying to get this installed anyway :(

Looking forward to your reply.

Thanks

Tim
tim
 
Posts: 6
Joined: Wed Dec 31, 1969 5:00 pm

Postby shannah » Thu May 24, 2007 12:08 am

Hi Tim,

We used LDAP for the SFU plant sale but it was disabled for the public release.Ê It is not necessary - and is not used by default.

As for the error.Ê I did a quick search of the forum to find the other post that had this problem (a long time ago). http://framework.weblite.ca/search?SearchableText=Unknown+action+%3As

I suggested at that time that it could be an encoding or carriage return issue because of the way the files were uploaded.
Did you upload the files to your server using an FTP program?Ê If so it is possible that the FTP program had some problems with the .ini files (it could have uploaded them as binary files instead of text files).
To find out if this is the issue, please target the tables/users/relationships.ini file.Ê (This is the one that is causing the fatal error).Ê Open this file and try to save it with unix line breaks, and make sure it is using ISO-Latin-1 encoding (ISO-8859-1).
I can never remember whether these files are supposed to be uploaded in binary mode or text mode, but sometimes using the wrong mode will yield bad results (I hate FTP).
I would love to get a confirmation of this, since, as you see the last time that this happened, the user didn't write back to say whether this solution worked.
As for the folders that are owned by www.Ê These folders are for cached templates and need to be writable by the web server.Ê Unfortunately with the current settings only the web server can delete them (you can create a PHP script to delete them).
Let me know how it goes.
-Steve
--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby tim » Thu May 24, 2007 8:34 am

Hi Steve,

Thanks for your reply.

I uploaded the .gz files using FTP to the server then SSH'hd into the server and tar -'d the uploaded files into their own directories. I did this process for both the "dataface" and "auction" packages. Directory named df_auction is within the dataface directory like so:

/dataface/
/dataface/df_auction/


I experimented quite a bit with line-breaks, uploaded using ASCII and BINARY via FTP, saw the little ^M in SSH etc etc, but it didn't really change much in the way of errors. However ...

I am unsure if I have created a new error which I haven't seen yet, but by deleting [bids] from the first line of both the relationship.ini files under tables/products and tables/users has let me do MUCH more than I could before. I can now REGISTER and ADD NEW PRODUCTS!

I am now seeing a few other errors which might steer us in the right direction.

Firstly, these are still displaying:

=====================================================

Warning: Cannot use a scalar value as an array in /usr/home/.sites/70/site4/web/dataface/Dataface/Table.php on line 1789

Warning: Invalid argument supplied for foreach() in /usr/home/.sites/70/site4/web/dataface/Dataface/Table.php on line 1789

======================================================

on most screens, but if I logout from Admin and view an auction in progress, I can see this:


======================================================

Warning: Cannot use a scalar value as an array in /usr/home/.sites/70/site4/web/dataface/Dataface/Table.php on line 1789

Warning: Invalid argument supplied for foreach() in /usr/home/.sites/70/site4/web/dataface/Dataface/Table.php on line 1789

Holiday 1

Minimum Bid
$200.00
Current Bid

Fatal error: [pear_error: message="2" code=0 mode=return level=notice prefix="" info="Field current_high_bid does not exist in table products ** Failed to get field 'current_high_bid' while trying to display its value in Record::display()"] in /usr/home/.sites/70/site4/web/dataface/Dataface/Record.php on line 1164

=============================================================

If go into the database and create what appears to be the missing table field "current_high_bid" within products, I get this message:

=============================================================

Warning: Cannot use a scalar value as an array in /usr/home/.sites/70/site4/web/dataface/Dataface/Table.php on line 1789

Warning: Invalid argument supplied for foreach() in /usr/home/.sites/70/site4/web/dataface/Dataface/Table.php on line 1789

Fatal error: Column 'current_high_bid' in field list is ambiguousSELECT COUNT(*) FROM (select p.*,current_high_bid from products p left join (select product_id,max(bid_amount) as current_high_bid from bids group by product_id) as b on p.product_id=b.product_id) as `products`On line 99 of file /usr/home/.sites/70/site4/web/dataface/Dataface/QueryTool.php in function printstacktrace()
On line 462 of file /usr/home/.sites/70/site4/web/dataface/Dataface/QueryTool.php in function dataface_querytool(products,Resource id #13,array(62344eebfae7b921bb48cdc913c7e9f4,en,products,list,0,0,30,list,product_categories asc))
On line 955 of file /usr/home/.sites/70/site4/web/dataface/Dataface/Application.php in function loadresult(products,Resource id #13,array(62344eebfae7b921bb48cdc913c7e9f4,en,products,list,0,0,30,list,product_categories asc))
On line 1081 of file /usr/home/.sites/70/site4/web/dataface/Dataface/Application.php in function getresultset()
On line 234 of file /usr/home/.sites/70/site4/web/dataface/Dataface in /usr/home/.sites/70/site4/web/dataface/Dataface/QueryTool.php on line 99

==================================================================

One final error I'll throw in occurs after you become the highest bidder on an item. I get this:


===================================================================

Warning: Cannot use a scalar value as an array in /usr/home/.sites/70/site4/web/dataface/Dataface/Table.php on line 1789

Warning: Invalid argument supplied for foreach() in /usr/home/.sites/70/site4/web/dataface/Dataface/Table.php on line 1789

Warning: Cannot use a scalar value as an array in /usr/home/.sites/70/site4/web/dataface/Dataface/Table.php on line 1789

Warning: Invalid argument supplied for foreach() in /usr/home/.sites/70/site4/web/dataface/Dataface/Table.php on line 1789

Warning: Cannot modify header information - headers already sent by (output started at /usr/home/.sites/70/site4/web/dataface/Dataface/Table.php:1789) in /usr/home/.sites/70/site4/web/dataface/df_auction/actions/bid.php on line 26

=====================================================================


So I think we have come 20 steps forward, but maybe 5 steps back ;)

Not sure if I am convinced I have all permissions correct and/or line breaks in place where they are needed.

Your thoughts?


Tim
tim
 
Posts: 6
Joined: Wed Dec 31, 1969 5:00 pm

Postby shannah » Thu May 24, 2007 10:07 am

OK.. removing the [bids] section just removes one of the dependencies to the SQL parser that is causing the problem.Ê It won't actually fix the problem though.

What are the permissions on the files in the dataface/lib/SQL/Parser directory?Ê What files do you have in that directory.Ê For some reason the SQL parser is failing and it's not giving any good clues as to why.

I don't suppose you would be able to give me access to your server so I can take a look?


-Steve

--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby tim » Thu May 24, 2007 4:04 pm

Hi Steve,

Inside /web/dataface/lib/SQL I have:


Compiler.php
ctype.php
Dialect_ANSI.php
Dialect_MySQL.php
Lexer.php
Paser.php

plus the following directories and files:

Compiler
mysql.php

tests
a number of php files


Permissions:

/web/dataface/lib 755
/web/dataface/lib/SQL 755

and then 644 for the individual files inside:

/web/dataface/lib/SQL



What's your email address, don't mind you logging in if I can send the details to you via email.


Thanks

Tim
tim
 
Posts: 6
Joined: Wed Dec 31, 1969 5:00 pm

Postby shannah » Thu May 24, 2007 4:21 pm

Hi Tim,

My email address is steve at weblite dot ca
Best regards
Steve
--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby tim » Thu May 24, 2007 5:44 pm

Sent! Please reply and I'll send through the details.

Ta

Tim
tim
 
Posts: 6
Joined: Wed Dec 31, 1969 5:00 pm

Postby shannah » Fri May 25, 2007 3:07 am

I just wanted to post the solution to this problem in case future users run into it.Ê The problem was that PHP was not compiled with the ctype functions.Ê (http://php.net/ctype).Ê The solution was to ask the hosting provider to recompile PHP with the ctype functions enabled.

--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby tim » Fri May 25, 2007 7:42 am

Hi Steve,

Thank you very much for putting me on the right track and the emails we were sending behind the scenes. FYI - My ISP has installed what we needed and we are almost there :)

I've been looking through the forum for some ideas on the following, but I can't seem to find why the following might be happening. Considering the other problems were server setup based, I want to make sure we are now talking code problems and not something else.

Here's what I've got:

1/ The words "Token (Token )It is null" are displayed above the Dataface logo top left of each screen, no matter if you are logged into DF Auction or not.

2/ When I try to submit a form such as the BID or REGISTER form, I keep getting and error similar to this:

Token (Token )It is nullIt is null
Warning: Cannot modify header information - headers already sent by (output started at /usr/home/.sites/70/site4/web/dataface/lib/SQL/Lexer.php:138) in /usr/home/.sites/70/site4/web/df_auction/actions/bid.php on line 26

I note that the "header" error might have something to with "whitespace" at the end of a file, but where would this be happening? Is it a "whitespace" issue on a number of files or just one central file, or is it caused by something other than whitespace?

Again thanks for your help today, I am sure we will be up and running fault-free soon :)

Ta

Tim
tim
 
Posts: 6
Joined: Wed Dec 31, 1969 5:00 pm

Postby shannah » Fri May 25, 2007 12:50 pm

Oh... I put some debugging echo statements in while I was trying to solve the problem.... sorry.. I have removed the echo statements now.

Best regards



Steve

--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 14 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved