Page 1 of 1

Modificar una web ya existente en un localhost

Posted: Tue Apr 25, 2017 5:53 pm
by keverson303
Buenas gente, me tengo un lio de narices estoy trabajando con xampp no consigo visualizar la web en localhost me aparecen estos errores:

Warning: require_once(/home/ibixnram/public_html/system/startup.php): failed to open stream: No such file or directory in C:\xampp\htdocs\eficatiafinal\index.php on line 17

Fatal error: require_once(): Failed opening required '/home/ibixnram/public_html/system/startup.php' (include_path='C:\xampp\php\PEAR') in C:\xampp\htdocs\eficatiafinal\index.php on line 17

No entiendo que tengo que hacer la base de datos se importo bien.

Re: Modificar una web ya existente en un localhost

Posted: Wed Apr 26, 2017 5:08 am
by Richardorl
Buenas!
Yo hace poco lo hice y más o menos me va... Supongo que tendrás que retocar los ficherps config em home y en admin.
Te pongo lo que tengo yo y lo adaptas a tu ruta:

En el config.php de /home:

<?php
// HTTP
define('HTTP_SERVER', '');

// HTTPS
define('HTTPS_SERVER', 'http://www.tuweb_XXXXXXXXXXXXXXXX.com/');

// DIR
define('DIR_APPLICATION', '/xampp/htdocs/opencart/public_html/catalog/');
define('DIR_SYSTEM', '/xampp/htdocs/opencart/public_html/system/');
define('DIR_IMAGE', '/xampp/htdocs/opencart/public_html/image/');
define('DIR_LANGUAGE', '/xampp/htdocs/opencart/public_html/catalog/language/');
define('DIR_TEMPLATE', '/xampp/htdocs/opencart/public_html/catalog/view/theme/');
define('DIR_CONFIG', '/xampp/htdocs/opencart/public_html/system/config/');
define('DIR_CACHE', '/xampp/htdocs/opencart/public_html/system/storage/cache/');
define('DIR_DOWNLOAD', '/xampp/htdocs/opencart/public_html/system/storage/download/');
define('DIR_LOGS', '/xampp/htdocs/opencart/public_html/system/storage/logs/');
define('DIR_MODIFICATION', '/xampp/htdocs/opencart/public_html/system/storage/modification/');
define('DIR_UPLOAD', '/xampp/htdocs/opencart/public_html/system/storage/upload/');

// DB
define('DB_DRIVER', 'mysqli');
define('DB_HOSTNAME', 'localhost');
define('DB_USERNAME', 'lo_que_sea_xxxxxxxxxxxx');
define('DB_PASSWORD', 'lo_que_sea_xxxxxxxxxxxx');
define('DB_DATABASE', 'nombre_bbdd_xxxxxxxxxx');
define('DB_PORT', '3306');
define('DB_PREFIX', 'oc_'); <------------- Esto depende de como lo tengas en tu web
?>

Y en admin/config.php

<?php
// HTTP
define('HTTP_SERVER', '');
define('HTTP_CATALOG', '/opencart/public_html/');

// HTTPS
define('HTTPS_SERVER', 'http://www..tuweb_XXXXXXXXXXXXXXXX.com/admin/');
define('HTTPS_CATALOG', 'http://www..tuweb_XXXXXXXXXXXXXXXX.com/');

// DIR
define('DIR_APPLICATION', '/xampp/htdocs/opencart/public_html/admin/');
define('DIR_SYSTEM', '/xampp/htdocs/opencart/public_html/system/');
define('DIR_IMAGE', '/xampp/htdocs/opencart/public_html/image/');
define('DIR_LANGUAGE', '/xampp/htdocs/opencart/public_html/admin/language/');
define('DIR_TEMPLATE', '/xampp/htdocs/opencart/public_html/admin/view/template/');
define('DIR_CONFIG', '/xampp/htdocs/opencart/public_html/system/config/');
define('DIR_CACHE', '/xampp/htdocs/opencart/public_html/system/storage/cache/');
define('DIR_DOWNLOAD', '/xampp/htdocs/opencart/public_html/system/storage/download/');
define('DIR_LOGS', '/xampp/htdocs/opencart/public_html/system/storage/logs/');
define('DIR_MODIFICATION', '/xampp/htdocs/opencart/public_html/system/storage/modification/');
define('DIR_UPLOAD', '/xampp/htdocs/opencart/public_html/system/storage/upload/');
define('DIR_CATALOG', '/xampp/htdocs/opencart/public_html/catalog/');

