• Viernes 3 de Mayo de 2024, 14:02

Autor Tema:  Php Sessiones  (Leído 1816 veces)

ing_marco

  • Miembro MUY activo
  • ***
  • Mensajes: 263
    • Ver Perfil
Php Sessiones
« en: Sábado 13 de Agosto de 2005, 18:40 »
0
Mi problema es que no puedo iniciar una session en el PHP, para descartar otros problemas solo trato de ejecutar una pagina con el siguiente codigo

<?php
session_start();
?>

Y me bota este error:
php.exe a detectado un problema y debe cerrarse

Ademas ese error:

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, jose@localhost.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.
MARCO DIAZ
Ing_Marco
Bachiller Ing de Sistemas.
UNT
Trujillo-Peru

gnfrs

  • Miembro MUY activo
  • ***
  • Mensajes: 195
    • Ver Perfil
    • http://www.laguns.com.ar/
Re: Php Sessiones
« Respuesta #1 en: Domingo 14 de Agosto de 2005, 00:27 »
0
Hola, seguramente es problema de la configuración de PHP, si lo instalaste con un programa volvelo a instalar, si lo instalaste a mano, fijate en las directivas de configuración del archivo PHP.ini

Saludos.
Gabriel S. Luraschi

·· Videos de Guns and Roses LAGUNS - Banda tributo a Guns N' Roses ··

.

ing_marco

  • Miembro MUY activo
  • ***
  • Mensajes: 263
    • Ver Perfil
Re: Php Sessiones
« Respuesta #2 en: Domingo 14 de Agosto de 2005, 02:29 »
0
Pues el problema parece algo de la configuracion, pero no se mucho de la configuracion, si me podrias decir donde o que lineas verificar, estaria mas que agradecido.
MARCO DIAZ
Ing_Marco
Bachiller Ing de Sistemas.
UNT
Trujillo-Peru

gnfrs

  • Miembro MUY activo
  • ***
  • Mensajes: 195
    • Ver Perfil
    • http://www.laguns.com.ar/
Re: Php Sessiones
« Respuesta #3 en: Domingo 14 de Agosto de 2005, 05:04 »
0
Te paso toda la configuración que tengo ahora en PHP.INI pero sólo la parte de las sesiones.

