When i upload image there, the image is success uploaded with no error output on the page, but when i check in public directory the file size is 0 and the image extension is missing.
Very odd – that code is widely deployed and mature, and working fine just about everywhere. There is another similar report here, but otherwise I’m not aware of other cases like you describe.
The fact that you have one working install and one broken install gives us a starting point.
Are these both the same version of OJS? (Is there any difference between them that might be relevant?)
Can you check the file permissions in the containing directory, and on the created files, to see if they are the same?
Does the configuration file contain the same umask setting in the [files] section?
Can you navigate to Administration > View System Information and check the PHP version for each? (Sometimes CPanel allows different PHP versions to be executed for different parts of the hosting environment.)
Regards,
Alec Smecher
Public Knowledge Project Team
I am also exactly the same version 3.4.0.7 (php version 8.1.31), the same problem: cannot save, always endless loading.
I hope I can save files in public library.
Regards,
Waluyo
@waluyo, I think that might be a different problem. Check your PHP error log to see what it says.
@f666dhn, are you running a server-side virus checker? I wonder if something like that might be interfering with file storage. If you are, see if it’s possible to temporarily disable it from running on your files directory.
Regards,
Alec Smecher
Public Knowledge Project Team
@asmecher
this is the last log error when I tried to save template-numas-4.docx in the library.
Blockquote
[21-Jan-2025 07:03:02 Asia/Kuala_Lumpur] There was a problem reading the Geo database at /home/itumammy/clients/files/usageStats/IPGeoDB.mmdb. Error: The file “/home/itumammy/clients/files/usageStats/IPGeoDB.mmdb” does not exist or is not readable.
[21-Jan-2025 07:04:17 Asia/Kuala_Lumpur] PHP Warning: copy(/home/itumammy/clients/files/contexts/8/library/template-numas-4-OTH.docx): Failed to open stream: No such file or directory in /home/itumammy/clients/publish.umam.edu.my/lib/pkp/classes/file/FileManager.php on line 236
[21-Jan-2025 07:04:17 Asia/Kuala_Lumpur] PHP Notice: Only variable references should be returned by reference in /home/itumammy/clients/publish.umam.edu.my/lib/pkp/classes/file/PKPLibraryFileManager.php on line 118
[21-Jan-2025 07:04:17 Asia/Kuala_Lumpur] PHP Fatal error: Uncaught Error: Call to a member function setContextId() on bool in /home/itumammy/clients/publish.umam.edu.my/lib/pkp/controllers/grid/settings/library/form/NewLibraryFileForm.php:73
Stack trace: #0 /home/itumammy/clients/publish.umam.edu.my/lib/pkp/controllers/grid/files/LibraryFileGridHandler.php(226): PKP\controllers\grid\settings\library\form\NewLibraryFileForm->execute() #1 [internal function]: PKP\controllers\grid\files\LibraryFileGridHandler->saveFile() #2 /home/itumammy/clients/publish.umam.edu.my/lib/pkp/classes/core/PKPRouter.php(334): call_user_func() #3 /home/itumammy/clients/publish.umam.edu.my/lib/pkp/classes/core/PKPComponentRouter.php(291): PKP\core\PKPRouter->_authorizeInitializeAndCallRequest() #4 /home/itumammy/clients/publish.umam.edu.my/lib/pkp/classes/core/Dispatcher.php(165): PKP\core\PKPComponentRouter->route() #5 /home/itumammy/clients/publish.umam.edu.my/lib/pkp/classes/core/PKPApplication.php(395): PKP\core\Dispatcher->dispatch() #6 /home/itumammy/clients/publish.umam.edu.my/index.php(21): PKP\core\PKPApplication->execute() #7 {main}
thrown in /home/itumammy/clients/publish.umam.edu.my/lib/pkp/controllers/grid/settings/library/form/NewLibraryFileForm.php on line 73
Hi @asmecher and @waluyo . We are facing same problem too. We can not save anything in the library and always keep endless loading when we click Save with 0 byte size of the file on the context folder. In addition, nothing show up in the error log file . We use the OJS 3.4.0.8, PHP version 8.1, and OS is Linux. Your help will be highly appreciated
Many thanks,
We were able to solve the problem out of OJS. Our server administrator was able to solve this problem by tracking the apache error log file and find that The mod_sec in our server was preventing files and images from uploading. We added a role to the mod_security plugin that allows files and pics and everything went fine.