Foros del Web » Programando para Internet » PHP » CodeIgniter »

Problema con librería database

Estas en el tema de Problema con librería database en el foro de CodeIgniter en Foros del Web. Saludos, estoy haciendo una aplicación con CodeIgniter, antes de esa aplicación no he tenido problemas, todo a funcionado muy bien. En esta aplicación, todo funciona ...
  #1 (permalink)  
Antiguo 03/07/2016, 12:52
 
Fecha de Ingreso: mayo-2003
Ubicación: Lima
Mensajes: 967
Antigüedad: 20 años, 11 meses
Puntos: 8
Problema con librería database

Saludos, estoy haciendo una aplicación con CodeIgniter, antes de esa aplicación no he tenido problemas, todo a funcionado muy bien.

En esta aplicación, todo funciona bien, ya estoy por hacer todo lo referente a la base de datos y cuando agrego en el archivo autoload la librería database, luego de configurar el archivo database, quiero ver mi aplicación en http://localhost:81/miaplicacion y ya no sale nada y tampoco sale errores.

Cuando lo subo al servidor, ahí si funciona bien. Cual es la razón por la cual en el servidor local no se puede ver?

Espero que me puedan ayudar.

Saludos,
__________________
El aprendiz.
  #2 (permalink)  
Antiguo 04/07/2016, 06:23
Avatar de bymorr  
Fecha de Ingreso: septiembre-2012
Mensajes: 118
Antigüedad: 11 años, 7 meses
Puntos: 9
Respuesta: Problema con librería database

Manda el error que te sale...
manda el archivo autoload.
manda el archivo config.
manda el archivo database
  #3 (permalink)  
Antiguo 04/07/2016, 22:10
 
Fecha de Ingreso: mayo-2003
Ubicación: Lima
Mensajes: 967
Antigüedad: 20 años, 11 meses
Puntos: 8
Respuesta: Problema con librería database

No sale ningún error, a continuación el archivo autoload:
Código PHP:
Ver original
  1. <?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
  2. /*
  3. | -------------------------------------------------------------------
  4. | AUTO-LOADER
  5. | -------------------------------------------------------------------
  6. | This file specifies which systems should be loaded by default.
  7. |
  8. | In order to keep the framework as light-weight as possible only the
  9. | absolute minimal resources are loaded by default. For example,
  10. | the database is not connected to automatically since no assumption
  11. | is made regarding whether you intend to use it.  This file lets
  12. | you globally define which systems you would like loaded with every
  13. | request.
  14. |
  15. | -------------------------------------------------------------------
  16. | Instructions
  17. | -------------------------------------------------------------------
  18. |
  19. | These are the things you can load automatically:
  20. |
  21. | 1. Packages
  22. | 2. Libraries
  23. | 3. Helper files
  24. | 4. Custom config files
  25. | 5. Language files
  26. | 6. Models
  27. |
  28. */
  29.  
  30. /*
  31. | -------------------------------------------------------------------
  32. |  Auto-load Packges
  33. | -------------------------------------------------------------------
  34. | Prototype:
  35. |
  36. |  $autoload['packages'] = array(APPPATH.'third_party', '/usr/local/shared');
  37. |
  38. */
  39.  
  40. $autoload['packages'] = array();
  41.  
  42.  
  43. /*
  44. | -------------------------------------------------------------------
  45. |  Auto-load Libraries
  46. | -------------------------------------------------------------------
  47. | These are the classes located in the system/libraries folder
  48. | or in your application/libraries folder.
  49. |
  50. | Prototype:
  51. |
  52. |   $autoload['libraries'] = array('database', 'session', 'xmlrpc');
  53. */
  54.  
  55. $autoload['libraries'] = array();
  56.  
  57.  
  58. /*
  59. | -------------------------------------------------------------------
  60. |  Auto-load Helper Files
  61. | -------------------------------------------------------------------
  62. | Prototype:
  63. |
  64. |   $autoload['helper'] = array('url', 'file');
  65. */
  66.  
  67. $autoload['helper'] = array('url');
  68.  
  69.  
  70. /*
  71. | -------------------------------------------------------------------
  72. |  Auto-load Config files
  73. | -------------------------------------------------------------------
  74. | Prototype:
  75. |
  76. |   $autoload['config'] = array('config1', 'config2');
  77. |
  78. | NOTE: This item is intended for use ONLY if you have created custom
  79. | config files.  Otherwise, leave it blank.
  80. |
  81. */
  82.  
  83. $autoload['config'] = array();
  84.  
  85.  
  86. /*
  87. | -------------------------------------------------------------------
  88. |  Auto-load Language files
  89. | -------------------------------------------------------------------
  90. | Prototype:
  91. |
  92. |   $autoload['language'] = array('lang1', 'lang2');
  93. |
  94. | NOTE: Do not include the "_lang" part of your file.  For example
  95. | "codeigniter_lang.php" would be referenced as array('codeigniter');
  96. |
  97. */
  98.  
  99. $autoload['language'] = array();
  100.  
  101.  
  102. /*
  103. | -------------------------------------------------------------------
  104. |  Auto-load Models
  105. | -------------------------------------------------------------------
  106. | Prototype:
  107. |
  108. |   $autoload['model'] = array('model1', 'model2');
  109. |
  110. */
  111.  
  112. $autoload['model'] = array();
  113.  
  114.  
  115. /* End of file autoload.php */
  116. /* Location: ./application/config/autoload.php */
