OJS3: install don`t want to start

After unpacking archive to /var/www/html installation process don not want to start.
My system:
Ubuntu 16
php7
latest mysql
latest stable apache release
physical access to server.

Tested with standard hello.php - all works fine.

Would be appreciate for help.

1 Like

I think it will not work with php 7. Try changing for 5.3

1 Like

I was hoping, it wouldn`t be necessary…

1 Like

I think OJS 3.0 is intended to be PHP7-ready.

Ensure your config.inc.php is using mysqli and not mysql as the database driver, and post any relevant messages you see in your webserver’s error log.

1 Like

If OJS3 supports PHP7 it will be great!

Checked config.inc.php and changed mysql to mysqli - nothing have happened.
now I have this line:

driver = mysqli

From apache logs I see this 2 errors:

[Fri Sep 02 23:43:12.557791 2016] [:error] [pid 2769] [client 127.0.0.1:36564] PHP Notice: Only variables should be passed by reference in /var/www/html/lib/pkp/classes/core/PKPApplication.inc.php on line 210

[Fri Sep 02 23:43:12.645519 2016] [:error] [pid 2769] [client 127.0.0.1:36564] PHP Fatal error: Uncaught Error: Call to undefined function xml_parser_create() in /var/www/html/lib/pkp/classes/xml/XMLParser.inc.php:271\nStack trace:\n#0 /var/www/html/lib/pkp/classes/xml/XMLParser.inc.php(220): XMLParser->createParser()\n#1 /var/www/html/lib/pkp/classes/xml/XMLParser.inc.php(262): XMLParser->parseTextStruct(’<?xml version="…’, Array)\n#2 /var/www/html/lib/pkp/classes/db/XMLDAO.inc.php(60): XMLParser->parseStruct(‘lib/pkp/registr…’, Array)\n#3 /var/www/html/lib/pkp/classes/i18n/TimeZoneDAO.inc.php(57): XMLDAO->parseStruct(‘lib/pkp/registr…’, Array)\n#4 /var/www/html/lib/pkp/classes/cache/GenericCache.inc.php(63): TimeZoneDAO->_timeZoneCacheMiss(Object(FileCache), NULL)\n#5 /var/www/html/lib/pkp/classes/cache/FileCache.inc.php(114): GenericCache->get(NULL)\n#6 /var/www/html/lib/pkp/classes/i18n/TimeZoneDAO.inc.php(76): FileCache->getContents()\n#7 /var/www/html/lib/pkp/classes/i18n/PKPLocale.inc.php(691): TimeZoneDAO->getTimeZones()\n#8 /var/www/html/lib/pkp/classes/i18n/PKPLocale.inc.php(143): PKPLocale::getTi in /var/www/html/lib/pkp/classes/xml/XMLParser.inc.php on line 271

