Foros del Web » Programando para Internet » PHP »

Ayuda urgente!!! PHP.INI

Estas en el tema de Ayuda urgente!!! PHP.INI en el foro de PHP en Foros del Web. Hola, estoy verdaderamente desesperado por que ya sea que diseñe o baje algún script que incluya un sistema para autentificar usuarios, cuando meto los datos ...
  #1 (permalink)  
Antiguo 10/05/2005, 12:34
 
Fecha de Ingreso: abril-2005
Mensajes: 50
Antigüedad: 21 años, 5 meses
Puntos: 0
Ayuda urgente!!! PHP.INI

Hola, estoy verdaderamente desesperado por que ya sea que diseñe o baje algún script que incluya un sistema para autentificar usuarios, cuando meto los datos (usuario/contraseña) nunca puedo ir más allá de la página de entrada (login).

Es decir, cuando son incorrectos si me muestra el error diciendo que los datos no son los apropiados, pero cuando meto los correctos y pongo enviar, la página se carga de nuevo pero nunca nunca me redirecciona a la página correcta, en este caso la de administración.

No es problema con el script por que definitivamente no puede haber tantos scripts mal escritos, ya que la mayoría con los que he probado este error los he bajado de hotscripts, como el de Cluster por ejemplo.

En este sentido debe de ser algo relacionado con mi php.ini (tal vez en la sección de sesiones o algo por el estilo) pero soy relativamente nuevo en esto y ya no se que más cambiar. Ojalá alguien me pueda ayudar a resolver este problema.

Saludos y gracias de antemano

PD: Utilizo PHP 5.0.3, Apache 2.0.53 y WinXP, y pruebo los scripts en localhost.

php.ini ------------ (sólo la parte relacionada con sesiones por que es donde me late que esta el error. El session_save_path si funciona)

Código PHP:
[Session]
; 
Handler used to store/retrieve data.
session.save_handler = files

; Argument passed to save_handler.  In the case of files, this is the path
; where data files are stored. Note: Windows users have to change this
; variable in order to use PHP's session functions.
;
; As of PHP 4.0.1, you can define the path as:
;
; session.save_path = "N;/path"
;
; where N is an integer.  Instead of storing all the session files in
; /path, what this will do is use subdirectories N-levels deep, and
; store the session data in those directories.  This is useful if you
; or your OS have problems with lots of files in one directory, and is
; a more efficient layout for servers that handle lots of sessions.
;
; NOTE 1: PHP will not create this directory structure automatically.
;         You can use the script in the ext/session dir for that purpose.
; NOTE 2: See the section on garbage collection below if you choose to
;         use subdirectories for session storage
;
; The file storage module creates files using mode 600 by default.
; You can change that by using
;
;     session.save_path = "N;MODE;/path"
;
; where MODE is the octal representation of the mode. Note that this
; does not overwrite the process'
s umask.
session.save_path = "c:\Temp"

; Whether to use cookies.
session.use_cookies = 1

; This option enables administrators to make their users invulnerable to
; attacks which involve passing session ids in URLs; defaults to 0.
session
.use_only_cookies = 1

; Name of the session (used as cookie name).
session.name = PHPSESSID

; Initialize session on request startup.
session.auto_start = 0

; Lifetime in seconds of cookie or, if 0, until browser is restarted.
session.cookie_lifetime = 0

; The path for which the cookie is valid.
session.cookie_path = 

; 
The domain for which the cookie is valid.
session.cookie_domain =

; 
Handler used to serialize data.  php is the standard serializer of PHP.
session.serialize_handler = php

; Define the probability that the 'garbage collection' process is started
; on every session initialization.
; 
The probability is calculated by using gc_probability/gc_divisor,
; 
e.g. 1/100 means there is a 1% chance that the GC process starts
; on each request.

session.gc_probability = 1
session
.gc_divisor     = 1000

; After this number of seconds, stored data will be seen as 'garbage' and
; 
cleaned up by the garbage collection process.
session.gc_maxlifetime = 1440

; NOTE: If you are using the subdirectory option for storing session files
;       (see session.save_path above), then garbage collection does *not*
;       
happen automatically.  You will need to do your own garbage
;       collection through a shell script, cron entry, or some other method.
;       For 
example, the following script would is the equivalent of
;       setting session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes):
;          
cd /path/to/sessions; find -cmin +24 | xargs rm

