Foros del Web » Programando para Internet » PHP »

php.ini personalizable??

Estas en el tema de php.ini personalizable?? en el foro de PHP en Foros del Web. Hola pues necesito unas funciones php exec() proc_open() "proc_open() has been disabled exec() has been disabled " contacte con mi provedor de hosting pidiendo que ...
  #1 (permalink)  
Antiguo 07/06/2011, 19:18
Avatar de deknisone  
Fecha de Ingreso: marzo-2010
Ubicación: lado obscuro del tiempo
Mensajes: 80
Antigüedad: 14 años, 1 mes
Puntos: 1
php.ini personalizable??

Hola pues necesito unas funciones php
exec()

proc_open()
"proc_open() has been disabled
exec() has been disabled
"

contacte con mi provedor de hosting pidiendo que active esas funciones en el php.ini
y me contestando que usara un php.ini personalizable
lo primero que se me vino a la cabeza ¿donde esta, en que carpeta?
busque en google y llege a aque yo mismo tengo que crearlo topandome con esto
Código:
<?php
// Put all the php.ini parameters you want to change below. One per line.
// Follow the example format $parm[] = "parameter = value";
$parm[] = "register_globals = Off";
$parm[] = "session.use_trans_sid = 0";
$parm[] = "disable_functions ="
// full unix path - location of the default php.ini file at your host
// you can determine the location of the default file using phpinfo()
$defaultPath = "/usr/local/lib/php.ini"; 
// full unix path - location where you want your custom php.ini file
$customPath = "/home/ianimein/public_html/din/php.ini";
// nothing should change below this line.
if (file_exists($defaultPath)) {
  $contents = file_get_contents($defaultPath); 
  $contents .= "\n\n; USER MODIFIED PARAMETERS FOLLOW\n\n";  
  foreach ($parm as $value) $contents .= $value . " \n";
  if (file_put_contents($customPath,$contents)) {
    if (chmod($customPath,0600)) $message = "The php.ini file has been modified and copied";
      else $message = "Processing error - php.ini chmod failed";
  } else {
    $message = "Processing error - php.ini write failed";
  }
} else {
  $message = "Processing error - php.ini file not found";
}
echo $message;
?>
Intente crear mi php.ini personalizable pero tambien pense que las funciones php no tienen un archivo por deafult por asi decir para poder ejecutarlas

Tambien encontre que se pueden emular algunas funciones con .htaccess
¿se pueden emular exec() y proc_open() en un .htacess?

Bueno si alguien me puede ayudar a crear mi php.ini personalizable o a lograr que esas funciones corran se los agradeceria
  #2 (permalink)  
Antiguo 07/06/2011, 19:34
Avatar de GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 18 años
Puntos: 2135
Respuesta: php.ini personalizable??

Solamente crea un php.ini en la raiz de tu carpeta y pon las directivas que necesitas, con eso al ejecutar tu script.php va a leer ese php.ini.

Saludos.
  #3 (permalink)  
Antiguo 07/06/2011, 19:51
Avatar de deknisone  
Fecha de Ingreso: marzo-2010
Ubicación: lado obscuro del tiempo
Mensajes: 80
Antigüedad: 14 años, 1 mes
Puntos: 1
Respuesta: php.ini personalizable??

muchas gracias ya pude ejecutar los procesos =D
si alguien me puede dar las configuraciones de un php.ini para servidor linix para ternelo coompleto
  #4 (permalink)  
Antiguo 07/06/2011, 19:52
Avatar de abimaelrc
Colaborador
 
Fecha de Ingreso: mayo-2009
Ubicación: En el planeta de Puerto Rico
Mensajes: 14.734
Antigüedad: 15 años
Puntos: 1517
Respuesta: php.ini personalizable??

Te recomiendo que coloques lo que hiciste, tal vez en el futuro haya alguien que le sirva
__________________
Verifica antes de preguntar.
Los verdaderos amigos se hieren con la verdad, para no perderlos con la mentira. - Eugenio Maria de Hostos
  #5 (permalink)  
Antiguo 07/06/2011, 20:39
Avatar de deknisone  
Fecha de Ingreso: marzo-2010
Ubicación: lado obscuro del tiempo
Mensajes: 80
Antigüedad: 14 años, 1 mes
Puntos: 1
Respuesta: php.ini personalizable??

Cita:
Iniciado por abimaelrc Ver Mensaje
Te recomiendo que coloques lo que hiciste, tal vez en el futuro haya alguien que le sirva

muy bien
en la carpeta de mi scrip cree un nuevo archivo y lo renombre "php.ini"
abri el archivo y coloque la siguientes lineas
Código PHP:
Ver original
  1. ; Safe Mode
  2. ; http://php.net/safe-mode
  3. safe_mode = Off
  4.  
  5. ; By default, Safe Mode does a UID compare check when
  6. ; opening files. If you want to relax this to a GID compare,
  7. ; then turn on safe_mode_gid.
  8. ; http://php.net/safe-mode-gid
  9. safe_mode_gid = Off
  10.  
  11. ; When safe_mode is on, UID/GID checks are bypassed when
  12. ; including files from this directory and its subdirectories.
  13. ; (directory must also be in include_path or full path must
  14. ; be used when including)
  15. ; http://php.net/safe-mode-include-dir
  16. safe_mode_include_dir =
  17.  
  18. ; When safe_mode is on, only executables located in the safe_mode_exec_dir
  19. ; will be allowed to be executed via the exec family of functions.
  20. ; http://php.net/safe-mode-exec-dir
  21. safe_mode_exec_dir =
  22.  
  23. ; Setting certain environment variables may be a potential security breach.
  24. ; This directive contains a comma-delimited list of prefixes.  In Safe Mode,
  25. ; the user may only alter environment variables whose names begin with the
  26. ; prefixes supplied here.  By default, users will only be able to set
  27. ; environment variables that begin with PHP_ (e.g. PHP_FOO=BAR).
  28. ; Note:  If this directive is empty, PHP will let the user modify ANY
  29. ;   environment variable!
  30. ; http://php.net/safe-mode-allowed-env-vars
  31. safe_mode_allowed_env_vars = PHP_

abri la direcion de mi scrip en el navegador ya puede ejcutar los procesos que necesitaba

Etiquetas: Ninguno
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 07:22.