Don`t have much experience in running own apache server with php module. Only tried before to run java webapps from tomcat through apache with mod-js connector and all worked fine. Maybe I simply forgot to configure some php-apache-related files?

Also from error log I see problems (inter alia) with some TimeZone variables. I have US locale on my Ubuntu, but all necessary php files I downloaded from ip (and repositories) from other country. We have different time format here…

1 Like

Hi @Vitaliy,

XML parsing support seems to be missing from your PHP installation. See e.g. https://www.drupal.org/node/66823 for details. You may need to install a PHP XML module, or if you’ve compiled your own PHP, you may need to recompile it with XML support configured.

Regards,
Alec Smecher
Public Knowledge Project Team

Many Thanks!
The problem really was in xml parser.

Now on installation start I have a bunch of PHP warnings. They looking like this:

    [Sat Sep 03 09:24:17.056984 2016] [:error] [pid 8472] [client 127.0.0.1:46262] PHP Notice:  Only variables should be passed by reference in /var/www/html/lib/pkp/classes/core/PKPApplication.inc.php on line 210, referer: http://localhost/index.php/index/install
    [Sat Sep 03 09:24:17.058428 2016] [:error] [pid 8472] [client 127.0.0.1:46262] PHP Warning:  Declaration of OrcidProfilePlugin::getTemplatePath() should be compatible with Plugin::getTemplatePath($inCore = false) in /var/www/html/plugins/generic/orcidProfile/OrcidProfilePlugin.inc.php on line 0, referer: http://localhost/index.php/index/install
    [Sat Sep 03 09:24:17.058495 2016] [:error] [pid 8472] [client 127.0.0.1:46262] PHP Warning:  Declaration of GoogleAnalyticsPlugin::getTemplatePath() should be compatible with Plugin::getTemplatePath($inCore = false) in /var/www/html/plugins/generic/googleAnalytics/GoogleAnalyticsPlugin.inc.php on line 0, referer: http://localhost/index.php/index/install
    [Sat Sep 03 09:24:17.058645 2016] [:error] [pid 8472] [client 127.0.0.1:46262] PHP Warning:  Declaration of PdfJsViewerPlugin::getTemplatePath() should be compatible with Plugin::getTemplatePath($inCore = false) in /var/www/html/plugins/generic/pdfJsViewer/PdfJsViewerPlugin.inc.php on line 0, referer: http://localhost/index.php/index/install
    [Sat Sep 03 09:24:17.058677 2016] [:error] [pid 8472] [client 127.0.0.1:46262] PHP Warning:  Declaration of WebFeedPlugin::getTemplatePath() should be compatible with Plugin::getTemplatePath($inCore = false) in /var/www/html/plugins/generic/webFeed/WebFeedPlugin.inc.php on line 0, referer: http://localhost/index.php/index/install
    [Sat Sep 03 09:24:17.058754 2016] [:error] [pid 8472] [client 127.0.0.1:46262] PHP Warning:  Declaration of BrowsePlugin::manage($verb, $args, &$message, &$messageParams, &$pluginModalContent = NULL) should be compatible with Plugin::manage($args, $request) in /var/www/html/plugins/generic/browse/BrowsePlugin.inc.php on line 0, referer: http://localhost/index.php/index/install
    [Sat Sep 03 09:24:17.058765 2016] [:error] [pid 8472] [client 127.0.0.1:46262] PHP Warning:  Declaration of BrowsePlugin::getTemplatePath() should be compatible with Plugin::getTemplatePath($inCore = false) in /var/www/html/plugins/generic/browse/BrowsePlugin.inc.php on line 0, referer: http://localhost/index.php/index/install
    [Sat Sep 03 09:24:17.058791 2016] [:error] [pid 8472] [client 127.0.0.1:46262] PHP Warning:  Declaration of LensGalleyPlugin::getTemplatePath() should be compatible with Plugin::getTemplatePath($inCore = false) in /var/www/html/plugins/generic/lensGalley/LensGalleyPlugin.inc.php on line 0, referer: http://localhost/index.php/index/install
    [Sat Sep 03 09:24:17.058818 2016] [:error] [pid 8472] [client 127.0.0.1:46262] PHP Warning:  Declaration of RecommendByAuthorPlugin::getTemplatePath() should be compatible with Plugin::getTemplatePath($inCore = false) in /var/www/html/plugins/generic/recommendByAuthor/RecommendByAuthorPlugin.inc.php on line 0, referer: http://localhost/index.php/index/install
    [Sat Sep 03 09:24:17.059432 2016] [:error] [pid 8472] [client 127.0.0.1:46262] PHP Warning:  Declaration of PageHandler::authorize($request, &$args, $roleAssignments) should be compatible with PKPHandler::authorize($request, &$args, $roleAssignments, $enforceRestrictedSite = true) in /var/www/html/lib/pkp/controllers/page/PageHandler.inc.php on line 19, referer: http://localhost/index.php/index/install
    [Sat Sep 03 09:24:17.060538 2016] [:error] [pid 8472] [client 127.0.0.1:46262] PHP Warning:  Declaration of LanguageToggleBlockPlugin::getContents(&$templateMgr, $request = NULL) should be compatible with BlockPlugin::getContents($templateMgr, $request = NULL) in /var/www/html/plugins/blocks/languageToggle/LanguageToggleBlockPlugin.inc.php on line 0, referer: http://localhost/index.php/index/install
    [Sat Sep 03 09:24:17.060620 2016] [:error] [pid 8472] [client 127.0.0.1:46262] PHP Warning:  Declaration of RelatedItemsBlockPlugin::getContents(&$templateMgr, $request = NULL) should be compatible with BlockPlugin::getContents($templateMgr, $request = NULL) in /var/www/html/plugins/blocks/relatedItems/RelatedItemsBlockPlugin.inc.php on line 0, referer: http://localhost/index.php/index/install
    [Sat Sep 03 09:24:17.060670 2016] [:error] [pid 8472] [client 127.0.0.1:46262] PHP Warning:  Declaration of InformationBlockPlugin::getContents(&$templateMgr, $request = NULL) should be compatible with BlockPlugin::getContents($templateMgr, $request = NULL) in /var/www/html/plugins/blocks/information/InformationBlockPlugin.inc.php on line 0, referer: http://localhost/index.php/index/install

Should/Could I do something with them before continuing?

Hi @Vitaliy,

Those warnings are harmless; just make sure they’re directed to the log file, rather than the browser. We’ll be working on these over the next few releases but they’re nothing to worry about.

Regards,
Alec Smecher
Public Knowledge Project Team

After starting installation OJS throws an error:

A database error has occured: An unknown database connection error has occured

Have checked database - all tables seems to be created. Tried manual and automatic database creation without effect (using mysqli).
And there is not any additional information in apache error log.

my php.ini has following lines:

error_reporting = E_ALL
display_errors = On
log_errors = On

extension=mysqli.so (just in case)

This error really confusing be because of normally created mysql tables.

1 Like

Hi @Vitaliy,

Can you turn on the show_stacktrace option in config.inc.php and post the results?

Regards,
Alec Smecher
Public Knowledge Project Team

Turned on show_stacktrace, but where I can find the results?
browser window, apache log and php log (which I settled apart from apache log) don`t show any additional information?

