Something Went Wrong in Search

I don’t use the search feature very often, and probably not since the 6.3.1 upgrade.

When I click the magnifying glass and enter my search word, after a short while I get the following message:

Something went wrong

Unexpected error: Maximum execution time of 30 seconds exceeded in PdoExtended.php on line 161

Please report error at https://discourse.theturninggate.net

I’ve cleared the template cache and upgraded to 6.3.2 but that made no difference.

What else can I check?

Backlight 6.3.2
PHP 8.0.30
Ubuntu 22.04 LTS

Hi @mickseymour, this is caused by search taking longer than the default PHP setting of 30 seconds execution. Do you have a lot of albums and photos?

The timeout can be changed in a few ways. If you have access to your php.ini settings, either through the control panel or directly by editing the file then increase the value for the max_execution_time.

If that is not available, then you could set a longer timeout by editing the file at backlight/index.php, adding a set_time_limit line near the top of the file like this:

<?php

define('BACKLIGHT_DIRECTORY', 'backlight');

set_time_limit(60);

I can advise further on the first option if you’re trying to edit the php.ini file.

Thanks @Ben, 28,000 photos over a lot of albums.

I’ll give max_execution_time a go and report back.

Changing max_execution_time to 60 seconds has helped in some cases. However some searches never seem to finish, with no error message at all. PHP info confirms the new value is in effect.

The searches are simple single people names and it is the ones where I’d expect a lot of data to be returned that don’t finish, even after 60 seconds.