Post by rhorne » Tue Mar 20, 2018 11:12 pm

I've been tasked with trying to fix an Opencart installation for someone.

Initially I was just getting Server Error 500 errors, but after enabling error reporting now see:

Code: Select all

Warning: require_once(\home\linweb37\c\DOMAINMASKED.com-1096756477\user\htdocs/store/system/startup.php): failed to open stream: No such file or directory in /home/linweb37/c/DOMAINMASKED.com-1096756477/user/htdocs/store/index.php on line 19

Fatal error: require_once(): Failed opening required '\home\linweb37\c\DOMAINMASKED.com-1096756477\user\htdocs/store/system/startup.php' (include_path='.:/usr/share/pear') in /home/linweb37/c/DOMAINMASKED.com-1096756477/user/htdocs/store/index.php on line 19
When I first started investigating, the config files all pointed to:

Code: Select all

// DIR
define('DIR_APPLICATION', 'E:\Domains\c\DOMAINMASKED.com\user\htdocs\store/catalog/');
define('DIR_SYSTEM', 'E:\Domains\c\DOMAINMASKED.com\user\htdocs\store/system/');
define('DIR_DATABASE', 'E:\Domains\c\DOMAINMASKED.com\user\htdocs\store/system/database/');
define('DIR_LANGUAGE', 'E:\Domains\c\DOMAINMASKED.com\user\htdocs\store/catalog/language/');
define('DIR_TEMPLATE', 'E:\Domains\c\DOMAINMASKED.com\user\htdocs\store/catalog/view/theme/');
define('DIR_CONFIG', 'E:\Domains\c\DOMAINMASKED.com\user\htdocs\store/system/config/');
define('DIR_IMAGE', 'E:\Domains\c\DOMAINMASKED.com\user\htdocs\store/image/');
define('DIR_CACHE', 'E:\Domains\c\DOMAINMASKED.com\user\htdocs\store/system/cache/');
define('DIR_DOWNLOAD', 'E:\Domains\c\DOMAINMASKED.com\user\htdocs\store/download/');
define('DIR_LOGS', 'E:\Domains\c\DOMAINMASKED.com\user\htdocs\store/system/logs/');
But given that the new file locations appears to be /home/linweb37/c/DOMAINMASKED.com-1096756477/user/htdocs what should I put as the file location?

I've tried using the above but get the errors:

Code: Select all

Notice: Use of undefined constant DIR_STORAGE - assumed 'DIR_STORAGE' in /home/linweb37/c/DOMAINMASKED.com-1096756477/user/htdocs/store/system/startup.php on line 70
Notice: Use of undefined constant DIR_MODIFICATION - assumed 'DIR_MODIFICATION' in /home/linweb37/c/DOMAINMASKED.com-1096756477/user/htdocs/store/system/startup.php on line 55
Notice: Use of undefined constant DIR_MODIFICATION - assumed 'DIR_MODIFICATION' in /home/linweb37/c/DOMAINMASKED.com-1096756477/user/htdocs/store/system/startup.php on line 59
Notice: Use of undefined constant DIR_MODIFICATION - assumed 'DIR_MODIFICATION' in /home/linweb37/c/DOMAINMASKED.com-1096756477/user/htdocs/store/system/startup.php on line 55
Notice: Use of undefined constant DIR_MODIFICATION - assumed 'DIR_MODIFICATION' in /home/linweb37/c/DOMAINMASKED.com-1096756477/user/htdocs/store/system/startup.php on line 59
Notice: Use of undefined constant DIR_MODIFICATION - assumed 'DIR_MODIFICATION' in /home/linweb37/c/DOMAINMASKED.com-1096756477/user/htdocs/store/system/startup.php on line 55
Notice: Use of undefined constant DIR_MODIFICATION - assumed 'DIR_MODIFICATION' in /home/linweb37/c/DOMAINMASKED.com-1096756477/user/htdocs/store/system/startup.php on line 59
I've looked at the config files for another shop I work on that is working fine and its file location contains a mixture of \ and / - yet it still seems to work.

New member

Posts

Joined
Wed Jan 18, 2012 3:07 am

Post by straightlight » Tue Mar 20, 2018 11:22 pm

No OC version posted. However, here's a helper post to trace the new paths: viewtopic.php?f=199&t=198781&p=699560#p699560

The most generated errors being found on Opencart forum originates from contributed programming.