; PHP 4.2 and less have an undocumented feature/bug that allows you to
; to initialize a session variable in the global scope, albeit register_globals
; is disabled.  PHP 4.3 and later will warn you, if this feature is used.
; 
You can disable the feature and the warning separately. At this time,
; 
the warning is only displayed, if bug_compat_42 is enabled.

session.bug_compat_42 = 0
session
.bug_compat_warn = 1

; Check HTTP Referer to invalidate externally stored URLs containing ids.
; 
HTTP_REFERER has to contain this substring for the session to be
; considered as valid.
session.referer_check =

; 
How many bytes to read from the file.
session.entropy_length = 0

; Specified here to create the session id.
session.entropy_file =

;
session.entropy_length = 16

;session.entropy_file = /dev/urandom

; Set to {nocache,private,public,} to determine HTTP caching aspects
; or leave this empty to avoid sending anti-caching headers.
session.cache_limiter = nocache

; Document expires after n minutes.
session.cache_expire = 180

; trans sid support is disabled by default.
; Use 
of trans sid may risk your users security.
; Use 
this option with caution.
; - 
User may send URL contains active session ID
;   to other person via. email/irc/etc.
; - 
URL that contains active session ID may be stored
;   in publically accessible computer.
; - 
User may access your site with the same session ID
;   always using URL stored in browsers history or bookmarks.
session.use_trans_sid = 1

; Select a hash function
; 
0: MD5   (128 bits)
; 
1: SHA-1 (160 bits)
session.hash_function = 0


; Define how many bits are stored in each character when converting
; the binary hash data to something readable.
;
; 
4 bits: 0-9, a-f
; 5 bits: 0-9, a-v
; 6 bits: 0-9, a-z, A-Z, "-", ","
session.hash_bits_per_character = 5

; The URL rewriter will look for URLs in a defined set of HTML tags.
; 
form/fieldset are special; if you include them here, the rewriter will
; add a hidden <input> field with the info which is otherwise appended
; to URLs.  If you want XHTML conformity, remove the form entry.
; 
Note that all valid entries require a "=", even if no value follows.
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry" 
  #2 (permalink)  
Antiguo 10/05/2005, 12:39
Avatar de lado2mx
Colaborador
 
Fecha de Ingreso: agosto-2001
Ubicación: Veracruz
Mensajes: 3.720
Antigüedad: 25 años, 1 mes
Puntos: 9
No es que sea dificil, pero luego resulta muy cañon checar si esos códigos prefabricados funcionen a la perfección, y más si son formatos BETA o ALPHA. Checa muy bien, y al parecer no creo que sea el php.ini, sino una rutina mal checada por ese código que tienes
  #3 (permalink)  
Antiguo 10/05/2005, 12:50
 
Fecha de Ingreso: abril-2005
Mensajes: 50
Antigüedad: 21 años, 5 meses
Puntos: 0
Register Globals

Hola, no en verdad es un hecho que es php.ini ya que también lo he probado con el código de varios libros. Se me ocurrió que también podría ser algo relacionado con php.ini en la parte de data handling ya que, aunque no se recomienda puse register_globals en on y si pude entrar a zona de administración del script, pero el problema es que cada que doy click en alguna opción me regresa al login como si nunca lo hubiera hecho además de que es mejor tener esta opción en Off.

Saludos


A continuación pongo los datos de mi php.ini en esa parte:

Código PHP:
;;;;;;;;;;;;;;;;;
; 
Data Handling ;
;;;;;;;;;;;;;;;;;
;
; 
Note - track_vars is ALWAYS enabled as of PHP 4.0.3

; The separator used in PHP generated URLs to separate arguments.
; Default 
is "&".
;
arg_separator.output = "&amp;"

; List of separator(s) used by PHP to parse input URLs into variables.
; Default 
is "&".
; 
NOTE: Every character in this directive is considered as separator!
;
arg_separator.input = ";&"

; This directive describes the order in which PHP registers GET, POST, Cookie,
; 
Environment and Built-in variables (G, P, C, E & S respectively, often
; referred to as EGPCS or GPC).  Registration is done from left to right, newer
; values override older values.
variables_order = "GPCS"

; Whether or not to register the EGPCS variables as global variables.  You may
; want to turn this off if you don't want to clutter your scripts' global scope
; with user data.  This makes most sense when coupled with track_vars - in which
; case you can access all of the GPC variables through the $HTTP_*_VARS[],
; 
variables.
;
; 
You should do your best to write your scripts so that they do not require
; 
register_globals to be on;  Using form variables as globals can easily lead
; to possible security problems, if the code is not very well thought of.
register_globals = Off

