Installing 3.0.1 install.php fatal error

I have made the step 2 files/directories writeable (using steps below). When I try to run the ‘php /tools/install.php’ from the ojs-3.0.1 directory I get a ‘PHP Fatal error: Call to undefined method InstallTool: : InstallTool () in ojs-3.0.1/tools/install.php on line 26’ error and it will not install. What am I doing wrong?

Standard html files are stored on /var/www/, owned by root:root, with permissive permission, all can read, but only root can write.
To ordinary user write to /var/www need to takeover it. Supposed the use is pi.
sudo chown -R pi:www-data /var/www
Also, need to set user and group permission:
sudo chmod u+rxw,g+rx-w,o-rwx /var/www
Now, /var/www can be read,write and chdir by user pi, group www-data can chdir and read. Other not have access.
sudo chmod g+s /var/www
Any new file created on /var/www belong to group www-data.
If have files on /var/www, change user and group, and allow to group www-data read.
For file chmod u+rw,g+r-xw,o-rwx
For directory chmod u+rwx,g+rx-w,o-rxw
Now, user pi can manipulate files on /var/www and httpd can read, but not write.

Hi @russlhuizing,

That’s a known issue with OJS 3.0.1 – see Fix tool constructor syntax · Issue #2046 · pkp/pkp-lib · GitHub
for a description and patch. You can either apply one of the patches there, or use the web-based installation tool. I’d recommend the latter.

Regards,
Alec Smecher
Public Knowledge Project Team

Alec - thanks for the quick response. I point my browser to the ojs-3.0.1 directory but it just gives me a 404 error. So, I have been using terminal.

I updated the runScheduledTasks.php file removing

