You are here:  » PHP 5.5 and InnoDB compatible?


PHP 5.5 and InnoDB compatible?

Submitted by Joko on Mon, 2015-10-12 01:14 in

The performance and RAM consumption issues on the server are due to db_products which is causing locked queries due to the high volume of writes on it. This could be resolved by converting the table from MyISAM to InnoDB.

With that said, Apache and PHP are both running severely outdated versions. PHP is running 5.3.23, which is end of life- PHP 5.5 is the current stable PHP version (PHP 5.4 is also EOL). Apache 2.2 is ok, but 2.2.24 is quite old and subject to known vulnerabilities. We recommend using the latest Apache 2.4 instead.We can perform the recompile for both upgrades, but you will want to ensure your software is compatible with these versions.

I want to upgrade to new version of table and php version.
is this software compatible?
i am using 13/03A

Submitted by support on Mon, 2015-10-12 08:09

Hello Joko,

InnoDB doesn't support MySQL's FULLTEXT index type which is used by default by search, however this can be disabled in the configuration and I have just done a quick test and everything works fine using InnoDB as the storage engine for the products table.

To disable FULLTEXT, edit config.advanced.php and edit line 8 as follows;

  $config_useFullText = FALSE;

It is also used however by the Related Products functionality in products.php, so to disable here also, look for the following code at line 100:

    if (!$ignoreFullText)

...and REPLACE with:

    if (FALSE)

And then look for the following code at line 107:

  $sql = "SELECT DISTINCT(name),MATCH name AGAINST ('".database_safe($q)."') AS relevance FROM `".$config_databaseTablePrefix."products` ".($ignoreFullText?"IGNORE INDEX (name_2)":"USE INDEX (name_2)")." WHERE ".$where." ORDER BY relevance DESC LIMIT 3";

...and REPLACE with:

  $sql = "SELECT DISTINCT(name) FROM `".$config_databaseTablePrefix."products` WHERE ".$where." LIMIT 3";

The following dbmod.php script will then TRUNCATE (empty) the products table, drop the FULLTEXT index and then convert to InnoDB. After running the script delete from your server and then run a full import.

<?php
  set_time_limit
(0);
  require(
"includes/common.php");
  
$sql "TRUNCATE `".$config_databaseTablePrefix."products`";
  
database_queryModify($sql,$result);
  
$sql "DROP INDEX name_2 ON `".$config_databaseTablePrefix."products`";
  
database_queryModify($sql,$result);
  
$sql "ALTER TABLE `".$config_databaseTablePrefix."products` ENGINE = InnoDB";
  
database_queryModify($sql,$result);
  print 
"Done.";
?>

Regarding PHP 5.5 - no problem - there is a forward compatibility patch for 13/03A and details of the changes this applied in this thread.

Cheers,
David.
--
PriceTapestry.com

Submitted by Joko on Mon, 2015-10-12 10:15

hello, upgrade my php and table.

one of domain get 500 Internal server Error.

error_log:

[12-Oct-2015 06:03:03 America/New_York] PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20090626/suhosin.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20090626/suhosin.so: undefined symbol: output_globals in Unknown on line 0
[12-Oct-2015 06:03:03 America/New_York] PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20090626/pdo.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20090626/pdo.so: undefined symbol: zval_property_ctor in Unknown on line 0
[12-Oct-2015 06:03:03 America/New_York] PHP Warning: PHP Startup: pdo_sqlite: Unable to initialize module
Module compiled with module API=20090626
PHP compiled with module API=20121212
These options need to match
 in Unknown on line 0

another domain doing fine. what is the problem?

Submitted by support on Mon, 2015-10-12 10:35

Hi,

PHP errors at line 0 relate to internal PHP configuration or (as looks like the case here) build compatibility issues, and occur before the script has even been loaded. What appears to be the case from the last few lines of the output...

Module compiled with module API=20090626
PHP compiled with module API=20121212
These options need to match

...is that PHP as an Apache module has not yet been upgraded to match the PHP upgrade. An upgrade to Apache to match the latest build of PHP for your Linux distribution should be available in your distribution's repository so upgrading Apache should be all you need to do...

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by Joko on Mon, 2015-10-12 13:57

thank you that is work.

now,

products, search page not rewrite and create 404 page.

this is my .htaccess

{code saved}

what is wrong?

Submitted by support on Mon, 2015-10-12 14:51

Hi,

It sounds like upgrading Apache has disabled mod_rewrite so that would be where to look.

If it helps, I notice from the dates referred to in the error log above that the previous installation goes back to 2009, and in my recent experience of server administration most Apache distributions now use a method of enabling modules by way of symbolic links between mods_enabled and mods_available directories ( most likely to be found in either /etc/apache2/ or /etc/httpd/ ). If this is the case on your server, in order to enable rewrite a symbolic link would need to exist between:

mods-enabled/rewrite.load

and

../mods-available/rewrite.load

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by Joko on Mon, 2015-10-12 17:07

hello,

i am sorry. i cannot find it.
but

category working find.

only products and search result not redirected.

please look at my site: {link saved}

Submitted by support on Tue, 2015-10-13 08:04

Hello Joko,

Please could you email me your .htaccess and I'll check it out further with you.

Thanks,
David.
--
PriceTapestry.com