Foros del Web » Programando para Internet » PHP »

Problemas PHP en localhost

Estas en el tema de Problemas PHP en localhost en el foro de PHP en Foros del Web. Saludos, Tengo instalado WAMP con su configuración por defecto y estoy teniendo algunos problemas... Por ejemplo estoy intentando correr mename, que como sabéis es de ...
  #1 (permalink)  
Antiguo 05/11/2008, 16:49
 
Fecha de Ingreso: octubre-2008
Mensajes: 93
Antigüedad: 15 años, 6 meses
Puntos: 1
Saludos,

Tengo instalado WAMP con su configuración por defecto y estoy teniendo algunos problemas...

Por ejemplo estoy intentando correr mename, que como sabéis es de código libre, y me funciona perfectamente en el servidor de Dreamhost, pero no em mi localhost.

Al abrir el indice me sale texto plano en lugar de cargar la pagina como tendría que hacer... ¿puede ser que tenga que activar algunas funciones d ephp que vengan desactivadas por defecto?

De ser asi.. cuales son las que tengo que cambiar para que todo funcione OK¿?

Por ejemplo me he fijado que en local no me funcionan bien los codigo que empiezan con <?... en vez de <?php...

Aunque puden ser mil cosas...

Gracias por adelantado

Cuando digo texto plano me refiero que me imprime por pantalla el texto del código.... no el texto de la página sin estilo, que evidentemente tampoco tiene.

Última edición por GatorV; 05/11/2008 a las 17:19
  #2 (permalink)  
Antiguo 05/11/2008, 17:19
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: Problemas PHP en localhost

Si necesitas habilitar las etiquetas <? ve la directiva en el php.ini se llama short_open_tags.

Saludos
  #3 (permalink)  
Antiguo 05/11/2008, 17:49
 
Fecha de Ingreso: octubre-2008
Mensajes: 93
Antigüedad: 15 años, 6 meses
Puntos: 1
Respuesta: Problemas PHP en localhost

Gracias ya lo he modificado... pero todo sigue igual.

El problema parece ser que al leerse el codigo, se agregan puntos "." donde no deberían.

Por ejemplo, al cargar la pagina se lee:

. // It's licensed under the AFFERO GENERAL PUBLIC LICENSE unless stated otherwise. // You can get copies of the licenses here: // http://www.affero.org/oagpl.html // AFFERO GENERAL PUBLIC LICENSE is also included in the file called "COPYING". include('config.php'); include(mnminclude.'html1.php'); include(mnminclude.'link.php'); meta_get_current(); $page_size = 20; $offset=(get_current_page()-1)*$page_size; $globals['ads'] = true; $cat=$_REQUEST['category']; do_header(_('últimas publicadas') . ' | menéame'); do_tabs('main','published');

Ese punto creo que hace que no se lea la cabecera como un comentario, y provoca que el código se rompa.

¿A que puede ser debido?


