danielmarschall / oidplus

OIDplus 2.0 - An OpenSource online Registration Authority for OIDs and other Object Types
https://www.oidplus.com
Apache License 2.0
10 stars 6 forks source link

Configuration file error on new install (invalid characters) #3

Closed mistial-dev closed 1 year ago

mistial-dev commented 1 year ago

Just installed a new OIDPlus repository, following the instructions in the configuration.

I'm getting the following error:

OIDplus error
syntax error, unexpected floating-point number ".1", expecting ")"

Technical information about the problem:

ParseError
at file /var/www/oidplus/userdata/baseconfig/config.inc.php (line 6)

Stacktrace:
#0 /var/www/oidplus/includes/classes/OIDplus.class.php(867): OIDplus::baseConfig()
#1 /var/www/oidplus/index.php(28): OIDplus::init()
#2 {main}

The config file looks like this:

OIDplus::baseConfig()->setValue('CONFIG_VERSION',    2.1);

It looks like perhaps some unicode ended up in there. I copied and pasted directly into the file by terminal.

00000390  6c 75 73 3a 3a 62 61 73  65 43 6f 6e 66 69 67 28  |lus::baseConfig(|
000003a0  29 2d 3e 73 65 74 56 61  6c 75 65 28 27 43 41 50  |)->setValue('CAP|
000003b0  54 43 48 41 5f 50 4c 55  47 49 4e 27 2c c2 a0 c2  |TCHA_PLUGIN',...|
000003c0  a0 c2 a0 c2 a0 27 56 69  61 54 68 69 6e 6b 53 6f  |.....'ViaThinkSo|
000003d0  66 74 c2 a0 43 6c 69 65  6e 74 c2 a0 43 68 61 6c  |ft..Client..Chal|
000003e0  6c 65 6e 67 65 27 29 3b  0a 0a 0a 4f 49 44 70 6c  |lenge');...OIDpl|
000003f0  75 73 3a 3a 62 61 73 65  43 6f 6e 66 69 67 28 29  |us::baseConfig()|
00000400  2d 3e 73 65 74 56 61 6c  75 65 28 27 45 4e 46 4f  |->setValue('ENFO|
00000410  52 43 45 5f 53 53 4c 27  2c c2 a0 c2 a0 c2 a0 c2  |RCE_SSL',.......|
00000420  a0 c2 a0 c2 a0 c2 a0 4f  49 44 70 6c 75 73 3a 3a  |.......OIDplus::|
00000430  45 4e 46 4f 52 43 45 5f  53 53 4c 5f 59 45 53 29  |ENFORCE_SSL_YES)|
00000440  3b 0a                                             |;.|

Cleaning up the file fixes the parsing issue.

mistial-dev commented 1 year ago

This also led to an error about a missing plugin until the spaces were replaced.

OIDplus initialization error
CAPTCHA plugin "ViaThinkSoft Client Challenge" not found

Please check the file userdata/baseconfig/config.inc.php or run [setup](https://oid.openphysical.org/setup/) again

Technical information about the problem:

OIDplusConfigInitializationException
at file /var/www/oidplus/includes/classes/OIDplus.class.php (line 412)

Stacktrace:
#0 /var/www/oidplus/plugins/viathinksoft/adminPages/050_oobe/oobe.php(48): OIDplus::getActiveCaptchaPlugin()
#1 {main}

PHP 8.2, fresh ubuntu 20.06 install.

danielmarschall commented 1 year ago

Thank you for your very helpful bug-report! This has now be fixed in SVN-Rev-996 and 72f9b0295c9a2d6983cbba8c9b86b5b3491671b4