Regards,
Straightlight


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by rhorne » Tue Mar 20, 2018 11:23 pm

At this point I don't even know the version of OC as I can't get into the admin section for the same reasons. Is there another way of identifying the version?

New member

Posts

Joined
Wed Jan 18, 2012 3:07 am

Post by EvolveWebHosting » Tue Mar 20, 2018 11:30 pm

rhorne wrote:
Tue Mar 20, 2018 11:23 pm
At this point I don't even know the version of OC as I can't get into the admin section for the same reasons. Is there another way of identifying the version?
If it hasn't been removed, you should find the version in index.php or admin/index.php

Upload the attached file to the root folder and then point your browser to domain.com/path.php (replace domain.com with the correct domain name) to see the correct path you should be using in the config.php files. After you're done getting the information, delete the file.

Image
https://www.evolvewebhost.com
Unhappy with your current host? We can migrate your account today (usually for no fee)! Visit our website and signup and we'll take care of the rest!
24/7/365 support
Image


User avatar
Active Member

Posts

Joined
Fri Mar 27, 2015 11:13 pm
Location - Denver, Colorado, USA

Post by rhorne » Wed Mar 21, 2018 12:23 am

I've done that and now I get:

Code: Select all

Notice: Use of undefined constant DIR_STORAGE - assumed 'DIR_STORAGE' in /home/linweb37/c/DOMAINMASKED.com-1096756477/user/htdocs/store/system/startup.php on line 70

Notice: Use of undefined constant DIR_MODIFICATION - assumed 'DIR_MODIFICATION' in /home/linweb37/c/DOMAINMASKED.com-1096756477/user/htdocs/store/system/startup.php on line 55

Notice: Use of undefined constant DIR_MODIFICATION - assumed 'DIR_MODIFICATION' in /home/linweb37/c/DOMAINMASKED.com-1096756477/user/htdocs/store/system/startup.php on line 59

Notice: Use of undefined constant DIR_MODIFICATION - assumed 'DIR_MODIFICATION' in /home/linweb37/c/DOMAINMASKED.com-1096756477/user/htdocs/store/system/startup.php on line 55

Notice: Use of undefined constant DIR_MODIFICATION - assumed 'DIR_MODIFICATION' in /home/linweb37/c/DOMAINMASKED.com-1096756477/user/htdocs/store/system/startup.php on line 59

Notice: Use of undefined constant DIR_MODIFICATION - assumed 'DIR_MODIFICATION' in /home/linweb37/c/DOMAINMASKED.com-1096756477/user/htdocs/store/system/startup.php on line 55

Notice: Use of undefined constant DIR_MODIFICATION - assumed 'DIR_MODIFICATION' in /home/linweb37/c/DOMAINMASKED.com-1096756477/user/htdocs/store/system/startup.php on line 59

Warning: require_once(/home/linweb37/c/DOMAINMASKED.com-1096756477/user/htdocs/store/system/engine/event.php): failed to open stream: No such file or directory in /home/linweb37/c/DOMAINMASKED.com-1096756477/user/htdocs/store/system/startup.php on line 92

Fatal error: require_once(): Failed opening required '/home/linweb37/c/DOMAINMASKED.com-1096756477/user/htdocs/store/system/engine/event.php' (include_path='.:/usr/share/pear') in /home/linweb37/c/DOMAINMASKED.com-1096756477/user/htdocs/store/system/startup.php on line 92

New member

Posts

Joined
Wed Jan 18, 2012 3:07 am

Post by straightlight » Wed Mar 21, 2018 12:35 am

The link I provided on the above despites the use of the OC version at a certain point. The last error messages you posted also includes the defined constants in my referred post.

The most generated errors being found on Opencart forum originates from contributed programming.

Regards,
Straightlight


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by rhorne » Wed Mar 21, 2018 4:21 pm

Urghh. This installation is 1.5.1. I've updated both config files based on the file locations produced by your path.php file but I still get the constants error message.