Just in case checked how OJS will install on my server with PHP 5.6.

Installation proceeded without any apparent problem. So this issue seems to be specific to PHP 7/mysqli

As I installed different PHP as separate apache modules I could change between them after installation.

After changing to PHP7 and mysqli site seems to function normally. Why had initial installation aborted each time after creating tables in database is riddle to me. Moreover logs from apache, php and mysql didnt tell anything. So unfortunately I cant help with debuging.

Maybe I am mistaken but on php7 site looks to operate faster.

Sorry for consuming your time :slight_smile:

Hi @Vitaliy,

Thanks for following up – I’ll be sure to double-check that PHP7 support works, at least on my machine, next week.

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like

Hi @asmecher,

Right now I am trying to install ojs3 in a Ubuntu 16.04 server (with PHP 7 and MySQL 5.6) and the same issue appears, it throws during installation:

A database error has occurred: An unknown database connection error has occurred

And there seems to be no information in logs, is a little difficult to look because there is a lot of Notices from ADOdb:

[Mon Sep 05 11:49:53.484405 2016] [:error] [pid 29761] [client 127.0.0.1:44862] PHP Notice: Only variables should be passed by reference in /home/cccaballero/trabajo/www/ojs-3.0.0/lib/pkp/lib/adodb/adodb-xmlschema.inc.php on line 268, referer: http://localhost/ojs-3.0.0/index.php/index/install/install
[Mon Sep 05 11:49:53.484426 2016] [:error] [pid 29761] [client 127.0.0.1:44862] PHP Stack trace:, referer: http://localhost/ojs-3.0.0/index.php/index/install/install
[Mon Sep 05 11:49:53.484431 2016] [:error] [pid 29761] [client 127.0.0.1:44862] PHP 1. {main}() /home/cccaballero/trabajo/www/ojs-3.0.0/index.php:0, referer: http://localhost/ojs-3.0.0/index.php/index/install/install
[Mon Sep 05 11:49:53.484436 2016] [:error] [pid 29761] [client 127.0.0.1:44862] PHP 2. PKPApplication->execute() /home/cccaballero/trabajo/www/ojs-3.0.0/index.php:68, referer: http://localhost/ojs-3.0.0/index.php/index/install/install
[Mon Sep 05 11:49:53.484439 2016] [:error] [pid 29761] [client 127.0.0.1:44862] PHP 3. Dispatcher->dispatch() /home/cccaballero/trabajo/www/ojs-3.0.0/lib/pkp/classes/core/PKPApplication.inc.php:227, referer: http://localhost/ojs-3.0.0/index.php/index/install/install
[Mon Sep 05 11:49:53.484442 2016] [:error] [pid 29761] [client 127.0.0.1:44862] PHP 4. PKPPageRouter->route() /home/cccaballero/trabajo/www/ojs-3.0.0/lib/pkp/classes/core/Dispatcher.inc.php:134, referer: http://localhost/ojs-3.0.0/index.php/index/install/install
[Mon Sep 05 11:49:53.484446 2016] [:error] [pid 29761] [client 127.0.0.1:44862] PHP 5. PKPRouter->_authorizeInitializeAndCallRequest() /home/cccaballero/trabajo/www/ojs-3.0.0/lib/pkp/classes/core/PKPPageRouter.inc.php:228, referer: http://localhost/ojs-3.0.0/index.php/index/install/install
[Mon Sep 05 11:49:53.484449 2016] [:error] [pid 29761] [client 127.0.0.1:44862] PHP 6. InstallHandler->install() /home/cccaballero/trabajo/www/ojs-3.0.0/lib/pkp/classes/core/PKPRouter.inc.php:372, referer: http://localhost/ojs-3.0.0/index.php/index/install/install
[Mon Sep 05 11:49:53.484452 2016] [:error] [pid 29761] [client 127.0.0.1:44862] PHP 7. InstallForm->execute() /home/cccaballero/trabajo/www/ojs-3.0.0/lib/pkp/pages/install/InstallHandler.inc.php:73, referer: http://localhost/ojs-3.0.0/index.php/index/install/install
[Mon Sep 05 11:49:53.484460 2016] [:error] [pid 29761] [client 127.0.0.1:44862] PHP 8. Installer->execute() /home/cccaballero/trabajo/www/ojs-3.0.0/lib/pkp/classes/install/form/InstallForm.inc.php:190, referer: http://localhost/ojs-3.0.0/index.php/index/install/install
[Mon Sep 05 11:49:53.484464 2016] [:error] [pid 29761] [client 127.0.0.1:44862] PHP 9. Installer->executeInstaller() /home/cccaballero/trabajo/www/ojs-3.0.0/lib/pkp/classes/install/Installer.inc.php:186, referer: http://localhost/ojs-3.0.0/index.php/index/install/install
[Mon Sep 05 11:49:53.484467 2016] [:error] [pid 29761] [client 127.0.0.1:44862] PHP 10. Installer->executeAction() /home/cccaballero/trabajo/www/ojs-3.0.0/lib/pkp/classes/install/Installer.inc.php:265, referer: http://localhost/ojs-3.0.0/index.php/index/install/install
[Mon Sep 05 11:49:53.484470 2016] [:error] [pid 29761] [client 127.0.0.1:44862] PHP 11. adoSchema->ParseSchema() /home/cccaballero/trabajo/www/ojs-3.0.0/lib/pkp/classes/install/Installer.inc.php:371, referer: http://localhost/ojs-3.0.0/index.php/index/install/install
[Mon Sep 05 11:49:53.484473 2016] [:error] [pid 29761] [client 127.0.0.1:44862] PHP 12. adoSchema->ParseSchemaString() /home/cccaballero/trabajo/www/ojs-3.0.0/lib/pkp/lib/adodb/adodb-xmlschema.inc.php:1419, referer: http://localhost/ojs-3.0.0/index.php/index/install/install
[Mon Sep 05 11:49:53.484475 2016] [:error] [pid 29761] [client 127.0.0.1:44862] PHP 13. xml_parse() /home/cccaballero/trabajo/www/ojs-3.0.0/lib/pkp/lib/adodb/adodb-xmlschema.inc.php:1506, referer: http://localhost/ojs-3.0.0/index.php/index/install/install
[Mon Sep 05 11:49:53.484478 2016] [:error] [pid 29761] [client 127.0.0.1:44862] PHP 14. dbTable->_tag_open() /home/cccaballero/trabajo/www/ojs-3.0.0/lib/pkp/lib/adodb/adodb-xmlschema.inc.php:1506, referer: http://localhost/ojs-3.0.0/index.php/index/install/install