// DB
define('DB_DRIVER', 'mysqli');
define('DB_HOSTNAME', 'localhost');
define('DB_USERNAME', 'lo_que_sea_xxxxxxxxxxxx');
define('DB_PASSWORD', 'lo_que_sea_xxxxxxxxxxxx');
define('DB_DATABASE', 'nombre_bbdd_xxxxxxxxxx');
define('DB_PORT', '3306');
define('DB_PREFIX', 'oc_'); <------------- Esto depende de como lo tengas en tu web
?>

Suerte!

Re: Modificar una web ya existente en un localhost

Posted: Thu May 04, 2017 5:40 pm
by keverson303
Ese problema ya lo tengo solucionado ahora es lo siguiente:


Warning: mysqli::mysqli(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: YES) in C:\xampp\htdocs\eficatiafinal\system\library\db\mysqli.php on line 7

Notice: Error: Could not make a database link (1045) Access denied for user 'root'@'localhost' (using password: YES) in C:\xampp\htdocs\eficatiafinal\system\library\db\mysqli.php on line 10

Warning: mysqli::close(): Couldn't fetch mysqli in C:\xampp\htdocs\eficatiafinal\system\library\db\mysqli.php on line 58

Tengo errores de base de datos con xamp no se donde modificar esto parametros.

Re: Modificar una web ya existente en un localhost

Posted: Sun May 14, 2017 10:15 pm
by Richardorl
Buenas!

Pues te está diciendo que el usuario root con el password que le has puesto en el fichero config, no tiene permiso para acceder a la base de datos.
Usa phpmyadmin para ponerle el password que tengas puesto user root en el archivo config y verifica que tenga todos los permisos para gestionar la base de datos ( que seguro los tiene al ser root)

Salu2!

Re: Modificar una web ya existente en un localhost

Posted: Tue May 16, 2017 4:45 pm
by keverson303
Como hago eso?

Osea entro al phpadmin y en la pestaña usuarios he puesto el usuario pero me da el mismo error.

Re: Modificar una web ya existente en un localhost

Posted: Tue May 16, 2017 7:33 pm
by keverson303
Parse error: syntax error, unexpected 'load' (T_STRING) in C:\xampp\htdocs\eficatiafinal\index.php on line 23

Ahora tengo ese error en el index.php adjunto las siguientes lineas:

// Startup
require_once(DIR_SYSTEM .'C:\xampp\htdocs\eficatiafinal\system\');

// Registry
$registry = new Registry();

// Loader
$loader = new Loader($registry);
$registry->set('load', $loader); AQUI SUPUESTAMENTE ESTA EL PROBLEMA

// Config
$config = new Config();
$registry->set('config', $config);

// Database
$db = new DB(DB_DRIVER, DB_HOSTNAME, DB_USERNAME, DB_PASSWORD, DB_DATABASE, DB_PORT);
$registry->set('db', $db);

// Store
if (isset($_SERVER['HTTPS']) && (($_SERVER['HTTPS'] == 'on') || ($_SERVER['HTTPS'] == '1'))) {
$store_query = $db->query("SELECT * FROM " . DB_PREFIX . "store WHERE REPLACE(`ssl`, 'www.', '') = '" . $db->escape('https://' . str_replace('www.', '', $_SERVER['HTTP_HOST']) . rtrim(dirname($_SERVER['PHP_SELF']), '/.\\') . '/') . "'");
} else {
$store_query = $db->query("SELECT * FROM " . DB_PREFIX . "store WHERE REPLACE(`url`, 'www.', '') = '" . $db->escape('http://' . str_replace('www.', '', $_SERVER['HTTP_HOST']) . rtrim(dirname($_SERVER['PHP_SELF']), '/.\\') . '/') . "'");
}

if ($store_query->num_rows) {
$config->set('config_store_id', $store_query->row['store_id']);
} else {
$config->set('config_store_id', 0);
}

// Settings
$query = $db->query("SELECT * FROM `" . DB_PREFIX . "setting` WHERE store_id = '0' OR store_id = '" . (int)$config->get('config_store_id') . "' ORDER BY store_id ASC");

foreach ($query->rows as $result) {
if (!$result['serialized']) {
$config->set($result['key'], $result['value']);
} else {
$config->set($result['key'], json_decode($result['value'], true));
}
}

if (!$store_query->num_rows) {
$config->set('config_url', HTTP_SERVER);
$config->set('config_ssl', HTTPS_SERVER);
}