Invalid JSON when I add contributors

Describe the issue or problem
Pls pls any help is acknowledged, When I upload an articles & adding authors it displays invalid JSON error.
I also installed php gettext extension, when I see the installed modules using php -m, i didn’t see gettext list.
I am using OJS 3.3.0-15

Additional information
Please add any screenshots, logs or other information we can use to investigate this problem.
thrown in /var/www/public_html/lib/pkp/lib/vendor/sokil/php-isocodes/src/AbstractDatabase.php on line 87
466 [25-May-2024 13:36:27 UTC] PHP Warning: PHP Startup: Unable to load dynamic library ‘gettext.so’ (tried: /usr/lib/php74/ext
ensions/gettext.so (/usr/lib/php74/extensions/gettext.so: cannot open shared object file: No such file or directory), /usr/l
ib/php74/extensions/gettext.so.so (/usr/lib/php74/extensions/gettext.so.so: cannot open shared object file: No such file or
directory)) in Unknown on line 0
467 [25-May-2024 13:45:29 UTC] PHP Fatal error: Uncaught Error: Call to undefined function bindtextdomain() in /var/www/public_
html/lib/pkp/lib/vendor/sokil/php-isocodes/src/AbstractDatabase.php:87
468 Stack trace:
469 #0 /var/www/public_html/lib/pkp/lib/vendor/sokil/php-isocodes/src/AbstractDatabase.php(46): Sokil\IsoCodes\AbstractDatabase-
>bindGettextDomain()
470 #1 /var/www/public_html/lib/pkp/lib/vendor/sokil/php-isocodes/src/IsoCodesFactory.php(65): Sokil\IsoCodes\AbstractDatabase->
__construct()
471 #2 /var/www/public_html/lib/pkp/controllers/grid/users/author/form/PKPAuthorForm.inc.php(159): Sokil\IsoCodes\IsoCodesFactor
y->getCountries()
472 #3 /var/www/public_html/lib/pkp/controllers/grid/users/author/AuthorGridHandler.inc.php(314): PKPAuthorForm->fetch()
473 #4 /var/www/public_html/lib/pkp/controllers/grid/users/author/AuthorGridHandler.inc.php(287): AuthorGridHandler->editAuthor(
)
474 #5 /var/www/public_html/lib/pkp/classes/core/PKPRouter.inc.php(397): AuthorGridHandler->addAuthor()
475 #6 /var/www/public_html/lib/pkp/classes/core/PKPComponentRouter.inc.php(257): PKPRouter->_authorizeInitializeAndCallRequest(
)
476 #7 /var/www/public_html/lib/pkp/classes/core/Dispatcher.inc.php(144): PKPComponentRouter->route()
477 #8 /var/www/public_html/lib/pkp/classes/core/PKPApplication.inc.php(362): Dispatcher->dispatch()
478 #9 /var/www/public_html/index.php(68): PKPApplication->execute()
479 #10 {main}
480 thrown in /var/www/public_html/lib/pkp/lib/vendor/sokil/php-isocodes/src/AbstractDatabase.php on line 87
481 [25-May-2024 13:48:24 UTC] Server host "pro.ip-api.com not allowed!
482 [25-May-2024 13:48:24 UTC] ojs2: 400 Bad Request

Based on the information you provided and my experience, I can point out two situations:

  1. PHP gettext Extension: It appears that the PHP gettext extension is not properly installed or loaded. You mentioned that you installed the extension, but it does not appear in the list when you run php -m. This is likely causing the error:

    PHP Fatal error: Uncaught Error: Call to undefined function bindtextdomain() in /var/www/public_html/lib/pkp/lib/vendor/sokil/php-isocodes/src/AbstractDatabase.php:87
    

    Ensure that the gettext extension is correctly installed and configured. You can try reinstalling it and checking the PHP configuration files to ensure it’s enabled. Alternatively, you could ask your server administrators to install/enable this.

  2. Non-Latin Characters in Author Names: Do the author names contain non-Latin characters, such as French characters? I have encountered a similar problem on a server where the security software did not allow adding non-Latin characters. This might be relevant to your case.

