HTTP Error When Upload Files

Hi everyone, I installed ojs3.1.0.1 on my Ubuntu 16.04 with apache2 web server and php 7.0. The installation process run smoothly, but when I want to upload logo, pdf files (article text), or some files, I get Http Error warning. I have set file_dir, cache, and public directory with 755 permission with www-data user, but the problem still occur. I have also set max_upload_size to 10M, but it doesn’t help. This is the error log from webserver:

[Wed Jan 10 11:14:44.981759 2018] [:error] [pid 18654] [client 10.10.27.2:34154] PHP Warning: Declaration of ContextGridHandler::loadData($request) should be compatible with GridHandler::loadData($request, $filter) in /var/www/ojs/lib/pkp/controllers/grid/admin/context/ContextGridHandler.inc.php on line 0, referer: http://ojs.stkipmktb.ac.id/index.php/index/admin/contexts
[Wed Jan 10 11:14:44.984797 2018] [:error] [pid 18654] [client 10.10.27.2:34154] PHP Warning: Declaration of ContextSiteSettingsForm::fetch($request) should be compatible with Form::fetch($request, $template = NULL, $display = false) in /var/www/ojs/lib/pkp/controllers/grid/admin/context/form/ContextSiteSettingsForm.inc.php on line 19, referer: http://ojs.stkipmktb.ac.id/index.php/index/admin/contexts
[Wed Jan 10 11:14:51.142247 2018] [:error] [pid 18654] [client 10.10.27.2:36852] PHP Warning: Declaration of ContextGridHandler::loadData($request) should be compatible with GridHandler::loadData($request, $filter) in /var/www/ojs/lib/pkp/controllers/grid/admin/context/ContextGridHandler.inc.php on line 0, referer: http://ojs.stkipmktb.ac.id/index.php/index/admin/contexts
[Wed Jan 10 11:14:51.142872 2018] [:error] [pid 18654] [client 10.10.27.2:36852] PHP Warning: Declaration of ContextSiteSettingsForm::fetch($request) should be compatible with Form::fetch($request, $template = NULL, $display = false) in /var/www/ojs/lib/pkp/controllers/grid/admin/context/form/ContextSiteSettingsForm.inc.php on line 19, referer: http://ojs.stkipmktb.ac.id/index.php/index/admin/contexts
[Wed Jan 10 11:14:53.235804 2018] [:error] [pid 18659] [client 10.10.27.2:37730] PHP Warning: Declaration of ContextGridHandler::loadData($request) should be compatible with GridHandler::loadData($request, $filter) in /var/www/ojs/lib/pkp/controllers/grid/admin/context/ContextGridHandler.inc.php on line 0, referer: http://ojs.stkipmktb.ac.id/index.php/index/admin/contexts
[Wed Jan 10 11:14:53.236232 2018] [:error] [pid 18659] [client 10.10.27.2:37730] PHP Warning: Declaration of ContextSiteSettingsForm::fetch($request) should be compatible with Form::fetch($request, $template = NULL, $display = false) in /var/www/ojs/lib/pkp/controllers/grid/admin/context/form/ContextSiteSettingsForm.inc.php on line 19, referer: http://ojs.stkipmktb.ac.id/index.php/index/admin/contexts
[Wed Jan 10 11:15:15.442216 2018] [:error] [pid 18660] [client 10.10.27.2:57088] PHP Warning: Declaration of ContextGridHandler::loadData($request) should be compatible with GridHandler::loadData($request, $filter) in /var/www/ojs/lib/pkp/controllers/grid/admin/context/ContextGridHandler.inc.php on line 0, referer: http://ojs.stkipmktb.ac.id/index.php/index/admin/contexts
[Wed Jan 10 11:15:15.442932 2018] [:error] [pid 18660] [client 10.10.27.2:57088] PHP Warning: Declaration of ContextSiteSettingsForm::fetch($request) should be compatible with Form::fetch($request, $template = NULL, $display = false) in /var/www/ojs/lib/pkp/controllers/grid/admin/context/form/ContextSiteSettingsForm.inc.php on line 19, referer: http://ojs.stkipmktb.ac.id/index.php/index/admin/contexts
[Wed Jan 10 11:15:17.545293 2018] [:error] [pid 18660] [client 10.10.27.2:57088] PHP Warning: mkdir(): File exists in /var/www/ojs/lib/pkp/classes/file/FileManager.inc.php on line 288, referer: http://ojs.stkipmktb.ac.id/index.php/index/admin/contexts
[Wed Jan 10 11:15:19.417153 2018] [:error] [pid 18658] [client 10.10.27.2:33310] PHP Warning: Declaration of ContextGridHandler::loadData($request) should be compatible with GridHandler::loadData($request, $filter) in /var/www/ojs/lib/pkp/controllers/grid/admin/context/ContextGridHandler.inc.php on line 0, referer: http://ojs.stkipmktb.ac.id/index.php/elsa/admin/contexts?openWizard=1
[Wed Jan 10 11:15:19.419935 2018] [:error] [pid 18658] [client 10.10.27.2:33310] PHP Warning: Declaration of ContextSiteSettingsForm::fetch($request) should be compatible with Form::fetch($request, $template = NULL, $display = false) in /var/www/ojs/lib/pkp/controllers/grid/admin/context/form/ContextSiteSettingsForm.inc.php on line 19, referer: http://ojs.stkipmktb.ac.id/index.php/elsa/admin/contexts?openWizard=1
[Wed Jan 10 11:15:19.637121 2018] [:error] [pid 18659] [client 10.10.27.2:33426] PHP Warning: Declaration of InstallHandler::validate($request) should be compatible with PKPHandler::validate($requiredContexts = NULL, $request = NULL) in /var/www/ojs/lib/pkp/pages/install/InstallHandler.inc.php on line 0
[Wed Jan 10 11:15:19.809040 2018] [:error] [pid 18654] [client 10.10.27.2:33500] PHP Warning: Declaration of ContextSettingsForm::fetch($request, $params = NULL) should be compatible with Form::fetch($request, $template = NULL, $display = false) in /var/www/ojs/lib/pkp/classes/controllers/tab/settings/form/ContextSettingsForm.inc.php on line 20, referer: http://ojs.stkipmktb.ac.id/index.php/elsa/admin/contexts?openWizard=1
[Wed Jan 10 11:15:19.809078 2018] [:error] [pid 18654] [client 10.10.27.2:33500] PHP Warning: Declaration of ContextSettingsForm::initData($request) should be compatible with Form::initData() in /var/www/ojs/lib/pkp/classes/controllers/tab/settings/form/ContextSettingsForm.inc.php on line 20, referer: http://ojs.stkipmktb.ac.id/index.php/elsa/admin/contexts?openWizard=1
[Wed Jan 10 11:15:19.809092 2018] [:error] [pid 18654] [client 10.10.27.2:33500] PHP Warning: Declaration of ContextSettingsForm::readInputData($request) should be compatible with Form::readInputData() in /var/www/ojs/lib/pkp/classes/controllers/tab/settings/form/ContextSettingsForm.inc.php on line 20, referer: http://ojs.stkipmktb.ac.id/index.php/elsa/admin/contexts?openWizard=1
[Wed Jan 10 11:15:19.809105 2018] [:error] [pid 18654] [client 10.10.27.2:33500] PHP Warning: Declaration of ContextSettingsForm::execute($request) should be compatible with Form::execute() in /var/www/ojs/lib/pkp/classes/controllers/tab/settings/form/ContextSettingsForm.inc.php on line 20, referer: http://ojs.stkipmktb.ac.id/index.php/elsa/admin/contexts?openWizard=1
[Wed Jan 10 11:15:25.440447 2018] [:error] [pid 18658] [client 10.10.27.2:45644] PHP Warning: Declaration of ContextSettingsForm::fetch($request, $params = NULL) should be compatible with Form::fetch($request, $template = NULL, $display = false) in /var/www/ojs/lib/pkp/classes/controllers/tab/settings/form/ContextSettingsForm.inc.php on line 20, referer: http://ojs.stkipmktb.ac.id/index.php/elsa/admin/contexts?openWizard=1
[Wed Jan 10 11:15:25.440500 2018] [:error] [pid 18658] [client 10.10.27.2:45644] PHP Warning: Declaration of ContextSettingsForm::initData($request) should be compatible with Form::initData() in /var/www/ojs/lib/pkp/classes/controllers/tab/settings/form/ContextSettingsForm.inc.php on line 20, referer: http://ojs.stkipmktb.ac.id/index.php/elsa/admin/contexts?openWizard=1
[Wed Jan 10 11:15:25.440515 2018] [:error] [pid 18658] [client 10.10.27.2:45644] PHP Warning: Declaration of ContextSettingsForm::readInputData($request) should be compatible with Form::readInputData() in /var/www/ojs/lib/pkp/classes/controllers/tab/settings/form/ContextSettingsForm.inc.php on line 20, referer: http://ojs.stkipmktb.ac.id/index.php/elsa/admin/contexts?openWizard=1
[Wed Jan 10 11:15:25.440528 2018] [:error] [pid 18658] [client 10.10.27.2:45644] PHP Warning: Declaration of ContextSettingsForm::execute($request) should be compatible with Form::execute() in /var/www/ojs/lib/pkp/classes/controllers/tab/settings/form/ContextSettingsForm.inc.php on line 20, referer: http://ojs.stkipmktb.ac.id/index.php/elsa/admin/contexts?openWizard=1
[Wed Jan 10 11:15:26.631659 2018] [:error] [pid 18660] [client 10.10.27.2:46222] PHP Warning: Declaration of ContextSettingsForm::fetch($request, $params = NULL) should be compatible with Form::fetch($request, $template = NULL, $display = false) in /var/www/ojs/lib/pkp/classes/controllers/tab/settings/form/ContextSettingsForm.inc.php on line 20, referer: http://ojs.stkipmktb.ac.id/index.php/elsa/admin/contexts?openWizard=1
[Wed Jan 10 11:15:26.631709 2018] [:error] [pid 18660] [client 10.10.27.2:46222] PHP Warning: Declaration of ContextSettingsForm::initData($request) should be compatible with Form::initData() in /var/www/ojs/lib/pkp/classes/controllers/tab/settings/form/ContextSettingsForm.inc.php on line 20, referer: http://ojs.stkipmktb.ac.id/index.php/elsa/admin/contexts?openWizard=1
[Wed Jan 10 11:15:26.631736 2018] [:error] [pid 18660] [client 10.10.27.2:46222] PHP Warning: Declaration of ContextSettingsForm::readInputData($request) should be compatible with Form::readInputData() in /var/www/ojs/lib/pkp/classes/controllers/tab/settings/form/ContextSettingsForm.inc.php on line 20, referer: http://ojs.stkipmktb.ac.id/index.php/elsa/admin/contexts?openWizard=1
[Wed Jan 10 11:15:26.631749 2018] [:error] [pid 18660] [client 10.10.27.2:46222] PHP Warning: Declaration of ContextSettingsForm::execute($request) should be compatible with Form::execute() in /var/www/ojs/lib/pkp/classes/controllers/tab/settings/form/ContextSettingsForm.inc.php on line 20, referer: http://ojs.stkipmktb.ac.id/index.php/elsa/admin/contexts?openWizard=1
[Wed Jan 10 11:15:26.631772 2018] [:error] [pid 18660] [client 10.10.27.2:46222] PHP Warning: Declaration of PKPAppearanceForm::fetch($request) should be compatible with ContextSettingsForm::fetch($request, $params = NULL) in /var/www/ojs/lib/pkp/controllers/tab/settings/appearance/form/PKPAppearanceForm.inc.php on line 18, referer: http://ojs.stkipmktb.ac.id/index.php/elsa/admin/contexts?openWizard=1
[Wed Jan 10 11:15:27.164658 2018] [:error] [pid 18658] [client 10.10.27.2:46448] PHP Warning: Declaration of BlockPluginsListbuilderHandler::initialize($request) should be compatible with MultipleListsListbuilderHandler::initialize($request, $args = NULL) in /var/www/ojs/lib/pkp/controllers/listbuilder/settings/BlockPluginsListbuilderHandler.inc.php on line 17, referer: http://ojs.stkipmktb.ac.id/index.php/elsa/admin/contexts?openWizard=1
[Wed Jan 10 11:15:27.929332 2018] [:error] [pid 18654] [client 10.10.27.2:46818] PHP Warning: Declaration of SettingsFileUploadForm::fetch($request, $params = NULL) should be compatible with Form::fetch($request, $template = NULL, $display = false) in /var/www/ojs/lib/pkp/controllers/tab/settings/form/SettingsFileUploadForm.inc.php on line 18, referer: http://ojs.stkipmktb.ac.id/index.php/elsa/admin/contexts?openWizard=1
[Wed Jan 10 11:15:27.929387 2018] [:error] [pid 18654] [client 10.10.27.2:46818] PHP Warning: Declaration of NewContextImageFileForm::fetch($request) should be compatible with SettingsFileUploadForm::fetch($request, $params = NULL) in /var/www/ojs/lib/pkp/controllers/tab/settings/appearance/form/NewContextImageFileForm.inc.php on line 18, referer: http://ojs.stkipmktb.ac.id/index.php/elsa/admin/contexts?openWizard=1
[Wed Jan 10 11:15:27.929404 2018] [:error] [pid 18654] [client 10.10.27.2:46818] PHP Warning: Declaration of NewContextImageFileForm::initData($request) should be compatible with Form::initData() in /var/www/ojs/lib/pkp/controllers/tab/settings/appearance/form/NewContextImageFileForm.inc.php on line 18, referer: http://ojs.stkipmktb.ac.id/index.php/elsa/admin/contexts?openWizard=1
[Wed Jan 10 11:15:27.929418 2018] [:error] [pid 18654] [client 10.10.27.2:46818] PHP Warning: Declaration of NewContextImageFileForm::execute($request) should be compatible with Form::execute() in /var/www/ojs/lib/pkp/controllers/tab/settings/appearance/form/NewContextImageFileForm.inc.php on line 18, referer: http://ojs.stkipmktb.ac.id/index.php/elsa/admin/contexts?openWizard=1

I suggest you try some simple php upload script and see if you can upload files using that. If not, then the problem is in folder permissions. If you can, the problem is in OJS. The errors in your list are just warnings and should not affect this.

This is the first example I found: Simple file upload in php · GitHub

How to do it?
Just upload upload.php file to the public_html?

yeah, and the call the script using a webbrowser. Of course you need to edit the path there: Simple file upload in php · GitHub and user for example cache.

The idea of my advice above is to isolate OJS from the upload problem by testing the folder permissions with something simpler.

And of course you should remove the script after testing.

1 Like

Allow me to make it clear what should I do

  1. I edit the Simple file upload in php · GitHub. Sorry, I got no idea what path and user should I use
  2. I upload to pubic_html
  3. I call the script via the browser. How do I call it?
  4. Regarding to quoted below, do I need to try upload file in galley?
  1. The result got, then I deleted the script