Ojs install problem

I downloaded OJS-3 as per:
https://docs.pkp.sfu.ca/admin-guide/en/getting-started
I am trying to install on Debian-11, and did install PHP-8 and its friends & MariaDB.

unpacking and running the PHP server in that directory, from my (remote) windows machine I cannot run the install console. I get no response to a url of:
http://www.ojshost.org:8000" (name changed here…)

So I tried instead to run: “php -S ojshost.org:8000
(just guessing, not familiar with how the PHP server works)

and then from remote the same url as above it does give a response on the server, with errors. (below)
Some searching reported that similar errors came from not having the PHP-xml module loaded, but I did (apt) install it and it is there.

“php -m” reports libxml installed.
Any hints on where to go from here?

root@cs-Debian:/home/admin/ojs/ojs-3.3.0-17# php -S tmresearch.org:8000
[Mon Apr 1 20:35:48 2024] PHP 8.0.30 Development Server (http://tmresearch.org:8000) started
[Mon Apr 1 20:35:54 2024] 181.214.167.20:61580 Accepted
[Mon Apr 1 20:35:54 2024] PHP Fatal error: Uncaught Error: Call to undefined function xml_parser_create() in /home/admin/ojs/ojs-3.3.0-17/lib/pkp/classes/xml/PKPXMLParser.inc.php:212
Stack trace:
#0 /home/admin/ojs/ojs-3.3.0-17/lib/pkp/classes/xml/PKPXMLParser.inc.php(162): PKPXMLParser->createParser()
#1 /home/admin/ojs/ojs-3.3.0-17/lib/pkp/classes/xml/PKPXMLParser.inc.php(204): PKPXMLParser->parseTextStruct()
#2 /home/admin/ojs/ojs-3.3.0-17/lib/pkp/classes/db/XMLDAO.inc.php(52): PKPXMLParser->parseStruct()
#3 /home/admin/ojs/ojs-3.3.0-17/lib/pkp/classes/i18n/TimeZoneDAO.inc.php(58): XMLDAO->parseStruct()
#4 /home/admin/ojs/ojs-3.3.0-17/lib/pkp/classes/cache/GenericCache.inc.php(63): TimeZoneDAO->_timeZoneCacheMiss()
#5 /home/admin/ojs/ojs-3.3.0-17/lib/pkp/classes/cache/FileCache.inc.php(125): GenericCache->get()
#6 /home/admin/ojs/ojs-3.3.0-17/lib/pkp/classes/i18n/TimeZoneDAO.inc.php(77): FileCache->getContents()
#7 /home/admin/ojs/ojs-3.3.0-17/lib/pkp/classes/i18n/PKPLocale.inc.php(877): TimeZoneDAO->getTimeZones()
#8 /home/admin/ojs/ojs-3.3.0-17/lib/pkp/classes/i18n/PKPLocale.inc.php(300): PKPLocale::getTimeZone()
#9 /home/admin/ojs/ojs-3.3.0-17/lib/pkp/classes/core/Dispatcher.inc.php(116): PKPLocale::initialize()
#10 /home/admin/ojs/ojs-3.3.0-17/lib/pkp/classes/core/PKPApplication.inc.php(360): Dispatcher->dispatch()
#11 /home/admin/ojs/ojs-3.3.0-17/index.php(68): PKPApplication->execute()
#12 {main}
thrown in /home/admin/ojs/ojs-3.3.0-17/lib/pkp/classes/xml/PKPXMLParser.inc.php on line 212
[Mon Apr 1 20:35:54 2024] 181.214.167.20:61580 [500]: GET / - Uncaught Error: Call to undefined function xml_parser_create() in /home/admin/ojs/ojs-3.3.0-17/lib/pkp/classes/xml/PKPXMLParser.inc.php:212
Stack trace:
#0 /home/admin/ojs/ojs-3.3.0-17/lib/pkp/classes/xml/PKPXMLParser.inc.php(162): PKPXMLParser->createParser()
#1 /home/admin/ojs/ojs-3.3.0-17/lib/pkp/classes/xml/PKPXMLParser.inc.php(204): PKPXMLParser->parseTextStruct()
#2 /home/admin/ojs/ojs-3.3.0-17/lib/pkp/classes/db/XMLDAO.inc.php(52): PKPXMLParser->parseStruct()
#3 /home/admin/ojs/ojs-3.3.0-17/lib/pkp/classes/i18n/TimeZoneDAO.inc.php(58): XMLDAO->parseStruct()
#4 /home/admin/ojs/ojs-3.3.0-17/lib/pkp/classes/cache/GenericCache.inc.php(63): TimeZoneDAO->_timeZoneCacheMiss()
#5 /home/admin/ojs/ojs-3.3.0-17/lib/pkp/classes/cache/FileCache.inc.php(125): GenericCache->get()
#6 /home/admin/ojs/ojs-3.3.0-17/lib/pkp/classes/i18n/TimeZoneDAO.inc.php(77): FileCache->getContents()
#7 /home/admin/ojs/ojs-3.3.0-17/lib/pkp/classes/i18n/PKPLocale.inc.php(877): TimeZoneDAO->getTimeZones()
#8 /home/admin/ojs/ojs-3.3.0-17/lib/pkp/classes/i18n/PKPLocale.inc.php(300): PKPLocale::getTimeZone()
#9 /home/admin/ojs/ojs-3.3.0-17/lib/pkp/classes/core/Dispatcher.inc.php(116): PKPLocale::initialize()
#10 /home/admin/ojs/ojs-3.3.0-17/lib/pkp/classes/core/PKPApplication.inc.php(360): Dispatcher->dispatch()
#11 /home/admin/ojs/ojs-3.3.0-17/index.php(68): PKPApplication->execute()
#12 {main}
thrown in /home/admin/ojs/ojs-3.3.0-17/lib/pkp/classes/xml/PKPXMLParser.inc.php on line 212
[Mon Apr 1 20:35:54 2024] 181.214.167.20:61580 Closing
[Mon Apr 1 20:35:55 2024] 181.214.167.20:61581 Accepted
[Mon Apr 1 20:35:55 2024] 181.214.167.20:61581 [200]: GET /favicon.ico
[Mon Apr 1 20:35:55 2024] 181.214.167.20:61581 Closing

ok, correction (!)
I had downloaded 3.3, but was using the instructions for 3.4 -
so retrying with 3.4, I get a different error:
PHP Fatal error: Uncaught Error: Class “Locale” not found in /home/admin/ojs/ojs-3.4.0-5/lib/pkp/classes/i18n/Locale.php:148

I do have php_intl installed.

Hello @guthrie,

I got curious since I saw your post, I tested the installation steps right now and everything worked fine for me so far (I assumed you didn’t have the chance to go to the installation screen, right?)… Are you sure intl is installed for you PHP? You may double check it by running php -m to list all packages or php -m | grep intl to see it easier.

Besides, let me ask you, do you want to try/develop or do a production install? Remember that those steps are to try/develop. In all of these cases I am using the Docker images to install OJS, which allows me to easily install => develop => upgrade. Since you are doing a new install, maybe it is a good idea to go through it :wink:

Note: I am not from PKP team, just trying to help and give some ideas.

Hi @guthrie,

Debian (and other distributions) often have different php.ini configuration files for the command-line vs. web-based PHP. And depending on how you have PHP installed, you also may have to restart the web server for changes to the configuration file to take effect.

Long story short: even if you’re pretty sure you have intl installed and enabled, it’s best to put a web-based phpinfo script in place to double-check. Using php -i may not give you the right information.

Regards,
Alec Smecher
Public Knowledge Project Team

@henriquejsfj - Thanks for the note and reply.
I am trying to just do a beta installation to see if it fits our publication needs.
I was pretty sure that I had the right php installs, but checking does not show intl ??

root@cs-Debian:/home/admin/ojs# apt-get install php-intl
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
php-intl is already the newest version (2:8.3+94+0~20240205.51+debian11~1.gbp6faa2e).
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
root@cs-Debian:/home/admin/ojs# php -m | grep intl

@asmecher - thanks, as noted above, there seems to be something wrong with my php-intl install.
I just did a vanilla apt-get install of all the given prerequisites, so not sure what else to do.
I’m not sure what it means to have intl “enabled”.
I’m a bit of a novice to this tool and general PHP areas.
I do see: “php -i | grep intl” shows nothing,
so something is wrong!

root@cs-Debian:/home/admin/ojs# apt-get install php-intl
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
php-intl is already the newest version (2:8.3+94+0~20240205.51+debian11~1.gbp6faa2e).
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.

Hi @guthrie,

This is more of a Debian / PHP question than an OJS question, so you might try looking around on StackOverflow for guidance – but installing the module using apt-get doesn’t necessarily enable it. Look up a2enmod (and again, you might have to restart Apache before configuration changes take effect).

Regards,
Alec Smecher
Public Knowledge Project Team

@asmecher - Ok, thanks - I’ll do that.
I don’t understand the role of Apache in this, since the instructions say to start the PHP web server for configuration startup.
And I didn’t see anywhere in the install instructions a need to enable mods on Apache, or even that it would be running (mine is).
And the php8.0 mod is enabled anyway.
Thanks.

Q: I saw in one post that the distribution should be unpacked (installed) in the web server hierarchy, but the instructions just say … anywhere. (??)

Hmm, I did a reinstall of php, and the error went away and tests show intl installed!
Now I can get the install screen. But,
the install requirements say - for database:
" * MySQL 5.7.22+, MariaDB 4.1+ or PostgreSQL 9.5+
Debian showed MariaDB as a replacement alternative (they stopped packaging mysql several releases ago) so I installed that - but the configuration page shows no candidate database - and MariaDB is not listed as an option - is the “requirements” page wrong?

So I installed Postgresql, but still the install page does not show it as an option.
It does say:
" The system currently supports MySQL and PostgreSQL, in case you’re unable to select one of these options below, contact your system administrator to ensure your server has the required PHP extensions."
Not sure what to make of that or to do.
TIA

Hi @guthrie,

From OJS’s perspective, MariaDB and MySQL are synonymous. If you have MariaDB installed, choose MySQL in the OJS configuration form.

Regards,
Alec Smecher
Public Knowledge Project Team

@asmecher : Thank you.
I do have MariaDB installed, but it does not show up as an option in the configuration page.

libdbd-mariadb-perl/oldstable,now 1.21-3 amd64 [installed,automatic]
libmariadb-dev-compat/oldstable 1:10.5.23-0+deb11u1 amd64
libmariadb-dev/oldstable 1:10.5.23-0+deb11u1 amd64
libmariadb-java/oldstable 2.7.2-1 all
libmariadb3/oldstable,now 1:10.5.23-0+deb11u1 amd64 [installed,automatic]
libmariadbd-dev/oldstable 1:10.5.23-0+deb11u1 amd64
libmariadbd19/oldstable 1:10.5.23-0+deb11u1 amd64
maria-doc/oldstable 1.3.5-4.1 all
maria/oldstable 1.3.5-4.1+b2 amd64
mariadb-backup/oldstable 1:10.5.23-0+deb11u1 amd64
mariadb-client-10.5/oldstable,now 1:10.5.23-0+deb11u1 amd64 [installed,automatic]
mariadb-client-core-10.5/oldstable,now 1:10.5.23-0+deb11u1 amd64 [installed,automatic]
mariadb-client/oldstable 1:10.5.23-0+deb11u1 all
mariadb-common/oldstable,now 1:10.5.23-0+deb11u1 all [installed,automatic]
mariadb-plugin-connect/oldstable 1:10.5.23-0+deb11u1 amd64
mariadb-plugin-cracklib-password-check/oldstable 1:10.5.23-0+deb11u1 amd64
mariadb-plugin-gssapi-client/oldstable 1:10.5.23-0+deb11u1 amd64
mariadb-plugin-gssapi-server/oldstable 1:10.5.23-0+deb11u1 amd64
mariadb-plugin-mroonga/oldstable 1:10.5.23-0+deb11u1 amd64
mariadb-plugin-oqgraph/oldstable 1:10.5.23-0+deb11u1 amd64
mariadb-plugin-rocksdb/oldstable 1:10.5.23-0+deb11u1 amd64
mariadb-plugin-s3/oldstable 1:10.5.23-0+deb11u1 amd64
mariadb-plugin-spider/oldstable 1:10.5.23-0+deb11u1 amd64
mariadb-server-10.5/oldstable 1:10.5.23-0+deb11u1 amd64
mariadb-server-core-10.5/oldstable 1:10.5.23-0+deb11u1 amd64
mariadb-server/oldstable 1:10.5.23-0+deb11u1 all
mariadb-test-data/oldstable 1:10.5.23-0+deb11u1 all
mariadb-test/oldstable 1:10.5.23-0+deb11u1 amd64
odbc-mariadb/oldstable 3.1.9-1 amd64
php-mariadb-mysql-kbs/oldstable 1.2.12-1 all

Hi @guthrie,

You’re probably missing PHP support for MySQL (or PostgreSQL). These are installed as modules. Make sure the php-mysql (for MariaDB or PostgreSQL) or php-pgsql (for PostgreSQL) package is installed.

Regards,
Alec Smecher
Public Knowledge Project Team

Yep - good insight - thanks…
moving forward. :slight_smile:

Continuing…
starting setup/install:

Errors occurred during installation A database error has occurred: SQLSTATE[HY000] [2002] Connection refused (SQL: create table journals (journal_id bigint not null auto_increment primary key, path varchar(32) not null, seq double(8, 2) not null default ‘0’ comment ‘Used to order lists of journals’, primary_locale varchar(14) not null, enabled smallint not null default ‘1’ comment ‘Controls whether or not the journal is considered "live" and will appear on the website. (Note that disabled journals may still be accessible, but only if the user knows the URL.)’, current_issue_id bigint null) default character set utf8 collate ‘utf8_general_ci’)

mariadb is installed and running.

root@cs-Debian:/home/admin/ojs# mariadb --version
mariadb Ver 15.1 Distrib 10.5.23-MariaDB, for debian-linux-gnu (x86_64) using EditLine wrapper

root@cs-Debian:/home/admin/ojs# sudo systemctl status mariadb
● mariadb.service - MariaDB 10.5.23 database server
Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2024-04-02 22:21:19 UTC; 30min ago
Docs: man:mariadbd(8)
https://mariadb.com/kb/en/library/systemd/
Process: 209465 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/>
Process: 209466 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0>
Process: 209468 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= || VAR=`cd /usr/bin/…; /usr>
Process: 209530 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=>
Process: 209532 ExecStartPost=/etc/mysql/debian-start (code=exited, status=0/SUCCESS)
Main PID: 209515 (mariadbd)
Status: “Taking your SQL requests now…”
Tasks: 9 (limit: 1114)
Memory: 82.1M
CPU: 828ms
CGroup: /system.slice/mariadb.service
└─209515 /usr/sbin/mariadbd

Hmm, I had changed the database name from ojs2 to ojs4, and that seemed to break things(?). Changing it back to ojs2, I get a new error message:
Do I need to manually create the database first, with the name in the setup script (some tutorials say yes, but that is not in the instructions).

SQLSTATE[HY000] [1045] Access denied for user ‘ojs2’@‘localhost’ (using password: YES) (SQL: create table journals (journal_id bigint not null auto_increment primary key, path varchar(32) not null, seq double(8, 2) not null default ‘0’ comment ‘Used to order lists of journals’, primary_locale varchar(14) not null, enabled smallint not null default ‘1’ comment ‘Controls whether or not the journal is considered "live" and will appear on the website. (Note that disabled journals may still be accessible, but only if the user knows the URL.)’, current_issue_id bigint null) default character set utf8 collate ‘utf8_general_ci’)

If I manually enter this query comand to mariadb - I get the error “No Database selected”,
and if I ask “show databases” I don’t see any ojs database…

Hi @guthrie,

Yes, you need to create the database and grant access to a user with a password. Then use the database name, username, and password in the OJS installation form.

Regards,
Alec Smecher
Public Knowledge Project Team

@asmecher Thank you - seems like this should be in the instructions (did I miss it?).
Also the need to install the database php connector.

Once I had pre-setup the database, installation was fine!
Many thanks.

Hi @guthrie,

The docs could certainly be a little more explicit about it! I’ll file that for our next documentation sprint. Meanwhile, glad to hear you’re on the way.

Regards,
Alec Smecher
Public Knowledge Project Team