Showing Slim Application Error - during uploading file

Please help me. when I trying to upload a file from submission system then it is showing Slim Application Error. The config.inc.PHP file details are given below:

;;;;;;;;;;;;;;;;;;;;;;;;;
; Localization Settings ;
;;;;;;;;;;;;;;;;;;;;;;;;;

[i18n]

; Default locale
locale = en_US

; Client output/input character set
client_charset = utf-8

; Database connection character set
; Must be set to “Off” if not supported by the database server
; If enabled, must be the same character set as “client_charset”
; (although the actual name may differ slightly depending on the server)
connection_charset = utf8

; Database storage character set
; Must be set to “Off” if not supported by the database server
database_charset = utf8

; Enable character normalization to utf-8 (recommended)
; If disabled, strings will be passed through in their native encoding
; Note that client_charset and database collation must be set
; to “utf-8” for this to work, as characters are stored in utf-8
charset_normalization = Off

Please help. I am getting Slim error during submission of articles.

Here is error logs:
[Tue Jul 11 04:29:49.672295 2023] [autoindex:error] [pid 21392] [client 20.237.231.59:0] AH01276: Cannot serve directory /home/beiesp/public_html/.well-known/: No matching DirectoryIndex (index.php,index.php8,index.php7,index.php5,index.perl,index.pl,index.plx,index.ppl,index.cgi,index.jsp,index.jp,index.phtml,index.shtml,index.xhtml,index.html,index.htm,index.js) found, and server-generated directory index forbidden by Options directive, referer: binance.com

Hi @latticescipub

Could you please have a look into this thread to check whether it might have a solution for your issue?

Best,
Israel

Dear Israel,
Thanks for your reply. I hope you are well and healthy.
It is already verified and checked. Still, I am getting error.

Hi @latticescipub,

That is a dangerous configuration! Your files directory should not be inside your web root. See the note on that configuration option.

Regards,
Alec Smecher
Public Knowledge Project Team

Thanks Alec Smecher,
Thanks for writing to us. I hope that you are well and healthy.
Can you please guide me for it Please.
Dr. Shiv Kumar

Dear Alec Smecher,
Now I have moved it outside of the web root but still getting same slim application error during files upload. Please help and guide.


;;;;;;;;;;;;;;;;;;;;;;;;;
; Localization Settings ;
;;;;;;;;;;;;;;;;;;;;;;;;;

[i18n]

; Default locale
locale = en_US

; Client output/input character set
client_charset = utf-8

; Database connection character set
; Must be set to “Off” if not supported by the database server
; If enabled, must be the same character set as “client_charset”
; (although the actual name may differ slightly depending on the server)
connection_charset = utf8

; Database storage character set
; Must be set to “Off” if not supported by the database server
database_charset = utf8

; Enable character normalization to utf-8 (recommended)
; If disabled, strings will be passed through in their native encoding
; Note that client_charset and database collation must be set
; to “utf-8” for this to work, as characters are stored in utf-8
charset_normalization = Off

;;;;;;;;;;;;;;;;;
; File Settings ;
;;;;;;;;;;;;;;;;;

[files]

; Complete path to directory to store uploaded files
; (This directory should not be directly web-accessible)
; Windows users should use forward slashes
files_dir = “/home/ijese/files”

; Path to the directory to store public uploaded files
; (This directory should be web-accessible and the specified path
; should be relative to the base OJS directory)
; Windows users should use forward slashes
public_files_dir = public

; The maximum allowed size in kilobytes of each user’s public files
; directory. This is where user’s can upload images through the
; tinymce editor to their bio. Editors can upload images for
; some of the settings.
; Set this to 0 to disallow such uploads.
public_user_dir_size = 5000

; Permissions mask for created files and directories
umask = 0022

; The minimum percentage similarity between filenames that should be considered
; a possible revision
filename_revision_match = 70

pl help for solution

The files directory is outside of the web root and rewritable (777) permitted. Also files sub directory usageStats is rewritable (777) permitted.



It may also be related to ClamAV, if you have installed/enabled this plugin. See Slim Application Error when uploading a file in submission page OJS 3.3.0.10

Hi @latticescipub,

I suspect the path you’re using is still not writable by PHP. You might also have to consider the permissions in parent directories. The details will depend on your server, so unfortunately it’s hard for us to give specific directions. You might check a few other posts on the forum:

