Warning: Table './schoonz_drupal7/watchdog' is marked as crashed and last (automatic?) repair failed query: INSERT INTO watchdog (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (0, 'php', '%message in %file on line %line.', 'a:4:{s:6:\"%error\";N;s:8:\"%message\";s:30:\"Function split() is deprecated\";s:5:\"%file\";s:63:\"/home/schoonz/public_html/sites/all/themes/zen/zen/template.php\";s:5:\"%line\";i:132;}', 3, '', 'http://www.schoonzie.com/drupals-updatephp-script-redirecting-homepage-and-not-updating', '', '54.167.75.155', 1414297255) in /home/schoonz/public_html/includes/database.mysql.inc on line 128
Drupal's update.php script redirecting to homepage and not updating | Schoonzie

Drupal's update.php script redirecting to homepage and not updating

18 comments

While upgrading a couple of different Drupal (5.x) sites, I ran into an annoying issue where the update.php script just redirected to the sites homepage after the "Select Version" page. The server in question has PHP's mod_security enabled which has caused some problems with other sites in the past, so I think it's related to that, but I'm not totally sure.

Any way, the fix is to add the following line of code to your update.php script before line 794

if ($_POST['op']) $_REQUEST['op'] = $_POST['op'];

The finished product should look something like:

update_fix_schema_version();
update_fix_watchdog_115();
update_fix_watchdog();
update_fix_sessions();

//start new code
if ($_POST['op']) $_REQUEST['op'] = $_POST['op'];
//end new code

$op = isset($_REQUEST['op']) ? $_REQUEST['op'] : '';
switch ($op) {
        case 'Update':
                $output = update_update_page();
                break;

Have you had the same problem? Do you know what is causing it? Did the above code work for you?