Additionally, I see the error “Server host 'pro.ip-api.com not allowed!” in the error codes. This suggests that your server might be blocking connections to this host, which could be part of the issue.

If the above suggestions do not resolve the issue, please provide more details, including screenshots, additional logs, or any other relevant information. This can help in further diagnosing and resolving the problem.

Thank so much for your response. though I re-installed the problem is the same. Actually there is no Non-Latin Characters in Author Names, when I click to add contributors, Invalid JSON error is displayed. I use php 7.4.33, is there any way to activate the php gettext extension? all extensions were activated after installation when I type & check by using php -m command all their lists are available but not see gettext. when I check the extensions directory, I see gettext. I tried to activate using phpenmod. but not see still.
here the directory


and here the lists displayed after php -m command
image
please suggest me if any configurations required to activate gettext?

I don’t have detailed knowledge to install-activate extensions via CLI.
I manage activating and deactivating these settings through the CloudLinux Manager on the server and PHP Extensions on the user side.

To check if the gettext extension is installed and working in PHP, you can create a file named test.php with the following code:

<?php

if ( false === function_exists('gettext') ) {
    echo "You do not have the gettext library installed with PHP.";
    exit(1);
} else {
    echo "gettext is installed and working.";
}
?>
1 Like

Thank you yes it displays “You do not have the gettext library installed with PHP.”

[29-May-2024 14:51:00 UTC] PHP Warning: PHP Startup: Unable to load dynamic library ‘gettext.so’ (tried: /usr/lib/php74/exte
nsions/gettext.so (/usr/lib/php74/extensions/gettext.so: cannot open shared object file: No such file or directory), /usr/lib
/php74/extensions/gettext.so.so (/usr/lib/php74/extensions/gettext.so.so: cannot open shared object file: No such file or dir
ectory)) in Unknown on line 0
2 [29-May-2024 14:56:18 UTC] PHP Warning: PHP Startup: Unable to load dynamic library ‘gettext.so’ (tried: /usr/lib/php74/exte
nsions/gettext.so (/usr/lib/php74/extensions/gettext.so: cannot open shared object file: No such file or directory), /usr/lib
/php74/extensions/gettext.so.so (/usr/lib/php74/extensions/gettext.so.so: cannot open shared object file: No such file or dir
ectory)) in Unknown on line 0
3 [29-May-2024 15:04:49 UTC] PHP Warning: PHP Startup: Unable to load dynamic library ‘php_gettext.dll’ (tried: /usr/lib/php74
/extensions/php_gettext.dll (/usr/lib/php74/extensions/php_gettext.dll: cannot open shared object file: No such file or direc
tory), /usr/lib/php74/extensions/php_gettext.dll.so (/usr/lib/php74/extensions/php_gettext.dll.so: cannot open shared object
file: No such file or directory)) in Unknown on line 0
4 [29-May-2024 15:05:27 UTC] PHP Warning: PHP Startup: Unable to load dynamic library ‘gettext.so’ (tried: /usr/lib/php74/exte
nsions/gettext.so (/usr/lib/php74/extensions/gettext.so: cannot open shared object file: No such file or directory), /usr/lib
/php74/extensions/gettext.so.so (/usr/lib/php74/extensions/gettext.so.so: cannot open shared object file: No such file or dir
ectory)) in Unknown on line 0
5 [29-May-2024 15:10:20 UTC] PHP Warning: PHP Startup: Unable to load dynamic library ‘gettext.so’ (tried: /usr/lib/php74/exte
nsions/gettext.so (/usr/lib/php74/extensions/gettext.so: cannot open shared object file: No such file or directory), /usr/lib
/php74/extensions/gettext.so.so (/usr/lib/php74/extensions/gettext.so.so: cannot open shared object file: No such file or dir
ectory)) in Unknown on line 0
6


Here are the gettext packages available via webmin cpanel