I don't understand your last message, I'm afraid. Sorry :(

New member

Posts

Joined
Wed Jan 18, 2012 3:07 am

Post by straightlight » Wed Mar 21, 2018 6:59 pm

Path.php was provided by another user on this topic, not on my behalf. What I did posted for instructions is this post: viewtopic.php?f=181&t=203040#p717925 which includes the missing constants you are reporting about.

The most generated errors being found on Opencart forum originates from contributed programming.

Regards,
Straightlight


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by rhorne » Wed Mar 21, 2018 7:09 pm

I have tried both yours and Evolve's methods to get the correct locations but get the same error messages.

New member

Posts

Joined
Wed Jan 18, 2012 3:07 am

Post by straightlight » Wed Mar 21, 2018 7:13 pm

According to the recent error messages you posted, the defined constants were not added into your config.php and admin/config.php files. Once running the instructions on your browser, ensure to include those missing constants and path lines within those two files.

The most generated errors being found on Opencart forum originates from contributed programming.

Regards,
Straightlight


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by rhorne » Wed Mar 21, 2018 7:48 pm

It goes without saying that I appreciate your help on this, starlight.

My config.php looks like this:

Code: Select all

<?php
// HTTP
define('HTTP_SERVER', 'http://www.DOMAINMASKED.com/store/');
define('HTTP_IMAGE', 'http://www.DOMAINMASKED.com/store/image/');
define('HTTP_ADMIN', 'http://www.DOMAINMASKED.com/store/admin/');

// HTTPS
define('HTTPS_SERVER', 'http://www.DOMAINMASKED.com/store/');
define('HTTPS_IMAGE', 'http://www.DOMAINMASKED.com/store/image/');

// DIR
define('DIR_APPLICATION', '/home/linweb37/c/DOMAINMASKED.com-1096756477/user/htdocs/store/catalog/');
define('DIR_SYSTEM', '/home/linweb37/c/DOMAINMASKED.com-1096756477/user/htdocs/store/system/');
define('DIR_DATABASE', '/home/linweb37/c/DOMAINMASKED.com-1096756477/user/htdocs/store/system/database/');
define('DIR_LANGUAGE', '/home/linweb37/c/DOMAINMASKED.com-1096756477/user/htdocs/store/catalog/language/');
define('DIR_TEMPLATE', '/home/linweb37/c/DOMAINMASKED.com-1096756477/user/htdocs/store/catalog/view/theme/');
define('DIR_CONFIG', '/home/linweb37/c/DOMAINMASKED.com-1096756477/user/htdocs/store/system/config/');
define('DIR_IMAGE', '/home/linweb37/c/DOMAINMASKED.com-1096756477/user/htdocs/store/image/');
define('DIR_CACHE', '/home/linweb37/c/DOMAINMASKED.com-1096756477/user/htdocs/store/system/cache/');
define('DIR_DOWNLOAD', '/home/linweb37/c/DOMAINMASKED.com-1096756477/user/htdocs/store/download/');
define('DIR_LOGS', '/home/linweb37/c/DOMAINMASKED.com-1096756477/user/htdocs/store/system/logs/');

// DB
define('DB_DRIVER', 'mysql');
define('DB_HOSTNAME', '******');
define('DB_USERNAME', '******');
define('DB_PASSWORD', '******');
define('DB_DATABASE', '******');
define('DB_PREFIX', '');
?>
While my admin config looks like this:

Code: Select all

<?php
// HTTP
define('HTTP_SERVER', 'http://www.DOMAINMASKED.com/store/admin/');
define('HTTP_CATALOG', 'http://www.DOMAINMASKED.com/store/');
define('HTTP_IMAGE', 'http://www.DOMAINMASKED.com/store/image/');

// HTTPS
define('HTTPS_SERVER', 'http://www.DOMAINMASKED.com/store/admin/');
define('HTTPS_IMAGE', 'http://www.DOMAINMASKED.com/store/image/');

// DIR
define('DIR_APPLICATION', '/home/linweb37/c/DOMAINMASKED.com-1096756477/user/store/admin/');
define('DIR_SYSTEM', '/home/linweb37/c/DOMAINMASKED.com-1096756477/user/store/system/');
define('DIR_LANGUAGE', '/home/linweb37/c/DOMAINMASKED.com-1096756477/user/store/admin/language/');
define('DIR_TEMPLATE', '/home/linweb37/c/DOMAINMASKED.com-1096756477/user/store/admin/view/template/');
define('DIR_CONFIG', '/home/linweb37/c/DOMAINMASKED.com-1096756477/user/store/system/config/');
define('DIR_IMAGE', '/home/linweb37/c/DOMAINMASKED.com-1096756477/user/store/image/');
define('DIR_CACHE', '/home/linweb37/c/DOMAINMASKED.com-1096756477/user/store/system/storage/cache/');
define('DIR_DOWNLOAD', '/home/linweb37/c/DOMAINMASKED.com-1096756477/user/store/system/storage/download/');
define('DIR_UPLOAD', '/home/linweb37/c/DOMAINMASKED.com-1096756477/user/store/system/storage/upload/');
define('DIR_LOGS', '/home/linweb37/c/DOMAINMASKED.com-1096756477/user/store/system/storage/logs/');
define('DIR_MODIFICATION', '/home/linweb37/c/DOMAINMASKED.com-1096756477/user/store/system/storage/modification/');
define('DIR_CATALOG', '/home/linweb37/c/DOMAINMASKED.com-1096756477/user/store/catalog/');


// DB
define('DB_DRIVER', 'mysql');
define('DB_HOSTNAME', '*****');
define('DB_USERNAME', '*****');
define('DB_PASSWORD', '*****');
define('DB_DATABASE', '*****');
define('DB_PREFIX', '');
?>
That all seems fine to me so unless I'm misinterpreting your instruction I don't see how the constants are not being defined.

New member

Posts

Joined
Wed Jan 18, 2012 3:07 am

Post by straightlight » Wed Mar 21, 2018 7:51 pm

Then it is clearly that by looking at the provided constants from your config files, you did not followed my above instructions. The additional defined constants also needs to be added which are already provided in my steps on the pointed topic when launching the new file on your browser. It will display all the paths that you need.

Also ensure to clear the OC cache afterwards from your file server (except index.html file).

The most generated errors being found on Opencart forum originates from contributed programming.

Regards,
Straightlight


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by rhorne » Wed Mar 21, 2018 7:53 pm

Hmmm. Just restored the startup.php and now I get this:

Code: Select all

Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /home/linweb37/c/DOMAINMASKED.com-1096756477/user/htdocs/store/system/database/mysql.php:6 Stack trace: #0 /home/linweb37/c/DOMAINMASKED.com-1096756477/user/htdocs/store/system/library/db.php(12): MySQL->__construct('213.171.200.69', '******', '******', '******') #1 /home/linweb37/c/creweyewear.com-1096756477/user/htdocs/store/index.php(42): DB->__construct('mysql', '******', '******', '******', 'sunniesshop') #2 {main} thrown in /home/linweb37/c/DOMAINMASKED.com-1096756477/user/htdocs/store/system/database/mysql.php on line 6
I can't help but feel that maybe some of these issues are because it's opencart 1.5.1 and PHP is running at version 7 on the server.

New member

Posts

Joined
Wed Jan 18, 2012 3:07 am

Post by rhorne » Wed Mar 21, 2018 7:57 pm

Maybe I'm being stupid, but when I run your code, all it's providing me with is the following:

Code: Select all

DIR_APPLICATION: /home/linweb37/c/DOMAINMASKED.com-1096756477/user/htdocs/store/
DIR_SYSTEM: /home/linweb37/c/DOMAINMASKED.com-1096756477/user/htdocs/system/
DIR_OPENCART: /home/linweb37/c/DOMAINMASKED.com-1096756477/user/htdocs/
DIR_DATABASE: /home/linweb37/c/DOMAINMASKED.com-1096756477/user/htdocs/system/database/
DIR_LANGUAGE: /home/linweb37/c/DOMAINMASKED.com-1096756477/user/htdocs/store/language/
DIR_TEMPLATE: /home/linweb37/c/DOMAINMASKED.com-1096756477/user/htdocs/store/view/template/
DIR_CONFIG: /home/linweb37/c/DOMAINMASKED.com-1096756477/user/htdocs/system/config/
DIR_MODIFICATION: /home/linweb37/c/DOMAINMASKED.com-1096756477/user/htdocs/system/modification/
DIR_STORAGE: /home/linweb37/c/DOMAINMASKED.com-1096756477/user/htdocs/system/storage

New member

Posts

Joined
Wed Jan 18, 2012 3:07 am

Post by straightlight » Wed Mar 21, 2018 8:04 pm

Maybe I'm being stupid
This question can only be answered once you have compared the: DIR_STORAGE constant that is NOT among your config files on the above, for instance.

The most generated errors being found on Opencart forum originates from contributed programming.

Regards,
Straightlight


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by rhorne » Wed Mar 21, 2018 8:24 pm

OK. I was still getting errors about:

Notice: Use of undefined constant DIR_STORAGE
and
Notice: Use of undefined constant DIR_MODIFICATION

So added the following to my config files:

Code: Select all

define('DIR_STORAGE', '/home/linweb37/c/DOMAINMASKED.com-1096756477/user/htdocs/system/storage/');
define('DIR_MODIFICATION', '/home/linweb37/c/DOMAINMASKED.com-1096756477/user/htdocs/system/modification/');
Which I got from your code.

However, within the system folder there is no storage or modification sub folders, so I created empty ones.
Now I get:

Code: Select all

Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /home/linweb37/c/DOMAINMASKED.com-1096756477/user/htdocs/store/system/database/mysql.php:6 Stack trace: #0 /home/linweb37/c/DOMAINMASKED.com-1096756477/user/htdocs/store/system/library/db.php(12): MySQL->__construct('213.171.200.69', '******', '******', '******') #1 /home/linweb37/c/DOMAINMASKED.com-1096756477/user/htdocs/store/index.php(42): DB->__construct('mysql', '******', '******', '******', '******') #2 {main} thrown in /home/linweb37/c/DOMAINMASKED.com-1096756477/user/htdocs/store/system/database/mysql.php on line 6

New member

Posts

Joined
Wed Jan 18, 2012 3:07 am

Post by straightlight » Wed Mar 21, 2018 8:36 pm

However, within the system folder there is no storage or modification sub folders, so I created empty ones.
Then you are missing folders since the upload or you did not extracted the package at all from the host's file manager console after uploading the ZIP file. Ensure to also follow the install.txt file from the provided ZIP file downloaded from opencart.com .
Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /home/linweb37/c/DOMAINMASKED.com-1096756477/user/htdocs/store/system/database/mysql.php:6 Stack trace: #0 /home/linweb37/c/DOMAINMASKED.com-1096756477/user/htdocs/store/system/library/db.php(12): MySQL->__construct('213.171.200.69', '******', '******', '******') #1 /home/linweb37/c/DOMAINMASKED.com-1096756477/user/htdocs/store/index.php(42): DB->__construct('mysql', '******', '******', '******', '******') #2 {main} thrown in /home/linweb37/c/DOMAINMASKED.com-1096756477/user/htdocs/store/system/database/mysql.php on line 6
It seem you are attempting to manually upgrade your OC without sufficient knowledge. However, ensure to edit your config.php and admin/config.php files by switching your DB_DRIVER from: mysql to: mysqli . This should resolve the issue regarding the database connection error you have.

The most generated errors being found on Opencart forum originates from contributed programming.

Regards,
Straightlight


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by rhorne » Wed Mar 21, 2018 9:05 pm

I'm not attempting an install or an upgrade. I'm trying to fix someone else's broken installation. Apparently the site just stopped working and was displaying Server Error 500 messages.

It appears that the internet host reshuffled their servers, thus changing the file locations and I'm trying to fix everything that's broken in order to restore the site. Then I'll attempt an upgrade.

New member

Posts

Joined
Wed Jan 18, 2012 3:07 am

Post by rhorne » Wed Mar 21, 2018 9:22 pm

Looks like 1.5.1 didn't support mysqli and mysql has been deprecated hence the errors. I uploaded mysqli.php to the database folder but now I'm getting a new error message:

Code: Select all

Fatal error: Uncaught Error: Call to undefined method mysqli::escape() in /home/linweb37/c/MASKED.com-1096756477/user/htdocs/store/system/library/db.php:20 Stack trace: #0 /home/linweb37/c/MASKED.com-1096756477/user/htdocs/store/index.php(49): DB->escape('http://MASKED...') #1 {main} thrown in /home/linweb37/c/MASKED.com-1096756477/user/htdocs/store/system/library/db.php on line 20
At this point I reckon I might end up just forever chasing errors so I'm going to attempt an upgrade to 2.3.0.2.

New member

Posts

Joined
Wed Jan 18, 2012 3:07 am

Post by straightlight » Wed Mar 21, 2018 9:28 pm

These error messages are caused by the fact you didn't uploaded a new package to the server and simply edit your config.php and admin/config.php files with those new constant definition requirements until today for these configurations. Although, you'd still need to upload the new files to a separate folder on your server or in your virtual server before launching the upgrade and by making a full backup of your store and its database.

If you are not sure on how to successfully complete the upgrade, you can always submit a new request in the Commercial Support section of the forum in order to be done as a custom job.

The most generated errors being found on Opencart forum originates from contributed programming.

Regards,
Straightlight


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON
Who is online

Users browsing this forum: No registered users and 20 guests