Creating users - "Failed Ajax request or invalid JSON returned"

This is my first installation of OJS and I cannot seem to run the basics. The installation steps seem to miss the file permissions and I really struggle with that part.

I am not sure at all if I understand which permissions I should give to each file. I read somewhere that it depends on the API server, but I don’t have neither mod_php/SAPI or CGI/FastCGI but I have LiteSpeed V8.0.1 and nothing is specified for this API server.

The main problem I have is that I can’t create new users, whether it is through the administration panel or manually on the login page. I either get the “Failed Ajax request or invalid JSON returned” (through the admin panel) or the page seems to not load at all.

Moreover, the “Distribution” page only load as a blank page.

I have OJS 3.3.0-11.

It is actually can be solved by installing and activating php extension named gettext and fileinfo.
Your version of PHP is missing support for this modules/extentions. You’ll have to enable it, either by installing the module (that would depend on your operating system) or if you’re using a web host then enable it via their control panel for PHP modules.

Hi @SimonDor,

Check your PHP error log for details – it’ll be a lot easier than guessing!

Regards,
Alec Smecher
Public Knowledge Project Team

I like to say that I understand something to this, but here is what I get:

Variations of this:

[02-Oct-2022 15:18:37 UTC] PHP Warning:  file_put_contents(/home/kinephanos/public_html/ojs/cache/fc-timeZone-list.php): Failed to open stream: Permission denied in /home/kinephanos/public_html/ojs/lib/pkp/classes/cache/FileCache.inc.php on line 90

And variations of that:

[03-Oct-2022 00:45:49 UTC] PHP Fatal error:  Uncaught Error: Call to undefined function bindtextdomain() in /home/kinephanos/public_html/ojs/lib/pkp/lib/vendor/sokil/php-isocodes/src/AbstractDatabase.php:87
Stack trace:
#0 /home/kinephanos/public_html/ojs/lib/pkp/lib/vendor/sokil/php-isocodes/src/AbstractDatabase.php(46): Sokil\IsoCodes\AbstractDatabase->bindGettextDomain()
#1 /home/kinephanos/public_html/ojs/lib/pkp/lib/vendor/sokil/php-isocodes/src/IsoCodesFactory.php(65): Sokil\IsoCodes\AbstractDatabase->__construct(NULL)
#2 /home/kinephanos/public_html/ojs/lib/pkp/controllers/grid/settings/user/form/UserDetailsForm.inc.php(163): Sokil\IsoCodes\IsoCodesFactory->getCountries()
#3 /home/kinephanos/public_html/ojs/lib/pkp/controllers/grid/settings/user/UserGridHandler.inc.php(287): UserDetailsForm->display(Object(Request))
#4 /home/kinephanos/public_html/ojs/lib/pkp/controllers/grid/settings/user/UserGridHandler.inc.php(264): UserGridHandler->editUser(Array, Object(Request))
#5 /home/kinephanos/public_html/ojs/lib/pkp/classes/core/PKPRouter.inc.php(395): UserGridHandler->addUser(Array, Object(Request))
#6 /home/kinephanos/public_html/ojs/lib/pkp/classes/core/PKPComponentRouter.inc.php(257): PKPRouter->_authorizeInitializeAndCallRequest(Array, Object(Request), Array)
#7 /home/kinephanos/public_html/ojs/lib/pkp/classes/core/Dispatcher.inc.php(144): PKPComponentRouter->route(Object(Request))
#8 /home/kinephanos/public_html/ojs/lib/pkp/classes/core/PKPApplication.inc.php(362): Dispatcher->dispatch(Object(Request))
#9 /home/kinephanos/public_html/ojs/index.php(68): PKPApplication->execute()
#10 {main}
  thrown in /home/kinephanos/public_html/ojs/lib/pkp/lib/vendor/sokil/php-isocodes/src/AbstractDatabase.php on line 87

“gettext” was not activated for php on your server.
Could you ( or ask your server administrators to) install/enable this?

You were right, that was the problem! Thank you both for your help!

For other who would be struggling with the process: I did try to enable it myself using the webserver interface, but it was a lot easier by just asking my web service provider! :slight_smile:

1 Like