Código PHP:
do_header(_('últimas publicadas') . ' | meneame');
do_tabs('main','published');
if (
$globals['meta_current'] > 0) {
    
$from_where "FROM links WHERE link_status='published' and link_category in (".$globals['meta_categories'].") ";
    
print_index_tabs(); // No other view
} elseif ($current_user->user_id 0) { // Check authenticated users
    
switch ($globals['meta']) {
        case 
'_personal':
            
$from_time '"'.date("Y-m-d H:00:00"$globals['now'] - $globals['time_enabled_comments']).'"';
            
$from_where "FROM links WHERE link_date > $from_time and link_status='published' and link_category in (".$globals['meta_categories'].") ";
            
//$from_where = "FROM links WHERE link_status='published' and link_category in (".$globals['meta_categories'].") ";
            
print_index_tabs(7); // Show "personal" as default
            
break;
        case 
'_friends':
            
$from_time '"'.date("Y-m-d H:00:00"$globals['now'] - 86400*4).'"';
            
$from_where "FROM links, friends WHERE link_date >  $from_time and link_status='published' and friend_type='manual' and friend_from = $current_user->user_id and friend_to=link_author and friend_value > 0";
            
print_index_tabs(1); // Friends
        
break;
        default:
            
print_index_tabs(0); // All
            
$from_where "FROM links WHERE link_status='published' ";
    }
} else {
    
print_index_tabs(0); // No other view
    
$from_where "FROM links WHERE link_status='published' ";

A partir de "if ($globals['meta_current'] > 0) {"

La página da error, me muestra por pantalla el "0){" y todo el codigo que sigue...

QUE HAGOOOOO ?¿

Última edición por hinfra; 05/11/2008 a las 18:00
  #4 (permalink)  
Antiguo 05/11/2008, 18:04
Avatar de masterojitos  
Fecha de Ingreso: julio-2008
Ubicación: Lima Callao Chucuito
Mensajes: 1.931
Antigüedad: 15 años, 9 meses
Puntos: 105
Respuesta: Problemas PHP en localhost

me gustaria ayudarte, pero que haces con esto:
do_header(_('últimas publicadas') . ' | meneame');
do_tabs('main','published');

?????
__________________
Atte. MasterOjitos :ojotes:
Todo sobre Programación Web
Las ultimas tendencias en Efectos y Recursos Web: MasterOjitos Blog
  #5 (permalink)  
Antiguo 05/11/2008, 19:04
 
Fecha de Ingreso: octubre-2008
Mensajes: 93
Antigüedad: 15 años, 6 meses
Puntos: 1
Respuesta: Problemas PHP en localhost

Me da este error... "Fatal error: Call to undefined function _() in C:\wamp\www\www\libs\utils.php on line 24"


Código php:
Ver original
  1. <?php
  2. // The source code packaged with this file is Free Software, Copyright (C) 2005-2007 by
  3. // Ricardo Galli <gallir at uib dot es>.
  4. // It's licensed under the AFFERO GENERAL PUBLIC LICENSE unless stated otherwise.
  5. // You can get copies of the licenses here:
  6. //      [url]http://www.affero.org/oagpl.html[/url]
  7. // AFFERO GENERAL PUBLIC LICENSE is also included in the file called "COPYING".
  8.  
  9.  
  10. // Use proxy detecttion
  11. if ($globals['check_behind_proxy']) {
  12.     require_once(mnminclude.'check_behind_proxy.php');
  13.     $globals['user_ip'] = check_ip_behind_proxy();
  14. } else {
  15.     $globals['user_ip'] = $_SERVER["REMOTE_ADDR"];
  16. }
  17.  
  18. // Warn, we shoud printf "%u" because PHP on 32 bits systems fails with high unsigned numbers
  19. $globals['user_ip_int'] = sprintf("%u", ip2long($globals['user_ip']));
  20.  
  21. $globals['now'] = time();
  22.  
  23. $globals['negative_votes_values'] = Array ( -1 => _('irrelevante'), -2 => _('antigua'), -3 => _('cansina'), -4 => _('amarillista'), -5 => _('spam'), -6 => _('duplicada'), -7 => _('provocación'), -8 => _('errónea'),  -9 => _('copia/plagio'));
  24.  
  25.  
  26. $globals['extra_js'] = Array();
  27. $globals['extra_css'] = Array();
  28. $globals['post_js'] = Array();
  29.  
  30. // For PHP < 5
  31. if ( !function_exists('htmlspecialchars_decode') ) {
  32.     function htmlspecialchars_decode($text) {
  33.         return strtr($text, array_flip(get_html_translation_table(HTML_SPECIALCHARS)));
  34.     }
  35. }
  36. ...
  37. y el codigo sigue...

Es algo del php.ini seguro... porque todo tendria que funcionar...

AYUDAAAAAAAAAAA
  #6 (permalink)  
Antiguo 05/11/2008, 20:09
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: Problemas PHP en localhost

Hola hinfra, _() es un alias para gettext, por lo que necesitas habilitar en el php.ini la libreria php_gettext.dll.

Saludos.
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.
Tema Cerrado




La zona horaria es GMT -6. Ahora son las 19:15.