Error fatal: require_once() - Después de mover htdocs a otra unidad

Fatal error: require_once(): Failed opening required 'C:\xampp\htdocs/system/startup.php' (include_path='.;N:\New folder\php\PEAR') in N:\New folder\htdocs\index.php on line 23...

This error is showing on localhost server when I had to uninstall XAMPP folder from c: drive but I took backup of htdocs and MySQL folder and when I reinstall XAMPP in n: drive and copy paste old htdocs and MySQL to new files, this error is showing...

2nd problem which I am facing is that my SQL is not running on XAMPP control panel whereas Apache is running without any issue...

¿Cuál puede ser la razón de este error?

preguntado el 28 de mayo de 14 a las 12:05

1 Respuestas

OpenCart uses two config.php files, one at root and another in admin folder. In these files some global variables are defined containing also paths to installation folder. When you installed the OC, it automatically find the paths and write them into both config files.

But when you changed the directory of your OC (moving on disk, uploading to server), they don't update automatically and you need to do this manually:

// DIR
define('DIR_APPLICATION', '/path/to/public_html/catalog/');
define('DIR_SYSTEM', '/path/to/public_html/system/');
define('DIR_DATABASE', '/path/to/public_html/system/database/');
define('DIR_LANGUAGE', '/path/to/public_html/catalog/language/');
define('DIR_TEMPLATE', '/path/to/public_html/catalog/view/theme/');
define('DIR_CONFIG', '/path/to/public_html/system/config/');
define('DIR_IMAGE', '/path/to/public_html/image/');
define('DIR_CACHE', '/path/to/public_htmll/system/cache/');
define('DIR_DOWNLOAD', '/path/to/public_html/download/');
define('DIR_LOGS', '/path/to/public_html/system/logs/');

E.g. if you have old paths like this one:

define('DIR_APPLICATION', 'c:/htdocs/catalog/');

And now you moved it to n:/New folder, change all the paths accordingly, e.g.

define('DIR_APPLICATION', 'n:/New folder/htdocs/catalog/');

contestado el 30 de mayo de 14 a las 13:05

Though this is the correct answer it is of very low quality. Please, spend a little more words on explaining what should be done exactly and maybe also explain why. Good quality answers are more likely to be upvoted. - sombreado

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.