Précédent   Forum des professionnels en informatique > PHP > Langage > Syntaxe
Syntaxe Forum d'entraide sur la syntaxe de PHP et la POO. Avant de poster -> FAQ syntaxe, Cours d'initiation et cours de POO
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 27/01/2012, 19h12   #1
Débutant
 
Avatar de ETVigan
 
Homme Esteban
Conseil - Consultant en systèmes d'information
Inscription : avril 2010
Messages : 632
Détails du profil
Informations personnelles :
Nom : Homme Esteban
Localisation : France, Gard (Languedoc Roussillon)

Informations professionnelles :
Activité : Conseil - Consultant en systèmes d'information
Secteur : Finance

Informations forums :
Inscription : avril 2010
Messages : 632
Points : 122
Points : 122
Envoyer un message via MSN à ETVigan Envoyer un message via Skype™ à ETVigan
Par défaut Pb syntaxe chez OVH mais OK sous Apache

Bonsoir,
Je travaille sous APACHE 2.2.18, PHP 5.3.8 et mySql5.xx.
Sous apache, la page de mon site est ok, rien de spécial dans le log...

Chez OVH, j'attrape le message de "syntaxe error" suivant:
Code :
1
2
3

Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /homez.231/jecrapah/www/class/setscreen.php on line 9
Je ne trouve rien dans ma classe setScreen dont voici le code:
Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
<?php
$ptr_sessions = session_start() ;
// -------------------------------------------------------------------------------------------------------------------------------------------------------- //
require_once $_SERVER["DOCUMENT_ROOT"] . "/class/nucleus.php" ;
require_once $_SERVER["DOCUMENT_ROOT"] . "/config/equate.php" ;
// -------------------------------------------------------------------------------------------------------------------------------------------------------- //
class myIterator {	
//
==> line 9 private $debug, $start, $end, $curr ;

/**
* Constructor
*
*/	
	function __construct($start=0,$end=0,$debug=false)
	{	$this->debug = $debug = true ;   // $ET
		$this->start = $start ;
		$this->end   = $end ;
		$this->rewind() ; 
		if ($this->debug)
			user_error("__setScreen[__construct]", E_USER_NOTICE) ;
	}

/**
* Destructor
*
*/	
	function __destruct()
	{	  }

/**
* Iterator methods
*
*/	
	function rewind() {
		$this->curr = $this->start ;
	}
	
	function key() {
		return($this->curr) ;
	}
	
	function current() {
		return(pow($this->curr,2)) ;
	}
	
	function next() {
		if ($this->valid())
			$this->curr++ ;
	}
	
	function valid() {
		return( ($this->curr <= $this->end) ? true : false ) ; 
	}
		
/**
* End of Iterator methods
*
*/	
}