function runScheduledTasks($argv = array()) {
parent::ScheduledTaskTool($argv);

and adding

function __construct($argv = array()) {
parent::__construct($argv);

after saving and running install.php again, I get the identical error indicated above. I noticed that kasioumis’ community forum post on 11/16 indicates that the error was for ScheduledTaskTool whereas my error indicates InstallTool…I am quite new to all of this - are they the same?

Hi @russlhuizing,

This commit on that issue should correct the issue for the tool you’re working with. If you’re getting 404 errors, it may be that your server doesn’t support PATH_INFO URLs; to check that, try turning on disable_path_info in config.inc.php. It’ll use work-around URLs that don’t require that feature, though they’re much uglier. If that turns out to be the problem, consider configuring your web server to support PATH_INFO URLs rather than leaving the setting on.

Regards,
Alec Smecher
Public Knowledge Project Team

That seems to have worked (the commits…still not sure why the PATH_INFO URL is not working…). Thanks for your help!

My server crashed and backups were corrupted…I am trying to install 3.1.0-1. When trying to run the install.php I get the following fatal error. Ideas?

PHP Fatal error: Uncaught Error: Call to undefined function xml_parser_create() in /var/www/html/ojs-3.1.0-1/lib/pkp/classes/xml/XMLParser.inc.php:271
Stack trace:
#0 /var/www/html/ojs-3.1.0-1/lib/pkp/classes/xml/XMLParser.inc.php(220): XMLParser->createParser()
#1 /var/www/html/ojs-3.1.0-1/lib/pkp/classes/xml/XMLParser.inc.php(262): XMLParser->parseTextStruct(’<?xml version="…’, Array)
#2 /var/www/html/ojs-3.1.0-1/lib/pkp/classes/db/XMLDAO.inc.php(55): XMLParser->parseStruct(‘lib/pkp/registr…’, Array)
#3 /var/www/html/ojs-3.1.0-1/lib/pkp/classes/i18n/TimeZoneDAO.inc.php(58): XMLDAO->parseStruct(‘lib/pkp/registr…’, Array)
#4 /var/www/html/ojs-3.1.0-1/lib/pkp/classes/cache/GenericCache.inc.php(63): TimeZoneDAO->_timeZoneCacheMiss(Object(FileCache), NULL)
#5 /var/www/html/ojs-3.1.0-1/lib/pkp/classes/cache/FileCache.inc.php(114): GenericCache->get(NULL)
#6 /var/www/html/ojs-3.1.0-1/lib/pkp/classes/i18n/TimeZoneDAO.inc.php(77): FileCache->getContents()
#7 /var/www/html/ojs-3.1.0-1/lib/pkp/classes/i18n/PKPLocale.inc.php(713) in /var/www/html/ojs-3.1.0-1/lib/pkp/classes/xml/XMLParser.inc.php on line 271

Hi @russlhuizing,

Your PHP installation is missing the required xml module.

Regards,
Alec Smecher
Public Knowledge Project Team

Thanks for the quick reply. That seems to have worked but getting another fatal error…

PHP Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /var/www/html/ojs-3.1.0-1/lib/pkp/lib/adodb/drivers/adodb-mysql.inc.php:456
Stack trace:
#0 /var/www/html/ojs-3.1.0-1/lib/pkp/lib/adodb/adodb.inc.php(558): ADODB_mysql->_connect(‘host’, ‘username’, ‘password’, ‘’)
#1 /var/www/html/ojs-3.1.0-1/lib/pkp/classes/db/DBConnection.inc.php(144): ADOConnection->Connect(’(‘host’, ‘username’, ‘password’, ‘’, NULL, false)
#2 /var/www/html/ojs-3.1.0-1/lib/pkp/classes/db/DBConnection.inc.php(119): DBConnection->connect()
#3 /var/www/html/ojs-3.1.0-1/lib/pkp/classes/db/DBConnection.inc.php(106): DBConnection->initConn()
#4 /var/www/html/ojs-3.1.0-1/lib/pkp/classes/db/DBConnection.inc.php(55): DBConnection->initCustomDBConnection(‘mysql’, '(‘host’, ‘username’, ‘password’, ‘’, NULL, false, false)
#5 /var/www/html/ojs-3.1.0-1/lib/pkp/classes/install/PKPInstall.inc.php(76): DBConnection->__construct(‘mysql’, (‘host’, ‘username’, ‘password’, NULL, false, false)
#6 /var/www/html/ojs-3 in /var/www/html/ojs-3.1.0-1/lib/pkp/lib/adodb/drivers/adodb-mysql.inc.php on line 456

Hi @russlhuizing,

See e.g. this thread.

Regards,
Alec Smecher
Public Knowledge Project Team

Thanks…got me a step closer. But now I have this:

[pre-install]
[load: install.xml]
[version: 3.1.0.1]

[code: Installer Installer::createDirectories]

[code: Installer Installer::createDatabase]
[schema: lib/pkp/xml/schema/common.xml]
PHP Notice: Only variables should be passed by reference in /var/www/html/ojs-3.1.0-1/lib/pkp/lib/adodb/adodb-xmlschema.inc.php on line 267
PHP Notice: Only variables should be passed by reference in /var/www/html/ojs-3.1.0-1/lib/pkp/lib/adodb/adodb-xmlschema.inc.php on line 267
PHP Notice: Only variables should be passed by reference in /var/www/html/ojs-3.1.0-1/lib/pkp/lib/adodb/adodb-xmlschema.inc.php on line 267
PHP Notice: Only variables should be passed by reference in /var/www/html/ojs-3.1.0-1/lib/pkp/lib/adodb/adodb-xmlschema.inc.php on line 267
PHP Notice: Only variables should be passed by reference in /var/www/html/ojs-3.1.0-1/lib/pkp/lib/adodb/adodb-xmlschema.inc.php on line 267
PHP Notice: Only variables should be passed by reference in /var/www/html/ojs-3.1.0-1/lib/pkp/lib/adodb/adodb-xmlschema.inc.php on line 267
PHP Notice: Only variables should be passed by reference in /var/www/html/ojs-3.1.0-1/lib/pkp/lib/adodb/adodb-xmlschema.inc.php on line 267
PHP Notice: Only variables should be passed by reference in /var/www/html/ojs-3.1.0-1/lib/pkp/lib/adodb/adodb-xmlschema.inc.php on line 267
PHP Notice: Only variables should be passed by reference in /var/www/html/ojs-3.1.0-1/lib/pkp/lib/adodb/adodb-xmlschema.inc.php on line 267
PHP Notice: Only variables should be passed by reference in /var/www/html/ojs-3.1.0-1/lib/pkp/lib/adodb/adodb-xmlschema.inc.php on line 267
PHP Notice: Only variables should be passed by reference in /var/www/html/ojs-3.1.0-1/lib/pkp/lib/adodb/adodb-xmlschema.inc.php on line 267
PHP Notice: Only variables should be passed by reference in /var/www/html/ojs-3.1.0-1/lib/pkp/lib/adodb/adodb-xmlschema.inc.php on line 267
PHP Notice: Only variables should be passed by reference in /var/www/html/ojs-3.1.0-1/lib/pkp/lib/adodb/adodb-xmlschema.inc.php on line 267
PHP Notice: Only variables should be passed by reference in /var/www/html/ojs-3.1.0-1/lib/pkp/lib/adodb/adodb-xmlschema.inc.php on line 267
PHP Notice: Only variables should be passed by reference in /var/www/html/ojs-3.1.0-1/lib/pkp/lib/adodb/adodb-xmlschema.inc.php on line 267
PHP Notice: Only variables should be passed by reference in /var/www/html/ojs-3.1.0-1/lib/pkp/lib/adodb/adodb-xmlschema.inc.php on line 267
PHP Notice: Only variables should be passed by reference in /var/www/html/ojs-3.1.0-1/lib/pkp/lib/adodb/adodb-xmlschema.inc.php on line 267
PHP Notice: Only variables should be passed by reference in /var/www/html/ojs-3.1.0-1/lib/pkp/lib/adodb/adodb-xmlschema.inc.php on line 267
PHP Notice: Only variables should be passed by reference in /var/www/html/ojs-3.1.0-1/lib/pkp/lib/adodb/adodb-xmlschema.inc.php on line 267
PHP Notice: Only variables should be passed by reference in /var/www/html/ojs-3.1.0-1/lib/pkp/lib/adodb/adodb-xmlschema.inc.php on line 267
PHP Notice: Only variables should be passed by reference in /var/www/html/ojs-3.1.0-1/lib/pkp/lib/adodb/adodb-xmlschema.inc.php on line 267
PHP Notice: Only variables should be passed by reference in /var/www/html/ojs-3.1.0-1/lib/pkp/lib/adodb/adodb-xmlschema.inc.php on line 267
ERROR: Installation failed: DB: Specified key was too long; max key length is 767 bytes

Hi @russlhuizing,

This is a MySQL error message. See e.g. this Stackoverflow thread, which suggests a few possible solutions…

  • Upgrade your MySQL to 5.7 or later
  • Convert your database over to the MyISAM storage engine

Alternately, you could experiment with shrinking down some of your database columns, but I wouldn’t recommend this.

Regards,
Alec Smecher
Public Knowledge Project Team

I’m using MariaDB…will that not work?

Hi @russlhuizing,

Yes, MariaDB is fine. The same version requirements should apply.

Regards,
Alec Smecher
Public Knowledge Project Team

My Server version says it is 10.1.23-MariaDB-9+deb9u1 Raspbian 9.0. Is that compatible to MYSQL 5.7 or later?

Hi @russlhuizing,

According to this thread, upgrading to MariaDB 10.2 resolves the issue.

Regards,
Alec Smecher
Public Knowledge Project Team

Thanks! Got it working finally. So grateful for your help!!

Hello! Just didn’t want to make a new topic and this thread seems fresh. I’m trying the latest OJS 3.1.0-1.
I’m receiving Parse error: syntax error, unexpected T_FUNCTION, expecting ‘)’ in /lib/pkp/includes/functions.inc.php on line 319
when trying to start the installation. I unpacked, changed the rights of the folders specified to 0775, and entered the basic site url into web browser. Did I miss something? I’m using general web hosting, so not sure what type of php they are running at the moment, but can ask to change to version needed if that is the issue.
Any thoughts where to dig?

Hi @vanushkin,

Your PHP is probably too old; check docs/README for minimum requirements.

Regards,
Alec Smecher
Public Knowledge Project Team

Thank you for your lightning reply! Yes, I switched PHP version to 5.6 and everything worked fine.