j'ai travaillé un projet sur windows et aujourd'hui je fait copie coller du projet pour travailler sur ubuntu mais au cours du lancement page login (du fosuserBundle) je trouve cette erreur
quelle est la solution et merci d'avance
j'ai travaillé un projet sur windows et aujourd'hui je fait copie coller du projet pour travailler sur ubuntu mais au cours du lancement page login (du fosuserBundle) je trouve cette erreur
quelle est la solution et merci d'avance
Contrairement à Windows, Linux est sensible à la casse (majuscule / minuscule).
Comment fait tu pour appeler le fichier login.html.twig ?
Vérifie qu'il ne manque pas un majuscule ou qu'il n'y en a pas une en trop.
suite au copier - coller , il se peux que certains fichiers sous vendors sont manquants .
Ainsi de préférence , une mise a jour avec composer.phar.
Aussi , sous app/Resources/FOSUserBundle/views/Security , sur que tu as " login.html.twig " .
Vérifie aussi les privilèges des dossiers et fichiers vu que c'est ubuntu.
je résolu le probléme ,il est au cours du cache ( je fait clear le cache et le probléme résolu)
mais je fait la création du schema avec la commande php app/console doctrine:schema:create je trouve cette erreur
[Doctrine\Common\Annotations\AnnotationException]
[Semantical Error] The annotation "@Symfony\Component\validator\Constraints\NotBlank" in property ventenligneBundle\Entity\Media::$na
me does not exist, or could not be auto-loaded.
code:
quelle est la solution ?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 /** * @ORM\Column(type="string",length=255) * @Assert\NotBlank() */ public $name; /** * Get name * * @return \string */ public function getName() { return $this->name; } /** * Set name * * @param string $name * @return Media */ public function setName($name) { $this->name = $name; return $this; }
tu as peut etre oublier
apparemment le code n'est pas bien formaté , les annotations et les étoiles ne sont pas bien placés
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2 use Symfony\Component\Validator\Constraints as Assert;
voici tous le code de la class
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 <?php namespace ventenligneBundle\Entity; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\validator\Constraints as Assert; /** * Media * * @ORM\Table() * @ORM\Entity(repositoryClass="ventenligneBundle\Entity\MediaRepository") * @ORM\HasLifecycleCallbacks */ class Media { /** * @var integer * * @ORM\Column(name="id", type="integer") * @ORM\Id * @ORM\GeneratedValue(strategy="AUTO") */ private $id; /** * @var \DateTime * * @ORM\COlumn(name="updated_at",type="datetime", nullable=true) */ private $updateAt; /** * @ORM\PostLoad() */ public function postLoad() { $this->updateAt = new \DateTime(); } /** * @ORM\Column(type="string",length=255) * @Assert\NotBlank() */ public $name; /** * @ORM\Column(type="string",length=255, nullable=true) */ public $path; public $file; public function getUploadRootDir() { return __dir__.'/../../../web/uploads/produit'; } public function getAbsolutePath() { return null === $this->path ? null : $this->getUploadRootDir().'/'.$this->path; } public function getAssetPath() { return 'uploads/'.$this->path; } /** * @ORM\Prepersist() * @ORM\Preupdate() */ public function preUpload() { $this->tempFile = $this->getAbsolutePath(); $this->oldFile = $this->getPath(); $this->updateAt = new \DateTime(); if (null !== $this->file) $this->path = sha1(uniqid(mt_rand(),true)).'.'.$this->file->guessExtension(); } /** * @ORM\PostPersist() * @ORM\PostUpdate() */ public function upload() { if (null !== $this->file) { $this->file->move($this->getUploadRootDir(),$this->path); unset($this->file); if ($this->oldFile != null) unlink($this->tempFile); } } /** * @ORM\PreRemove() */ public function preRemoveUpload() { $this->tempFile = $this->getAbsolutePath(); } /** * @ORM\PostRemove() */ public function removeUpload() { if (file_exists($this->tempFile)) unlink($this->tempFile); } /** * Get id * * @return integer */ public function getId() { return $this->id; } public function setPath($path) { $this->path = $path; return $this; } /** * Get path * * @return string */ public function getPath() { return $this->path; } /** * Get name * * @return string */ public function getName() { return $this->name; } /** * Set updateAt * * @param \DateTime $updateAt * @return Media */ public function setUpdateAt($updateAt) { $this->updateAt = $updateAt; return $this; } /** * Get updateAt * * @return \DateTime */ public function getUpdateAt() { return $this->updateAt; } /** * Set name * * @param string $name * @return Media */ public function setName($name) { $this->name = $name; return $this; } }
cette discussion traite ton problème,
http://www.developpez.net/forums/d13...oes-not-exist/
voici une autre erreur
[Doctrine\Common\Annotations\AnnotationException]
[Semantical Error] The annotation "@Doctrine\ORM\Mapping\Prepersist" in method ventenligneBundle\Entity\Media::preUpload() does not e
xist, or could not be auto-loaded.
voilà tous le code du entity :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 <?php namespace ventenligneBundle\Entity; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\validator\Constraints as Assert; /** * Media * * @ORM\Table() * @ORM\Entity(repositoryClass="ventenligneBundle\Entity\MediaRepository") * @ORM\HasLifecycleCallbacks */ class Media { /** * @var integer * * @ORM\Column(name="id", type="integer") * @ORM\Id * @ORM\GeneratedValue(strategy="AUTO") */ private $id; /** * @var \DateTime * * @ORM\COlumn(name="updated_at",type="datetime", nullable=true) */ private $updateAt; /** * @ORM\PostLoad() */ public function postLoad() { $this->updateAt = new \DateTime(); } /** * @ORM\Column(type="string",length=255) * @Assert\NotBlank() */ public $name; /** * @ORM\Column(type="string",length=255, nullable=true) */ public $path; public $file; public function getUploadRootDir() { return __dir__.'/../../../web/uploads/produit'; } public function getAbsolutePath() { return null === $this->path ? null : $this->getUploadRootDir().'/'.$this->path; } public function getAssetPath() { return 'uploads/'.$this->path; } /** * @ORM\Prepersist() * @ORM\Preupdate() */ public function preUpload() { $this->tempFile = $this->getAbsolutePath(); $this->oldFile = $this->getPath(); $this->updateAt = new \DateTime(); if (null !== $this->file) $this->path = sha1(uniqid(mt_rand(),true)).'.'.$this->file->guessExtension(); } /** * @ORM\PostPersist() * @ORM\PostUpdate() */ public function upload() { if (null !== $this->file) { $this->file->move($this->getUploadRootDir(),$this->path); unset($this->file); if ($this->oldFile != null) unlink($this->tempFile); } } /** * @ORM\PreRemove() */ public function preRemoveUpload() { $this->tempFile = $this->getAbsolutePath(); } /** * @ORM\PostRemove() */ public function removeUpload() { if (file_exists($this->tempFile)) unlink($this->tempFile); } /** * Get id * * @return integer */ public function getId() { return $this->id; } public function setPath($path) { $this->path = $path; return $this; } /** * Get path * * @return string */ public function getPath() { return $this->path; } /** * Get name * * @return \string */ public function getName() { return $this->name; } /** * Set updateAt * * @param \DateTime $updateAt * @return Media */ public function setUpdateAt($updateAt) { $this->updateAt = $updateAt; return $this; } /** * Get updateAt * * @return \DateTime */ public function getUpdateAt() { return $this->updateAt; } /** * Set name * * @param string $name * @return Media */ public function setName($name) { $this->name = $name; return $this; } }
au lieu de
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5 /** * @ORM\Prepersist() * @ORM\Preupdate() */
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5 /** * @ORM\PrePersist() * @ORM\PreUpdate() */
ca existe ou ca??
Code : Sélectionner tout - Visualiser dans une fenêtre à part PrepPersist
les évènements de cycle de vie ont des appelations bien précises .
je sais pas pourquoi en ubuntu je trouve ce probléme , en windows tous se marche
Partager