__________________
El aprendiz.
  #4 (permalink)  
Antiguo 04/07/2016, 22:14
 
Fecha de Ingreso: mayo-2003
Ubicación: Lima
Mensajes: 967
Antigüedad: 20 años, 11 meses
Puntos: 8
Respuesta: Problema con librería database

Archivo config:
Código PHP:
Ver original
  1. //Linea 25
  2. $config['base_url'] = 'http://localhost:81/directorio/';
  3.  
  4. //Linea 37
  5. $config['index_page'] = '';

Archivo database:
Código PHP:
Ver original
  1. <?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
  2. /*
  3. | -------------------------------------------------------------------
  4. | DATABASE CONNECTIVITY SETTINGS
  5. | -------------------------------------------------------------------
  6. | This file will contain the settings needed to access your database.
  7. |
  8. | For complete instructions please consult the 'Database Connection'
  9. | page of the User Guide.
  10. |
  11. | -------------------------------------------------------------------
  12. | EXPLANATION OF VARIABLES
  13. | -------------------------------------------------------------------
  14. |
  15. |   ['hostname'] The hostname of your database server.
  16. |   ['username'] The username used to connect to the database
  17. |   ['password'] The password used to connect to the database
  18. |   ['database'] The name of the database you want to connect to
  19. |   ['dbdriver'] The database type. ie: mysql.  Currently supported:
  20.                  mysql, mysqli, postgre, odbc, mssql, sqlite, oci8
  21. |   ['dbprefix'] You can add an optional prefix, which will be added
  22. |                to the table name when using the  Active Record class
  23. |   ['pconnect'] TRUE/FALSE - Whether to use a persistent connection
  24. |   ['db_debug'] TRUE/FALSE - Whether database errors should be displayed.
  25. |   ['cache_on'] TRUE/FALSE - Enables/disables query caching
  26. |   ['cachedir'] The path to the folder where cache files should be stored
  27. |   ['char_set'] The character set used in communicating with the database
  28. |   ['dbcollat'] The character collation used in communicating with the database
  29. |                NOTE: For MySQL and MySQLi databases, this setting is only used
  30. |                as a backup if your server is running PHP < 5.2.3 or MySQL < 5.0.7
  31. |                (and in table creation queries made with DB Forge).
  32. |                There is an incompatibility in PHP with mysql_real_escape_string() which
  33. |                can make your site vulnerable to SQL injection if you are using a
  34. |                multi-byte character set and are running versions lower than these.
  35. |                Sites using Latin-1 or UTF-8 database character set and collation are unaffected.
  36. |   ['swap_pre'] A default table prefix that should be swapped with the dbprefix
  37. |   ['autoinit'] Whether or not to automatically initialize the database.
  38. |   ['stricton'] TRUE/FALSE - forces 'Strict Mode' connections
  39. |                           - good for ensuring strict SQL while developing
  40. |
  41. | The $active_group variable lets you choose which connection group to
  42. | make active.  By default there is only one group (the 'default' group).
  43. |
  44. | The $active_record variables lets you determine whether or not to load
  45. | the active record class
  46. */
  47.  
  48. $active_group = 'default';
  49. $active_record = TRUE;
  50.  
  51. $db['default']['hostname'] = 'localhost';
  52. $db['default']['username'] = 'root';
  53. $db['default']['password'] = 'KadMi@2015';
  54. $db['default']['database'] = 'directorio';
  55. $db['default']['dbdriver'] = 'mysql';
  56. $db['default']['dbprefix'] = '';
  57. $db['default']['pconnect'] = TRUE;
  58. $db['default']['db_debug'] = TRUE;
  59. $db['default']['cache_on'] = FALSE;
  60. $db['default']['cachedir'] = '';
  61. $db['default']['char_set'] = 'utf8';
  62. $db['default']['dbcollat'] = 'utf8_general_ci';
  63. $db['default']['swap_pre'] = '';
  64. $db['default']['autoinit'] = TRUE;
  65. $db['default']['stricton'] = FALSE;
  66.  
  67.  
  68. /* End of file database.php */
  69. /* Location: ./application/config/database.php */
__________________
El aprendiz.

Etiquetas: database
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 20:37.