Código: Text
  1. [Session]
  2. ; Handler used to store/retrieve data.
  3. session.save_handler = files
  4.  
  5. ; Argument passed to save_handler.  In the case of files, this is the path
  6. ; where data files are stored. Note: Windows users have to change this
  7. ; variable in order to use PHP's session functions.
  8. session.save_path = &#34;D:&#092;Nacho&#092;Gaby&#092;Intranet&#092;tmp&#092;&#34;
  9.  
  10. ; Whether to use cookies.
  11. session.use_cookies = 1
  12.  
  13. ; This option enables administrators to make their users invulnerable to
  14. ; attacks which involve passing session ids in URLs; defaults to 0.
  15. ; session.use_only_cookies = 1
  16.  
  17. ; Name of the session (used as cookie name).
  18. session.name = PHPSESSID
  19.  
  20. ; Initialize session on request startup.
  21. session.auto_start = 0
  22.  
  23. ; Lifetime in seconds of cookie or, if 0, until browser is restarted.
  24. session.cookie_lifetime = 0
  25.  
  26. ; The path for which the cookie is valid.
  27. session.cookie_path = /
  28.  
  29. ; The domain for which the cookie is valid.
  30. session.cookie_domain =
  31.  
  32. ; Handler used to serialize data.  php is the standard serializer of PHP.
  33. session.serialize_handler = php
  34.  
  35. ; Define the probability that the 'garbage collection' process is started
  36. ; on every session initialization.
  37. ; The probability is calculated by using gc_probability/gc_divisor,
  38. ; e.g. 1/100 means there is a 1% chance that the GC process starts
  39. ; on each request.
  40.  
  41. session.gc_probability = 1
  42. session.gc_divisor     = 1000
  43.  
  44. ; After this number of seconds, stored data will be seen as 'garbage' and
  45. ; cleaned up by the garbage collection process.
  46. session.gc_maxlifetime = 1440
  47.  
  48. ; PHP 4.2 and less have an undocumented feature/bug that allows you to
  49. ; to initialize a session variable in the global scope, albeit register_globals
  50. ; is disabled.  PHP 4.3 and later will warn you, if this feature is used.
  51. ; You can disable the feature and the warning seperately. At this time,
  52. ; the warning is only displayed, if bug_compat_42 is enabled.
  53.  
  54. session.bug_compat_42 = 0
  55. session.bug_compat_warn = 1
  56.  
  57. ; Check HTTP Referer to invalidate externally stored URLs containing ids.
  58. ; HTTP_REFERER has to contain this substring for the session to be
  59. ; considered as valid.
  60. session.referer_check =
  61.  
  62. ; How many bytes to read from the file.
  63. session.entropy_length = 0
  64.  
  65. ; Specified here to create the session id.
  66. session.entropy_file =
  67.  
  68. ;session.entropy_length = 16
  69.  
  70. ;session.entropy_file = /dev/urandom
  71.  
  72. ; Set to {nocache,private,public,} to determine HTTP caching aspects.
  73. ; or leave this empty to avoid sending anti-caching headers.
  74. session.cache_limiter = nocache
  75.  
  76. ; Document expires after n minutes.
  77. session.cache_expire = 180
  78.  
  79. ; trans sid support is disabled by default.
  80. ; Use of trans sid may risk your users security.
  81. ; Use this option with caution.
  82. ; - User may send URL contains active session ID
  83. ;   to other person via. email/irc/etc.
  84. ; - URL that contains active session ID may be stored
  85. ;   in publically accessible computer.
  86. ; - User may access your site with the same session ID
  87. ;   always using URL stored in browser's history or bookmarks.
  88. session.use_trans_sid = 0
  89.  
  90. ; The URL rewriter will look for URLs in a defined set of HTML tags.
  91. ; form/fieldset are special; if you include them here, the rewriter will
  92. ; add a hidden &#60;input&#62; field with the info which is otherwise appended
  93. ; to URLs.  If you want XHTML conformity, remove the form entry.
  94. ; Note that all valid entries require a &#34;=&#34;, even if no value follows.
  95. url_rewriter.tags = &#34;a=href,area=href,frame=src,input=src,form=fakeentry&#34;
  96.  
Gabriel S. Luraschi

·· Videos de Guns and Roses LAGUNS - Banda tributo a Guns N' Roses ··

.

hachicito

  • Nuevo Miembro
  • *
  • Mensajes: 17
    • Ver Perfil
Re: Php Sessiones
« Respuesta #4 en: Lunes 22 de Agosto de 2005, 17:17 »
0
Bueno, ACABO DE VER TU PHP.INI

no se que version de php tienes?

pero para usar sesssion_start() debes habilitar el session.auto_start en 1

bueno, yo uso el php 4.40 y la verdad que su php.ini es mas grande
deberias ver las opciones de este archivo y configurarlo.

otra cosa tambien puedes habilitar $register_global en ON, esto te evitara problemas con el acceso a variables globales


Weno Droger espero que te sirva

Harold Valdivia Garcia
hachicito@yahoo.es

gnfrs

  • Miembro MUY activo
  • ***
  • Mensajes: 195
    • Ver Perfil
    • http://www.laguns.com.ar/
Re: Php Sessiones
« Respuesta #5 en: Sábado 27 de Agosto de 2005, 00:37 »
0
Te corrijo unas cosas:

1 - REGISTER GLOBALS es recomendable dejarlo en OFF, fijate en http://www.php.net.

Por qué ? Te explico, si lo dejás en ON cómo sabés si una variable viene de GET o POST ? Es un agujero de seguridad dejarlo así, te podrían hacer desastres con tu página.

2 -
Citar
pero para usar sesssion_start() debes habilitar el session.auto_start en 1

Esto es totalmente falso. session.auto_start inicia sesión automáticamente al iniciar cualquier script PHP. Esto no es conveniente, ya que muchas veces es necesario no iniciar sesión directamente, por ejemplo al enviar objetos serializados a la sesión.

Saludos.-
Gabriel S. Luraschi

·· Videos de Guns and Roses LAGUNS - Banda tributo a Guns N' Roses ··

.