Yubico Forum
https://forum.yubico.com/

Deploying an php validation server
https://forum.yubico.com/viewtopic.php?f=5&t=846
Page 1 of 2

Author:  soldier24 [ Sun Aug 12, 2012 1:12 pm ]
Post subject:  Deploying an php validation server

Hello,
i want to deploy a php validation server but i have some problems while testing.
i following this tutorial: http://forum.yubico.com/viewtopic.php?f ... ploy#p1716
but I get a php error when I want to test. (as described in the tutorial in step 6)
Quote:
Notice: Use of undefined constant LOG_LOCAL0 - assumed 'LOG_LOCAL0' in C:\webserver\htdocs\yubico\ksm\ykksm-config.php on line 6

Warning: openlog() expects parameter 3 to be long, string given in C:\webserver\htdocs\ksm\ykksm-decrypt.php on line 34
ERR Syslog open error

what does this error mean and how can I fix this?
there are also other ways to make a validation server on a Windows server?

Author:  Klas [ Mon Aug 13, 2012 7:06 am ]
Post subject:  Re: Deploying an php validation server

Hello,

It seems LOG_LOCAL0 is not defined on windows, as the user 'bertunad' finds out in the thread you linked it seems you have to change it to something that is defined, LOG_USER should work fine.

/klas

Author:  soldier24 [ Mon Aug 13, 2012 5:28 pm ]
Post subject:  Re: Deploying an php validation server

Klas-at-Yubico wrote:
Hello,

It seems LOG_LOCAL0 is not defined on windows, as the user 'bertunad' finds out in the thread you linked it seems you have to change it to something that is defined, LOG_USER should work fine.

/klas

Thanks, I solved this error but there comes a new problem.
I now get: Database error ERR.
I have everything checked 2 times.
Here I have the config file, but I think the problem is not the config file.
Code:
<?php
$db_dsn      = "mysql:dbname=ykksm;host=127.0.0.1";
$db_username = "root";
$db_password = "password"; //I have the password hidden
$db_options  = array();
$logfacility = LOG_USER;
?>


Author:  Klas [ Tue Aug 14, 2012 2:05 pm ]
Post subject:  Re: Deploying an php validation server

Hello,

Have you made sure the mysql module is loaded in php? If you're sure that it is, can you paste the exact falure you get here?

/klas

Author:  soldier24 [ Tue Aug 14, 2012 5:02 pm ]
Post subject:  Re: Deploying an php validation server

i got here 2 screenshots,
one is from my php configuraton with loaded modules.
The second screenshots is from my browser when i now test the otp after i corrected the value LOG_LOCAL0 to LOG_USER
my server logs says nothing about the problem now.

I have a suspicion that the problem is in ykksm-decrypt.php.
I do not know if the perl files is because I do not know the programming language Perl.

Author:  Klas [ Wed Aug 15, 2012 6:55 am ]
Post subject:  Re: Deploying an php validation server

Did you follow the step in the linked HOWTO where you rename the yubikeys table to ksm_yubikeys (in step 4) in that case you have to change the "...FROM yubikeys..." to read "...FROM ksm_yubikeys..."

The error is written from one of those 'die("ERR Database Error")', modify them so you can see which one. If it's the first one the error is triggered in connecting to the database or loading the database modules. If it's the second one it's triggered on querying the database. You should get the log lines in syslog as well, I guess that depends on what php on windows does with syslog..

/klas

Author:  soldier24 [ Wed Aug 15, 2012 7:55 am ]
Post subject:  Re: Deploying an php validation server

I think I've read too fast ... (my wrong :lol:)
I have corrected the errors and and behind the first ("Database error ERR") is the following error.

Quote:
Notice: Undefined variable: dbh in C:\webserver\root\yubico\ksm\ykksm-decrypt.php on line 60
Fatal error: Call to a member function query() on a non-object in C:\webserver\root\yubico\ksm\ykksm-decrypt.php on line 60


i`ve tried again on a another server (xampp) and the error is gone but the error is now on that server.
Quote:
Fatal error: Cannot redeclare hex2bin() in C:\xampp\htdocs\yubico\ksm\ykksm-utils.php on line 39

Author:  Klas [ Wed Aug 15, 2012 8:47 am ]
Post subject:  Re: Deploying an php validation server

On the first server it's probably either an error with the database modules or with connecting to the database.

On the second server you're probably running php 5.4, which comes with it's own hex2bin function, it should give the same results to the one shipped with yubikey-ksm, so you can remove/rename the function in ykksm-utils.php.

/klas

Author:  soldier24 [ Wed Aug 15, 2012 11:08 am ]
Post subject:  Re: Deploying an php validation server

It works now. :D
Yubikey ksm runs correctly now: OK counter=0004 low=8c04 high=d8 use=18
The yubikey-val-server-php is almost ready but i got this: :? (One day I shall get this working! :lol: )
Quote:
Notice: Undefined property: DbImpl::$result in C:\xampp\htdocs\yubico\validation\ykval-db-pdo.php on line 85

Notice: Undefined property: DbImpl::$result in C:\xampp\htdocs\yubico\validation\ykval-db-pdo.php on line 98

Fatal error: Call to a member function closeCursor() on a non-object in C:\xampp\htdocs\yubico\validation\ykval-db-pdo.php on line 99

Author:  Klas [ Wed Aug 15, 2012 12:57 pm ]
Post subject:  Re: Deploying an php validation server

Great that the KSM is working.

Did you change the database table name to val_yubikeys for the validation server? Since that forum post was written the validation server has been refactored. You'll need to change the tablename in the file ykval-synclib.php.

/klas

Page 1 of 2 All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/