class setScreen {	
// -------------------------------------------------------------------------------------------------------------------------------------------------------- //
private 	$debug,  $i ;
private   	$max  ;
protected 	$TBL_screen = array() ;
// -------------------------------------------------------------------------------------------------------------------------------------------------------- //
//								0			1			2		  3			  4			   5		  6			   7		   8
// -------------------------------------------------------------------------------------------------------------------------------------------------------- //
private   	$const = array(	SCREEN 	,	TITLE	,	SUBTITLE ,	FORM 	,	MENU	, 	SUBMENU	,	KLIMSG	, 	MUSTMBER  , BOTTOM  ) ;
private   	$must  = array(   True    ,  	True    ,  	False    ,  True    ,   True    ,	False   ,   True 	,   True 	  , False	) ;
private   	$Ok    = array() ;
private	  	$iter ;
// -------------------------------------------------------------------------------------------------------------------------------------------------------- //
/**
* Constructor
*
*/	
	public function __construct($debug=false)
	{	$this->debug = $debug        ;
		$this->max   =  count($this->must) ;
		if ($this->debug)
			print("+++++++++++construct[setScreen] starting" . CRLF) ;
 		$this->iter = new myIterator(0,$this->max) ; 
			
		$this->cntMust = 0 ;
		for ($i = 0 ; $i < $this->max ; $i++)
		{	$this->Ok[$i][NAME ] = $this->const[$i] ;
			$this->Ok[$i][MUST ] = $this->must [$i] ;
 			$this->Ok[$i][SET]	 = false ;
			if ($this->Ok[$i][MUST ])
				$this->cntMust++ ;
		}
//           
//		Essai avec Iterator
//		===================								
/*
		$this->cntMust = 0 ;
		while( $this->iter->valid() )
		{
			$this->iter->next() ;
		}
*/
	}
	
/**
* Destructor
*
*/	
	public function __destruct()
	{	if ($this->debug)
			print("+++++++++++Destruct[setScreen]" . CRLF) ;  
	}
	
/**
* Executor
*
*/	
	public function execute()
	{	if ($this->debug)
			print("+++++++++++executing[setScreen] started" . CRLF) ;
			
		try {	
				if ($this->debug)
					print("+++++++++++construct[setScreen] started" . CRLF) ;  

				if ($this->validate())
					{	
/**
*               		Si Ok, on appelle le skeleton
*						°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
*/	
						if ($this->debug)
							{	print("Going to Nucleus ......" . CRLF) ;	
								user_error("Going to Nucleus...." , E_USER_NOTICE) ;
 								print_r($this->TBL_screen) ; echo CRLF ;
							}
/**
*						Set some default values...
*
*/
						if (!isset($this->TBL_screen[BOTTOM]))
							$this->TBL_screen[BOTTOM] = NULL ;
						$this->TBL_screen[SITE] = "[Jecrapahute]" ;
//
  						$this->MasterInst = Nucleus::getInstance($this->TBL_screen, $debug=FALSE ) ;
 						$this->MasterInst->execute() ;
					}
			} catch (Exception $E) 
				{ 
			   		throw Nucleus::display_exception($E) ; 
				}
	}
	
/**
* Validation finale, avons-nous tout ce qu'il nous faut ?
*
*/	
	private function validate()
	{	//
		//  check if one MUST screen property is filled
		//  MAYBE, both throw EXECPTIONS are redondant!
		// 	-------------------------------------------
		$must = 0 ;
		for ($i = 0 ; $i < $this->max ; $i++)
		{	if ($this->Ok[$i][MUST])
				if ($this->Ok[$i][SET])
					$must++; 
				else
					throw new EXCEPTION("MUST properpy[".$name."] not set for SCREEN definition") ;
//			else
				
		}
		if ($must < $this->cntMust)
			throw new EXCEPTION("MUST properpy is missing not set for SCREEN definition") ;
		return(true) ;
	}
	
/**
* Validation de l'instruction : __setParam
*
*/	
	public function __setParam($name,$value)
	{	//
		//  check if filled
		//  check for duplicated
		//  check if property recognized
		// 	----------------------------
		if (empty($name))
			{	throw new EXCEPTION("__setParam ERROR - name of property empty for SCREEN definition") ; 
			}
		else
			{	$name = strtoupper($name) ;
				for ($i = 0 ; $i < $this->max ; $i++)
				{	if ( strcmp( strtoupper($this->Ok[$i][NAME]) , $name  ) == 0 )
						if ($this->Ok[$i][SET] == true)
							throw new EXCEPTION("Duplicated variable[".$name."] for SCREEN definition") ;
						else
							{	$this->Ok[$i][NAME]  = $name  ;
								$this->Ok[$i][SET]   = true   ;
					 			$this->Ok[$i][INIT]  = $value ;
								
								//
								//	Construction du tableau associatif à passer au skeleton
								//	=======================================================
								$this->TBL_screen[$name] = $value ;    
								return ;
							} 	
				}
				throw new EXCEPTION("__setParam ERROR - name of property not recognized[".$name."] for __setParam function") ; 
			}
	}
}
?>
Je me doute que PHP cale à partir du moment ou il ne se retrouve plus...
Donc l'erreur pourrait venir d'une erreur dans un require_once antérieur.... VRAI ?

SI nécessaire, je mettrais d'autres fichiers en pièces attachées !
Merci @ceussss qui pourront faire en sorte que je puisse me sortir de ce piège...
__________________
Esteban
ETVigan est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 27/01/2012, 19h47   #2
Membre émérite
 
Avatar de vorace
 
Homme
Développeur
Inscription : août 2010
Messages : 587
Détails du profil
Informations personnelles :
Sexe : Homme
Localisation : France, Meurthe et Moselle (Lorraine)

Informations professionnelles :
Activité : Développeur

Informations forums :
Inscription : août 2010
Messages : 587
Points : 861
Points : 861
quelle version de php as tu chez OVH ?
__________________
Développeur informatique contrarié...
vorace est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 27/01/2012, 19h57   #3
Débutant
 
Avatar de ETVigan
 
Homme Esteban
Conseil - Consultant en systèmes d'information
Inscription : avril 2010
Messages : 632
Détails du profil
Informations personnelles :
Nom : Homme Esteban
Localisation : France, Gard (Languedoc Roussillon)

Informations professionnelles :
Activité : Conseil - Consultant en systèmes d'information
Secteur : Finance

Informations forums :
Inscription : avril 2010
Messages : 632
Points : 122
Points : 122
Envoyer un message via MSN à ETVigan Envoyer un message via Skype™ à ETVigan
Par défaut Pb syntaxe chez OVH mais OK sous Apache

