Ah yea.. good catch.. years of typing the old file paths... now I have to remember to add the new subfolders.pm-netti wrote:In version 2.2 this is in file system/library/cart/user.phpbrik wrote: Question:
I have an upgraded system and a couple of systems installed from scratch. The new installations don't have the file system/library.user.php where did this file come from is it legacy? Is it even being used?
SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data OK
Fatal error: Maximum execution time of 30 seconds exceeded in C:\xampp\htdocs\testcart\system\library\db\mysqli.php on line 18
SOLUTION
1) Open the Xampp control panel
2) Click on 'config' behind 'Apache'
3) Select 'PHP (php.ini)' from the dropdown -> A file should now open in your text editor
4) Press ctrl+f and search for 'max_execution_time', you should fine a line which only says
5) max_execution_time=30
6) Change 30 to a bigger number (180 worked for me), like this:
7) max_execution_time=180
Save the file
9) 'Stop' Apache server
10) Close Xampp
11) Restart Xampp
12) 'Start' Apache server
13) Run Continue Button Again
Enjoy
And what for all those who cannot change the time (because of provider restrictions or not parsing additional *.ini files)?
Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.
adilbhatofficial wrote:For those who are getting this error
SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data OK
Fatal error: Maximum execution time of 30 seconds exceeded in C:\xampp\htdocs\testcart\system\library\db\mysqli.php on line 18
I do already include an updated php.ini within the install folder that "should" go longer than 30, but as osworks says, only if the server supports that. The work around for that is to "chunk" the opencart.sql file. The longest running, most intensive process is the install/model/upgrade/1000.php file as that file parses the entire database and attempts to reconcile it to match the structure of the opencart.sql file. This is good because it can repair some broken indexes and field types and lengths, but also is quite intensive and tedious so it takes the longest amount of time.OSWorX wrote:Quite nice, but how many are working locale (XAMPP)???
And what for all those who cannot change the time (because of provider restrictions or not parsing additional *.ini files)?
Some work arounds for that:
Work around 1: Local upgrade
1. Backup the database and install to a local wamp install where you have full control. Set the memory and timeout really high.
2. Run the upgrade locally, then export the database to a file.
3. Upload the new files to your live site and import the new database.
4. Remove the install/model/upgrade/1000.php file from your live site's install folder.
5. Run the upgrade on the live site and it will run through the remaining upgrade scripts there to get the config.php file changes and stuff
Work around 2: Chunk the opencart.sql file
1. Create a subfolder called "disabled" in the install/model/upgrade/ folder and move all files except 1000.php into that folder.
2. Edit the install/opencart.sql file and select and cut the majority portion of the file out and paste into another file. Be sure to cut at breakpoints and not in the middle of any sql commands. This will leave only a few table references in the opencart.sql (I usually cut everything after oc_coupon for example).
3. Save the now smaller opencart.sql file and upload back to the server.
4. Run the installer. It should go quick since there are fewer tables to try to parse against.
5. Edit the opencart.sql file again, this time replacing it all with another chunk of data from the place where you pasted it earlier. Cut it from there and paste into opencart.sql. Save it and run the installer again.
6. Do this multiple times until you get all the chunks.
7. After completing the last run. Go back to the install/model/upgrade/disabled folder and move all the files back into the install/model/upgrade folder that they were originally from. This time, move the 1000.php file into that disabled folder so that it doesn't try to run again.
8. Run the upgrade script one more time, this will now run the remaining scripts and complete the upgrade.
It sounds complicated but its not really too bad. I've used it many times when doing upgrades for people with questionable servers.
Why not creating something like a 'self calling' script which loads the update commands in chunks by itself (as many other very big projects already doing)?
That should be possible with a few lines of ajax within the lowest possible value of 30 seconds most of the servers are configured actually.
Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.
Admin Console
Code: Select all
Fatal error: Uncaught exception 'Exception' with message 'Error: Could not load database adaptor mysqli!' in /home4/onemuga1/public_html/store2/system/library/db.php:11 Stack trace: #0 /home4/onemuga1/public_html/store2/system/framework.php(25): DB->__construct('mysqli', 'localhost', '<deleted>', '<deleted>', 'onemuga1_oc2', '3306') #1 /home4/onemuga1/public_html/store2/admin/index.php(26): require_once('/home4/onemuga1...') #2 {main} thrown in /home4/onemuga1/public_html/store2/system/library/db.php on line 11
Code: Select all
Fatal error: Uncaught exception 'Exception' with message 'Error: Could not load database adaptor mysqli!' in /home4/onemuga1/public_html/store2/system/library/db.php:11 Stack trace: #0 /home4/onemuga1/public_html/store2/system/framework.php(25): DB->__construct('mysqli', 'localhost', '<deleted>', '<deleted>', 'onemuga1_oc2', '3306') #1 /home4/onemuga1/public_html/store2/index.php(26): require_once('/home4/onemuga1...') #2 {main} thrown in /home4/onemuga1/public_html/store2/system/library/db.php on line 11
I made copies of the files and made a duplicate of the DB. Then, I changed all the config files to the correct directory and DB name.
Please help...
Are you sure you uploaded all files from the oc2200 package? it looks like some files aren't there, namely the system/library/db/mysqli.php fileSeniorSE wrote:Hi everyone. I used the new upgrade script to go from 1.5.5.1 to 2.2.0.0, and it worked great! Except, now I get an error when I try to load the Admin console or the store:
Admin ConsoleCode: Select all
Fatal error: Uncaught exception 'Exception' with message 'Error: Could not load database adaptor mysqli!' in /home4/onemuga1/public_html/store2/system/library/db.php:11 Stack trace: #0 /home4/onemuga1/public_html/store2/system/framework.php(25): DB->__construct('mysqli', 'localhost', '<deleted>', '<deleted>', 'onemuga1_oc2', '3306') #1 /home4/onemuga1/public_html/store2/admin/index.php(26): require_once('/home4/onemuga1...') #2 {main} thrown in /home4/onemuga1/public_html/store2/system/library/db.php on line 11
I made it simple enough to follow.. but you aren't wrong. It should probably be chunked up. But that adds additional tedious work to other steps in the process. Exporting the default sql file from the master release would now need to be manipulated. Perhaps a script that reads that opencart.sql file into smaller temp file chunks and reads those. But there are only so many hours in a day....OSWorX wrote:While the proposal form Qphoria may acceptable for 'experienced developers', many of the users are 'not so experienced' (to stay nice ..).
Why not creating something like a 'self calling' script which loads the update commands in chunks by itself (as many other very big projects already doing)?
That should be possible with a few lines of ajax within the lowest possible value of 30 seconds most of the servers are configured actually.
Yes. All the files are there. Could it be a permissions issue? What rights should the files be set at? All the PHP files are set to rw-r--r--.Qphoria wrote:
Are you sure you uploaded all files from the oc2200 package? it looks like some files aren't there, namely the system/library/db/mysqli.php file
Thanks.
Mark
Code: Select all
<?php phpinfo(); ?>
Code: Select all
mysqli
MysqlI Support enabled
Client API library version 5.5.42-37.1
Active Persistent Links 0
Inactive Persistent Links 0
Active Links 0
Client API header version 5.5.42-37.1
MYSQLI_SOCKET /var/lib/mysql/mysql.sock
Directive Local Value Master Value
mysqli.allow_local_infile On On
mysqli.allow_persistent On On
mysqli.default_host no value no value
mysqli.default_port 3306 3306
mysqli.default_pw no value no value
mysqli.default_socket /var/lib/mysql/mysql.sock /var/lib/mysql/mysql.sock
mysqli.default_user no value no value
mysqli.max_links Unlimited Unlimited
mysqli.max_persistent Unlimited Unlimited
mysqli.reconnect Off Off
Code: Select all
Progress
Error Code(0): Error: Duplicate entry '103-1' for key 'PRIMARY'
Error No: 1062
Error in: /home/xxxx/public_html/upgrade-test/install/model/upgrade/1000.php line 293
ALTER TABLE `oc_product_description` ADD PRIMARY KEY(`product_id`,`language_id`) in /home/xxxx/public_html/upgrade-test/system/library/db/mysql.php on line 54
Running Opencart v3.0.3.2 with multi-stores and the default template from https://www.labeshops.com which has links to all my stores.
So this is a little bit of a trickier one. I've not seen it happen with the product_description table, but with other tables that had a custom mod that added a language_id column in their current version.labeshops wrote:Trying to do the upgrade on a test copy of my 1.5.6.4 going to 2.2.0 using your upgrade script. I get:
and it fails.Code: Select all
Progress Error Code(0): Error: Duplicate entry '103-1' for key 'PRIMARY' Error No: 1062 Error in: /home/xxxx/public_html/upgrade-test/install/model/upgrade/1000.php line 293 ALTER TABLE `oc_product_description` ADD PRIMARY KEY(`product_id`,`language_id`) in /home/xxxx/public_html/upgrade-test/system/library/db/mysql.php on line 54
For example, the banner_image table. Some mods add multi-language banner_image by adding a language_id column. This now means that there are 2 primary keys for the table: banner_image_id AND language_id. This means you can have the same banner_image_id with a different language_id.
1 - 1
1 - 2
But the default opencart.sql file only has a single primary: banner_image_id.
So when the upgrade script runs, it tries to repair existing tables to match the structure of the opencart.sql file
This causes it to choke because now it reset banner_image_id as the only primary and now you get the error about Duplicate entry.
The fix is to figure out which new column was added to this table and add it to the opencart.sql file so that it doesn't try to remove it from the primary key list. So my guess is that with your product_description table, since it already has a language_id column by default, you have some other mod that adds another column as a primary key. Adding that additional primary key to the opencart.sql file should fix it.
Now of course this is advanced developer level stuff to make these types of changes and adaptations. So I will look at maybe skipping over the primary key repair when there is more than one primary key added to a core table. It sort of defeats the purpose of the general upgrade script (1000.php), but I guess it's more realistic and less ideal.
I think the problem might be that years ago I ran this http://forum.opencart.com/viewtopic.php?f=121&t=107756 which added indexes? Not sure how I can undo that???
I have only ever used 1 language though.
Running Opencart v3.0.3.2 with multi-stores and the default template from https://www.labeshops.com which has links to all my stores.
How is work this change to file 1000.php about by line 292:labeshops wrote:Hmmm
I think the problem might be that years ago I ran this http://forum.opencart.com/viewtopic.php?f=121&t=107756 which added indexes? Not sure how I can undo that???
I have only ever used 1 language though.
Code: Select all
if ($primary_data) {
$this->db->query("ALTER TABLE `" . $table['name'] . "` ADD PRIMARY KEY(" . implode(',', $primary_data) . ")");
}
Code: Select all
if ($query->num_rows && $primary_data) {
foreach ($query->rows as $result) {
if ($result['Key_name'] != 'PRIMARY' && $result['Key_name']) {
$this->db->query("ALTER TABLE `" . $table['name'] . "` ADD PRIMARY KEY(" . implode(',', $primary_data) . ")");
}
}
}
Code: Select all
Error Code(0): Error: Incorrect table definition; there can be only one auto column and it must be defined as a key
Error No: 1075
ALTER TABLE `oc_affiliate` CHANGE `affiliate_id` `affiliate_id` INT(11) NOT NULL AUTO_INCREMENT in /home/xxxx/public_html/upgrade-test/system/library/db/mysqli.php on line 40
Running Opencart v3.0.3.2 with multi-stores and the default template from https://www.labeshops.com which has links to all my stores.
You try this, 1000.php line 190:labeshops wrote:Hmm well tried that and now have a different error...
Code: Select all
Error Code(0): Error: Incorrect table definition; there can be only one auto column and it must be defined as a key Error No: 1075 ALTER TABLE `oc_affiliate` CHANGE `affiliate_id` `affiliate_id` INT(11) NOT NULL AUTO_INCREMENT in /home/ammaaset/public_html/upgrade-test/system/library/db/mysqli.php on line 40
Code: Select all
if ($oldfield['Extra'] == 'auto_increment' && $field['autoincrement']) {
Code: Select all
if ($oldfield['Extra'] == 'auto_increment' && $field['autoincrement'] && $oldfield['Field'] != $field['name']) {
Running Opencart v3.0.3.2 with multi-stores and the default template from https://www.labeshops.com which has links to all my stores.
How can be same errorlabeshops wrote:That didn't work - same error
Code: Select all
$oldfield['Field'] != $field['name']
Users browsing this forum: No registered users and 120 guests