; Whether or not to register the old-style input arrays, HTTP_GET_VARS
; and friends.  If you're not using them, it's recommended to turn them off,
; for 
performance reasons.
register_long_arrays = Off

; This directive tells PHP whether to declare the argv&argc variables (that
; would contain the GET information).  If you dont use these variables, you
; should turn it off for increased performance.
register_argc_argv = Off

; Maximum size of POST data that PHP will accept.
post_max_size = 8M 
  #4 (permalink)  
Antiguo 10/05/2005, 13:04
O_O
 
Fecha de Ingreso: enero-2002
Ubicación: Santiago - Chile
Mensajes: 34.417
Antigüedad: 24 años, 8 meses
Puntos: 129
Lo que es mi script concreto ("Autentificator") indentifica con su código de error correspondiente (Error cod. 2) por ejemplo problemas con sesiones del estilo "no se ha podido crear o continuar con la iniciada".

Sobre tu php.ini .. poco más decirte que fuerza y obliga la propagación del SID (Identificador Único de sesión de lo cual se basa todoooooo el sistema de sesiones de PHP) por cookies .. Eso implica que tu navegador de pruebas debe aceptar tus cookies, así que revisa tu nivel de "seguridad" .. o si usas algún antivirus/proxy/firewall .. como está actuando estos con respecto a cookies ..por qué parece que alguno de ellos está bloqueando la cookie que PHP genera.


Un saludo,
  #5 (permalink)  
Antiguo 10/05/2005, 13:25
Avatar de Klon22
Colaborador
 
Fecha de Ingreso: septiembre-2004
Ubicación: México DF- La Cd + Poblad
Mensajes: 2.052
Antigüedad: 22 años
Puntos: 5
Algo que no me dí cuenta es que base de datos estas usando en tu local host, ya que puede estar fallando la conexión con esta y por ello podría ser una causa del error.
__________________
Hosting|
Protege a tu hijos - mira este documental Recomendado!
  #6 (permalink)  
Antiguo 10/05/2005, 13:28
Avatar de Neuron_376  
Fecha de Ingreso: abril-2005
Mensajes: 1.051
Antigüedad: 21 años, 5 meses
Puntos: 2
Hola!

En el PHP.INI me parece que no se encarga de Autentificar nada, creo que es en el httpd.conf de Apache si no me equivoco, con los archivos de .htaccces
__________________
NeuronaNet.com... la idea correcta.
http://www.NeuronaNet.com
  #7 (permalink)  
Antiguo 10/05/2005, 13:33
 
Fecha de Ingreso: abril-2005
Mensajes: 50
Antigüedad: 21 años, 5 meses
Puntos: 0
Mensaje

Hola, uso MySQL, pero no es la conexión a la base de datos por que si me funciona en todo lo demás es únicamente en los scripts de registro que tengo este problema.

Cluster: en efecto al utilizar autentificator me aparece:
Error cod.: 2 - Acceso incorrecto!
cuando pongo admin/admin

En cuanto a firewall, detecté que mi modem inalámbrico (2Wire) me instala uno por default que es muy molesto, lo desactivé pero el problema en el caso de tu script siguió siendo el mismo; y en los demás también...

Lo mismo con mi navegador de prueba (IE 6) lo puse en la opción más baja de seguridad en cuanto a cookies.

¿Cómo entonces debo de configurar las opciones de mi php.ini en cuanto a sesiones (SID) y data handling? ¿Pudiste detectar algún error?

Un saludo, bueno dos

Gracias
  #8 (permalink)  
Antiguo 10/05/2005, 14:26
O_O
 
Fecha de Ingreso: enero-2002
Ubicación: Santiago - Chile
Mensajes: 34.417
Antigüedad: 24 años, 8 meses
Puntos: 129
Yo uso una configuración de PHP.ini tal cual la usas tu en la intranet que desarrollo para mi trabajo .. (fuerzo el uso de cookies sólo para la propagación del SID: session.use_only_cookies = ON como tu lo usas). No tengo más problemas con sesiones, por qué acepto las cookies que me genera PHP (de hecho si subo los niveles de seguridad y privacidad de IE6 (tambien probado en IE 5.5) tengo problemas (normales) por la propagación del SID .. en realidad por la "creación" de esa cookie.

Un saludo,
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 05:25.