Service provider is closing the support for PHP 7.4 by the end of this month. Omeka Classic is version 3.0.2 installed via Installatron.
When starting to use PHP 8.0 instead of 7.4 seems to be working fine except one big failure: when uploading a file (image) results in error (see picture). Tried with different file sizes and seems that error is caused when uploading has been finished and something is going to be done with it.
Backcround path info has been updated to point to the right version of PHP.
For a “white screen” 500 error, this usually means a fatal PHP error is occurring. If PHP is set up to log on your server (it usually is) then the PHP logs should contain the relevant error. Depending on your server setup, PHP’s logs might go to Apache’s error log, to a dedicated log file, or elsewhere.
As another option, you can enable error display which should replace the white screen with a listing of the error message.
You may be able to ask your host for help in finding PHP error logs on the server, if necessary.
Ok. This is the error output received when trying to save a record with a file (works well if no file uploaded).
Warning : is_readable(): open_basedir restriction in effect. File(/Ghost/Validate/Identical.php) is not within the allowed path(s): (/home/kinxuvyqpa/:/tmp/:/var/tmp/:/usr/local/php80/lib/:/usr/local/php54/lib/:/usr/local/php55/lib/:/usr/local/php56/lib/:/usr/local/php70/lib/:/usr/local/php71/lib/:/usr/local/php72/lib/:/usr/local/lib/php/) in /home/kinxuvyqpa/domains/punkmuseo.fi/public_html/arkisto/application/libraries/Zend/Loader.php on line 186
Warning : is_readable(): open_basedir restriction in effect. File(/Omeka/Validate/Identical.php) is not within the allowed path(s): (/home/kinxuvyqpa/:/tmp/:/var/tmp/:/usr/local/php80/lib/:/usr/local/php54/lib/:/usr/local/php55/lib/:/usr/local/php56/lib/:/usr/local/php70/lib/:/usr/local/php71/lib/:/usr/local/php72/lib/:/usr/local/lib/php/) in /home/kinxuvyqpa/domains/punkmuseo.fi/public_html/arkisto/application/libraries/Zend/Loader.php on line 186
Warning : is_readable(): open_basedir restriction in effect. File(/Ghost/Validate/NotEmpty.php) is not within the allowed path(s): (/home/kinxuvyqpa/:/tmp/:/var/tmp/:/usr/local/php80/lib/:/usr/local/php54/lib/:/usr/local/php55/lib/:/usr/local/php56/lib/:/usr/local/php70/lib/:/usr/local/php71/lib/:/usr/local/php72/lib/:/usr/local/lib/php/) in /home/kinxuvyqpa/domains/punkmuseo.fi/public_html/arkisto/application/libraries/Zend/Loader.php on line 186
Warning : is_readable(): open_basedir restriction in effect. File(/Omeka/Validate/NotEmpty.php) is not within the allowed path(s): (/home/kinxuvyqpa/:/tmp/:/var/tmp/:/usr/local/php80/lib/:/usr/local/php54/lib/:/usr/local/php55/lib/:/usr/local/php56/lib/:/usr/local/php70/lib/:/usr/local/php71/lib/:/usr/local/php72/lib/:/usr/local/lib/php/) in /home/kinxuvyqpa/domains/punkmuseo.fi/public_html/arkisto/application/libraries/Zend/Loader.php on line 186
The error here is that the function “escapeshellarg” is not defined. That’s a standard PHP function so I think you’re going to need to talk to your host about that. It’s possible they’ve disabled it purposely, but this isn’t quite the typical behavior when hosts disable functions.
We did install (via Installatron) Omeke on our service providers shared services (PHP 7.4)
We started to use this local installation, no problems
When we wanted to transfer data from omeka.net to our local installation (shared hosting), it did not work because escapeshellarg was disabled (I posted here about that in last June), and some other functions needed to transfer data via API
Our service provider provided us fresh machine, we being first one there and enabling all functions so we can transfer data via API
That went fine and then they disabled bunch of functions (and I expect that escapeshellarg too, cannot be sure about hat…)
And we continued to use Omeka normally…
And now when changing to PHP 8 things (=uploading files) does not work anymore…
So, escapeshellarg has been working with PHP 7.4 but not with 8. But not with API import. When thinking what we have done and how we have used Omeka, I’m wondering if service provider has really disabled this function for 7.4 at all (even this special arrangement with API transfer refers to that they have) but has done it now for 8.0.
OR, is it possible that there’s some changes with the utilities (imagick or some others) doing thumbnaisl etc. in PHP 8?
OR, is there any workarounds how to bypass this function, which is just adding single quotes… cannot it be done without that function?
Anyway, a bit confused here as everything is not logical, at least based on the information what we have…
Have asked about this from service provider too, lets see what kind of reply we’ll get from them…
OK, so I believe the change here is just that disabled_functions in PHP 8 acts differently, so it’s a “harsher” error than before. I’ll do some thinking about how to account for that, though our general guidance is to use hosting that doesn’t disable functions.
As for workarounds, you could try to comment out (put two slashes, // at the start of the line) the following lines:
line 311 of application/models/File.php
line 74 of application/libraries/Omeka/File/MimeType/Detect.php
Commenting those should remove the uses of escapeshellarg and similar functions from what’s run when uploading a file.
Thanks. We’ll try workarounds, if needed, when our service provider gets back to us about the situation as for the longer run, it is better to have as standard solution as possible. I’ll keep you updated too.
The Omeka Classic 3.1.1 release includes a fix to skip the specific calls here if the functions are disabled in PHP 8 and up. In the future it’s likely they’ll just be removed entirely.