Some of those posts suggest putting a PHP test script to check file permissions on your server, outside of OJS. This is probably the best way to confirm whether or not your file permissions are set to permit PHP to work with the directory you’ve created.

Note that 777 permissions are never safe to use, so be careful not to leave them that way.

Regards,
Alec Smecher
Public Knowledge Project Team

Thanks, ClamAV is already uninstalled.

Dear Alec Smecher,
Thanks and appreciate for your prompt reply.
As per your suggestion, my files folder and others are already set re-writable as per the Linux terminal command.


But still, my problem is the same and did not resolve.I am using Linux CentOS.
Please help me to resolve this problem. Have to add any PhP code in which file?. Please

Still Slim Error problem did not resolve. Please help
Type: Error
Message: Class "finfo" not found
File: /home/beiesp/public_html/journals.blueeyesintelligence.org/lib/pkp/lib/vendor/league/mime-type-detection/src/FinfoMimeTypeDetector.php
Line: 48
Trace: #0 /home/beiesp/public_html/journals.blueeyesintelligence.org/lib/pkp/lib/vendor/league/flysystem/src/Local/LocalFilesystemAdapter.php(83): League\MimeTypeDetection\FinfoMimeTypeDetector->__construct()
#1 /home/beiesp/public_html/journals.blueeyesintelligence.org/lib/pkp/classes/services/PKPFileService.php(53): League\Flysystem\Local\LocalFilesystemAdapter->__construct(‘/home/beiesp/fi…’, Object(League\Flysystem\UnixVisibility\PortableVisibilityConverter), 2, 2)
#2 /home/beiesp/public_html/journals.blueeyesintelligence.org/classes/services/OJSServiceProvider.php(37): PKP\services\PKPFileService->__construct()
#3 /home/beiesp/public_html/journals.blueeyesintelligence.org/lib/pkp/lib/vendor/pimple/pimple/src/Pimple/Container.php(122): APP\services\OJSServiceProvider->APP\services{closure}(Object(Pimple\Container))
#4 /home/beiesp/public_html/journals.blueeyesintelligence.org/lib/pkp/classes/core/PKPServices.php(84): Pimple\Container->offsetGet(‘file’)
#5 /home/beiesp/public_html/journals.blueeyesintelligence.org/lib/pkp/classes/core/PKPServices.php(60): PKP\core\PKPServices->_getFromContainer(‘file’)
#6 /home/beiesp/public_html/journals.blueeyesintelligence.org/lib/pkp/api/v1/submissions/PKPSubmissionFileHandler.php(287): PKP\core\PKPServices::get(‘file’)
#7 [internal function]: PKP\API\v1\submissions\PKPSubmissionFileHandler->add(Object(Slim\Http\Request), Object(PKP\core\APIResponse), Array)
#8 /home/beiesp/public_html/journals.blueeyesintelligence.org/lib/pkp/lib/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponse.php(40): call_user_func(Array, Object(Slim\Http\Request), Object(PKP\core\APIResponse), Array)
#9 /home/beiesp/public_html/journals.blueeyesintelligence.org/lib/pkp/lib/vendor/slim/slim/Slim/Route.php(281): Slim\Handlers\Strategies\RequestResponse->__invoke(Array, Object(Slim\Http\Request), Object(PKP\core\APIResponse), Array)
#10 /home/beiesp/public_html/journals.blueeyesintelligence.org/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\Route->__invoke(Object(Slim\Http\Request), Object(PKP\core\APIResponse))
#11 /home/beiesp/public_html/journals.blueeyesintelligence.org/lib/pkp/lib/vendor/slim/slim/Slim/Route.php(268): Slim\Route->callMiddlewareStack(Object(Slim\Http\Request), Object(PKP\core\APIResponse))
#12 /home/beiesp/public_html/journals.blueeyesintelligence.org/lib/pkp/lib/vendor/slim/slim/Slim/App.php(503): Slim\Route->run(Object(Slim\Http\Request), Object(PKP\core\APIResponse))
#13 /home/beiesp/public_html/journals.blueeyesintelligence.org/lib/pkp/classes/security/authorization/internal/ApiAuthorizationMiddleware.php(90): Slim\App->__invoke(Object(Slim\Http\Request), Object(PKP\core\APIResponse))
#14 [internal function]: PKP\security\authorization\internal\ApiAuthorizationMiddleware->__invoke(Object(Slim\Http\Request), Object(PKP\core\APIResponse), Object(Slim\App))
#15 /home/beiesp/public_html/journals.blueeyesintelligence.org/lib/pkp/lib/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Object(PKP\security\authorization\internal\ApiAuthorizationMiddleware), Array)
#16 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(PKP\core\APIResponse), Object(Slim\App))
#17 /home/beiesp/public_html/journals.blueeyesintelligence.org/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(PKP\core\APIResponse), Object(Slim\App))
#18 /home/beiesp/public_html/journals.blueeyesintelligence.org/lib/pkp/classes/security/authorization/internal/ApiCsrfMiddleware.php(56): Slim\App->Slim{closure}(Object(Slim\Http\Request), Object(PKP\core\APIResponse))
#19 [internal function]: PKP\security\authorization\internal\ApiCsrfMiddleware->__invoke(Object(Slim\Http\Request), Object(PKP\core\APIResponse), Object(Closure))
#20 /home/beiesp/public_html/journals.blueeyesintelligence.org/lib/pkp/lib/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Object(PKP\security\authorization\internal\ApiCsrfMiddleware), Array)
#21 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(PKP\core\APIResponse), Object(Closure))
#22 /home/beiesp/public_html/journals.blueeyesintelligence.org/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(PKP\core\APIResponse), Object(Closure))
#23 /home/beiesp/public_html/journals.blueeyesintelligence.org/lib/pkp/classes/security/authorization/internal/ApiTokenDecodingMiddleware.php(140): Slim\App->Slim{closure}(Object(Slim\Http\Request), Object(PKP\core\APIResponse))
#24 [internal function]: PKP\security\authorization\internal\ApiTokenDecodingMiddleware->__invoke(Object(Slim\Http\Request), Object(PKP\core\APIResponse), Object(Closure))
#25 /home/beiesp/public_html/journals.blueeyesintelligence.org/lib/pkp/lib/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Object(PKP\security\authorization\internal\ApiTokenDecodingMiddleware), Array)
#26 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(PKP\core\APIResponse), Object(Closure))
#27 /home/beiesp/public_html/journals.blueeyesintelligence.org/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(PKP\core\APIResponse), Object(Closure))
#28 /home/beiesp/public_html/journals.blueeyesintelligence.org/lib/pkp/classes/handler/APIHandler.php(83): Slim\App->Slim{closure}(Object(Slim\Http\Request), Object(PKP\core\APIResponse))
#29 [internal function]: PKP\handler\APIHandler->PKP\handler{closure}(Object(Slim\Http\Request), Object(PKP\core\APIResponse), Object(Closure))
#30 /home/beiesp/public_html/journals.blueeyesintelligence.org/lib/pkp/lib/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Object(Closure), Array)
#31 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(PKP\core\APIResponse), Object(Closure))
#32 /home/beiesp/public_html/journals.blueeyesintelligence.org/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(PKP\core\APIResponse), Object(Closure))
#33 /home/beiesp/public_html/journals.blueeyesintelligence.org/lib/pkp/classes/handler/APIHandler.php(100): Slim\App->Slim{closure}(Object(Slim\Http\Request), Object(PKP\core\APIResponse))
#34 [internal function]: PKP\handler\APIHandler->PKP\handler{closure}(Object(Slim\Http\Request), Object(PKP\core\APIResponse), Object(Closure))
#35 /home/beiesp/public_html/journals.blueeyesintelligence.org/lib/pkp/lib/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Object(Closure), Array)
#36 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(PKP\core\APIResponse), Object(Closure))
#37 /home/beiesp/public_html/journals.blueeyesintelligence.org/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(PKP\core\APIResponse), Object(Closure))
#38 /home/beiesp/public_html/journals.blueeyesintelligence.org/lib/pkp/classes/handler/APIHandler.php(105): Slim\App->Slim{closure}(Object(Slim\Http\Request), Object(PKP\core\APIResponse))
#39 [internal function]: PKP\handler\APIHandler->PKP\handler{closure}(Object(Slim\Http\Request), Object(PKP\core\APIResponse), Object(Closure))
#40 /home/beiesp/public_html/journals.blueeyesintelligence.org/lib/pkp/lib/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Object(Closure), Array)
#41 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(PKP\core\APIResponse), Object(Closure))
#42 /home/beiesp/public_html/journals.blueeyesintelligence.org/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(PKP\core\APIResponse), Object(Closure))
#43 /home/beiesp/public_html/journals.blueeyesintelligence.org/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\App->Slim{closure}(Object(Slim\Http\Request), Object(PKP\core\APIResponse))
#44 /home/beiesp/public_html/journals.blueeyesintelligence.org/lib/pkp/lib/vendor/slim/slim/Slim/App.php(392): Slim\App->callMiddlewareStack(Object(Slim\Http\Request), Object(PKP\core\APIResponse))
#45 /home/beiesp/public_html/journals.blueeyesintelligence.org/lib/pkp/classes/handler/APIHandler.php(98): Slim\App->process(Object(Slim\Http\Request), Object(PKP\core\APIResponse))
#46 [internal function]: PKP\handler\APIHandler->PKP\handler{closure}(Object(Slim\Http\Request), Object(PKP\core\APIResponse), Object(Closure))
#47 /home/beiesp/public_html/journals.blueeyesintelligence.org/lib/pkp/lib/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Object(Closure), Array)
#48 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(PKP\core\APIResponse), Object(Closure))
#49 /home/beiesp/public_html/journals.blueeyesintelligence.org/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(PKP\core\APIResponse), Object(Closure))
#50 /home/beiesp/public_html/journals.blueeyesintelligence.org/lib/pkp/classes/handler/APIHandler.php(105): Slim\App->Slim{closure}(Object(Slim\Http\Request), Object(PKP\core\APIResponse))
#51 [internal function]: PKP\handler\APIHandler->PKP\handler{closure}(Object(Slim\Http\Request), Object(PKP\core\APIResponse), Object(Closure))
#52 /home/beiesp/public_html/journals.blueeyesintelligence.org/lib/pkp/lib/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Object(Closure), Array)
#53 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(PKP\core\APIResponse), Object(Closure))
#54 /home/beiesp/public_html/journals.blueeyesintelligence.org/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(PKP\core\APIResponse), Object(Closure))
#55 /home/beiesp/public_html/journals.blueeyesintelligence.org/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\App->Slim{closure}(Object(Slim\Http\Request), Object(PKP\core\APIResponse))
#56 /home/beiesp/public_html/journals.blueeyesintelligence.org/lib/pkp/lib/vendor/slim/slim/Slim/App.php(392): Slim\App->callMiddlewareStack(Object(Slim\Http\Request), Object(PKP\core\APIResponse))
#57 /home/beiesp/public_html/journals.blueeyesintelligence.org/lib/pkp/lib/vendor/slim/slim/Slim/App.php(297): Slim\App->process(Object(Slim\Http\Request), Object(PKP\core\APIResponse))
#58 /home/beiesp/public_html/journals.blueeyesintelligence.org/lib/pkp/classes/core/APIRouter.php(110): Slim\App->run()
#59 /home/beiesp/public_html/journals.blueeyesintelligence.org/lib/pkp/classes/core/Dispatcher.php(165): PKP\core\APIRouter->route(Object(APP\core\Request))
#60 /home/beiesp/public_html/journals.blueeyesintelligence.org/lib/pkp/classes/core/PKPApplication.php(373): PKP\core\Dispatcher->dispatch(Object(APP\core\Request))
#61 /home/beiesp/public_html/journals.blueeyesintelligence.org/index.php(21): PKP\core\PKPApplication->execute()
#62 {main}
View in rendered output by enabling the “displayErrorDetails” setting.

[18-Jul-2023 07:28:56 UTC] PHP Warning: Trying to access array offset on value of type null in /home/beiesp/public_html/journals.blueeyesintelligence.org/plugins/themes/default/DefaultThemePlugin.php on line 188
[18-Jul-2023 07:28:58 UTC] PHP Warning: Trying to access array offset on value of type null in /home/beiesp/public_html/journals.blueeyesintelligence.org/plugins/themes/default/DefaultThemePlugin.php on line 188

Hi @latticescipub,

This means that the fileinfo PHP extension has not been installed. Installing this will depend on your server environment, but see e.g.:

https://support.cpanel.net/hc/en-us/articles/1500000107181-How-do-I-install-Fileinfo-

Regards,
Alec Smecher
Public Knowledge Project Team

Thanks Alec Smecher
Problem has been now resolved.

1 Like