Justement, c'est une question que je leur ai posée mais tjs sans réponse !
Merci quand même...

Esteban
__________________
Esteban
ETVigan est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 27/01/2012, 20h10   #4
Débutant
 
Avatar de ETVigan
 
Homme Esteban
Conseil - Consultant en systèmes d'information
Inscription : avril 2010
Messages : 632
Détails du profil
Informations personnelles :
Nom : Homme Esteban
Localisation : France, Gard (Languedoc Roussillon)

Informations professionnelles :
Activité : Conseil - Consultant en systèmes d'information
Secteur : Finance

Informations forums :
Inscription : avril 2010
Messages : 632
Points : 122
Points : 122
Envoyer un message via MSN à ETVigan Envoyer un message via Skype™ à ETVigan
Par défaut Erreur syntaxe chez PHP et non en local

J'ai essayé sans trop y croire ce que j'ai vu dans le courrier associé à ta réponse :
Code :
1
2
3
4
5
 
private $debug;
 private $start;
private $end;
private $curr ;
Mais cela ne change rien !
On continue à chercher...
Merci quand même
__________________
Esteban
ETVigan est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 28/01/2012, 11h16   #5
Débutant
 
Avatar de ETVigan
 
Homme Esteban
Conseil - Consultant en systèmes d'information
Inscription : avril 2010
Messages : 632
Détails du profil
Informations personnelles :
Nom : Homme Esteban
Localisation : France, Gard (Languedoc Roussillon)

Informations professionnelles :
Activité : Conseil - Consultant en systèmes d'information
Secteur : Finance

Informations forums :
Inscription : avril 2010
Messages : 632
Points : 122
Points : 122
Envoyer un message via MSN à ETVigan Envoyer un message via Skype™ à ETVigan
Par défaut Version PHP local et OVH

Résolu, il a suffit de rajouter un .htaccess avec :
C'est con mais encore suffit(il de la savoir !
Merci @ceusss qui ont lu et m'ont répondu....
__________________
Esteban
ETVigan est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 30/01/2012, 11h08   #6
Modératrice
 
Avatar de Celira
 
Femme
Développeuse PHP/Java
Inscription : avril 2007
Messages : 3 678
Détails du profil
Informations personnelles :
Sexe : Femme
Âge : 27
Localisation : France

Informations professionnelles :
Activité : Développeuse PHP/Java

Informations forums :
Inscription : avril 2007
Messages : 3 678
Points : 5 422
Points : 5 422
Citation:
Envoyé par ETVigan Voir le message
Justement, c'est une question que je leur ai posée mais tjs sans réponse !
Juste pour info, pour connaitre la version de PHP, phpinfo ou simplement phpversion t'aurait donné la réponse
__________________
Modératrice PHP
Aucun navigateur ne propose d'extension boule-de-cristal : postez votre code et vos messages d'erreurs. (Rappel : "ça ne marche pas" n'est pas un message d'erreur)

Pour afficher votre code en couleurs : [CODE=php][/CODE] (bouton # de l'éditeur)
Celira est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 30/01/2012, 11h47   #7
Débutant
 
Avatar de ETVigan
 
Homme Esteban
Conseil - Consultant en systèmes d'information
Inscription : avril 2010
Messages : 632
Détails du profil
Informations personnelles :
Nom : Homme Esteban
Localisation : France, Gard (Languedoc Roussillon)

Informations professionnelles :
Activité : Conseil - Consultant en systèmes d'information
Secteur : Finance

Informations forums :
Inscription : avril 2010
Messages : 632
Points : 122
Points : 122
Envoyer un message via MSN à ETVigan Envoyer un message via Skype™ à ETVigan
Par défaut Version PHP chez OVH

Merci beaucoup mais...
Je ne suis pas sur de moi mais puisqu'il s'agit de PHP5, il faut le fichier .HTACCESS qui manquait de toutes façons et pour rédiger celui-ci, on a besoin de connaître le version de PHP...
L’œuf ou la poule ?

Merci beaucoup de toutes façons.
__________________
Esteban
ETVigan est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 30/01/2012, 11h48   #8
Modérateur
 
Inscription : septembre 2010
Messages : 7 237
Détails du profil
Informations forums :
Inscription : septembre 2010
Messages : 7 237
Points : 8 622
Points : 8 622
Citation:
Envoyé par ETVigan Voir le message
L’œuf ou la poule ?
phpinfo est dans toutes les versions de php
__________________
http://blog.stealth35.com/
stealth35 est actuellement connecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité Cette discussion est résolue.
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 17h06.


 
 
 
 
Partenaires

Hébergement Web