mirror of
https://github.com/cypht-org/cypht.git
synced 2026-04-25 13:05:53 +03:00
[GH-ISSUE #174] creating user: PHP Fatal error: Uncaught Error: Call to a member function prepare() on boolean #141
Labels
No labels
2fa
I18N
PGP
Security
Security
account
advanced_search
advanced_search
announcement
api_login
authentication
awaiting feedback
blocker
bug
bug
bug
calendar
config
contacts
core
core
devops
docker
docs
duplicate
dynamic_login
enhancement
epic
feature
feeds
framework
github
github
gmail_contacts
good first issue
help wanted
history
history
imap
imap_folders
inline_message
installation
keyboard_shortcuts
keyboard_shortcuts
ldap_contacts
mobile
need-ssh-access
new module set
nux
pop3
profiles
pull-request
question
refactor
release
research
saved_searches
smtp
strategic
tags
tests
themes
website
wordpress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/cypht#141
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @nekromoff on GitHub (Mar 17, 2017).
Original GitHub issue: https://github.com/cypht-org/cypht/issues/174
Originally assigned to: @jasonmunro on GitHub.
@jasonmunro commented on GitHub (Mar 17, 2017):
Hello!
Looks like you are missing the required PHP PDO support that we use to access databases:
http://php.net/manual/en/book.pdo.php
It could also be that PDO is installed, but not the driver it needs for your particular database type.
@nekromoff commented on GitHub (Mar 17, 2017):
PHP 7.0.15
$ php -m
[PHP Modules]
bcmath
calendar
Core
ctype
curl
date
dom
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
imap
intl
json
libxml
mbstring
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
Phar
posix
readline
Reflection
session
shmop
SimpleXML
sockets
SPL
standard
sysvmsg
sysvsem
sysvshm
tokenizer
wddx
xml
xmlreader
xmlwriter
xsl
Zend OPcache
zip
zlib
[Zend Modules]
Zend OPcache
@jasonmunro commented on GitHub (Mar 17, 2017):
odd, looks good and matches what I have. Have you double checked your db configuration in the ini file? The error is due to the fact that the expected database connection object is not being created, this could be because of a bad config value or failure to login to the db correctly. Also keep in mind anytime you change your hm3.ini file you have to run the scripts/config_gen.php script again.
@nekromoff commented on GitHub (Mar 17, 2017):
On Fri, Mar 17, 2017 at 10:28 PM, Jason Munro notifications@github.com
wrote:
Sorry, somehow I forgot to configure proper database. Anyway, now it seems
to be working to the point of getting this:
$ php ./scripts/create_account.php admin admin
An error occured
When I print out debug log, I get:
[0] => Connecting to dsn: mysql:host=127.0.0.1;dbname=cypht
@jasonmunro commented on GitHub (Mar 17, 2017):
We are getting closer! :) Can you try the following patch?: https://gist.github.com/jasonmunro/470e7e252ff358e5a710aa01e9fb1a81
This will dump errors from the database object to hopefully tell us what is going wrong.
Thanks!
@nekromoff commented on GitHub (Mar 17, 2017):
Getting this:
Array
(
[0] => 00000
[1] =>
[2] =>
)
BTW, I should have mentioned also this:
While trying to create the database tables, I was getting error about key too long:
Error in query (1071): Specified key was too long; max key length is 767 bytes
I found mention of it here saying that 767 bytes is the key length for InnoDB tables and 1000 bytes for MyISAM.
I thus shortened username field length to 50 in both users and settings tables and hm_id to 100 in session table.
@jasonmunro commented on GitHub (Mar 17, 2017):
odd that I have not run into that issue before, I have a test setup using InnoDB (but I noticed just now it's setup as varchar(250), not 255). The hm_id in the session table needs to be more than 100, looking at my current session ids they are 172 chars long.
Bummer that the debug did not provide any info, thanks for trying it. I can't reproduce this problem so I wasn't sure what it would do. The "Connecting to dsn: mysql:host=127.0.0.1;dbname=cypht" message means you are successfully connected to the database, so maybe now the issue is permissions on the table itself?
@nekromoff commented on GitHub (Mar 17, 2017):
I dropped the indexes to allow for the original field lengths and now it works fine.
So, I guess the fields being too short were the problem.
You might want to add error checking for existing user, though, when running create_account.php as when I run it with existing username, I just get "An error occured" message. It could warn me that I was trying to create user that already existed.
Thanks for your help!
@nekromoff commented on GitHub (Mar 17, 2017):
You might still want to investigate the problem with indexes under InnoDB tables that I ran into, though. Thanks!
@jasonmunro commented on GitHub (Mar 17, 2017):
I will see about improving the output on existing users, and definitely research the issue with innodb tables. Thanks for the feedback!