1 Like

Hi @asmecher,

I just manually update ADOdb to the last version and now there is no so much trash in logs, the problem remains and now I can tell for sure that there is no error in logs, just some

Only variables should be passed by reference

Notices.

Will be good to update the OJS ADOdb version to fix all the trash from logs in php 7.

Greetings.

Hi @asmecher,

Same issue in a Ubuntu 14.04 server with php 5.5 and mysql 5.5

The problem is in the UserGroupDAO when he call $this->getInsertId() in the insertObject function, for some reason crash

And something strange is happening, because if I use:

var_dump($this->getInsertId());die; 

it prints the correct value, but if I use:

die($this->getInsertId());

is not printing anything.

I will take a look on this later.

Greetings.

Hi @cccaballero,

You might have to manually cast the value to a string before die will output what you expect; try prepending a string to it, e.g.:

 die('The insert ID is: ' . $this->getInsertId());

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

I don’t know why I was expecting a string (perhaps the few hours of sleep)…

Well the problem was the updateLocaleFields() function causing getInsertId() returns 0, and I see that you already fixed it in the master branch so, many thanks.

Greetings.

Hi @cccaballero,

Yup – we’re also maintaining an ojs-stable-3_0_0 branch, which will probably be turned into a 3.0.1 release once we’ve accumulated enough fixes like this. You might consider working from that instead of master. Thanks for your help in tracking this down!

Regards,
Alec Smecher
Public Knowledge Project Team