IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Symfony PHP Discussion :

Warning: file_get_contents : failed to open stream: No such file or directory


Sujet :

Symfony PHP

  1. #1
    Membre confirmé
    Homme Profil pro
    symfony2
    Inscrit en
    Mars 2016
    Messages
    124
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 32
    Localisation : Tunisie

    Informations professionnelles :
    Activité : symfony2

    Informations forums :
    Inscription : Mars 2016
    Messages : 124
    Par défaut Warning: file_get_contents : failed to open stream: No such file or directory
    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


    Nom : 501546252.png
Affichages : 1875
Taille : 121,0 Ko

    quelle est la solution et merci d'avance

  2. #2
    Membre Expert
    Avatar de Seb33300
    Homme Profil pro
    Développeur Web
    Inscrit en
    Janvier 2007
    Messages
    1 564
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 39
    Localisation : Thaïlande

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Janvier 2007
    Messages : 1 564
    Par défaut
    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.

  3. #3
    Membre émérite
    Homme Profil pro
    Développeur Web
    Inscrit en
    Novembre 2013
    Messages
    739
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Développeur Web

    Informations forums :
    Inscription : Novembre 2013
    Messages : 739
    Par défaut
    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.

  4. #4
    Membre confirmé
    Homme Profil pro
    symfony2
    Inscrit en
    Mars 2016
    Messages
    124
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 32
    Localisation : Tunisie

    Informations professionnelles :
    Activité : symfony2

    Informations forums :
    Inscription : Mars 2016
    Messages : 124
    Par défaut
    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:

    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;
        }
    quelle est la solution ?

  5. #5
    Membre émérite
    Homme Profil pro
    Développeur Web
    Inscrit en
    Novembre 2013
    Messages
    739
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Développeur Web

    Informations forums :
    Inscription : Novembre 2013
    Messages : 739
    Par défaut
    tu as peut etre oublier
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    use Symfony\Component\Validator\Constraints as Assert;
    apparemment le code n'est pas bien formaté , les annotations et les étoiles ne sont pas bien placés

  6. #6
    Membre confirmé
    Homme Profil pro
    symfony2
    Inscrit en
    Mars 2016
    Messages
    124
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 32
    Localisation : Tunisie

    Informations professionnelles :
    Activité : symfony2

    Informations forums :
    Inscription : Mars 2016
    Messages : 124
    Par défaut
    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;
        }
     
     
    }

  7. #7
    Membre émérite
    Homme Profil pro
    Développeur Web
    Inscrit en
    Novembre 2013
    Messages
    739
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Développeur Web

    Informations forums :
    Inscription : Novembre 2013
    Messages : 739
    Par défaut
    cette discussion traite ton problème,
    http://www.developpez.net/forums/d13...oes-not-exist/

  8. #8
    Membre confirmé
    Homme Profil pro
    symfony2
    Inscrit en
    Mars 2016
    Messages
    124
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 32
    Localisation : Tunisie

    Informations professionnelles :
    Activité : symfony2

    Informations forums :
    Inscription : Mars 2016
    Messages : 124
    Par défaut
    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;
        }
     
     
    }

  9. #9
    Membre émérite
    Homme Profil pro
    Développeur Web
    Inscrit en
    Novembre 2013
    Messages
    739
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Développeur Web

    Informations forums :
    Inscription : Novembre 2013
    Messages : 739
    Par défaut
    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() 
         */

  10. #10
    Membre confirmé
    Homme Profil pro
    symfony2
    Inscrit en
    Mars 2016
    Messages
    124
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 32
    Localisation : Tunisie

    Informations professionnelles :
    Activité : symfony2

    Informations forums :
    Inscription : Mars 2016
    Messages : 124
    Par défaut
    Citation Envoyé par MehrezLabidi Voir le message
    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() 
         */

    même probléme

    Doctrine\Common\Annotations\AnnotationException]
    [Semantical Error] The annotation "@Doctrine\ORM\Mapping\PrepPersist" in method ventenligneBundle\Entity\Media::preUpload() does not
    exist, or could not be auto-loaded.

  11. #11
    Membre émérite
    Homme Profil pro
    Développeur Web
    Inscrit en
    Novembre 2013
    Messages
    739
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Développeur Web

    Informations forums :
    Inscription : Novembre 2013
    Messages : 739
    Par défaut
    ca existe ou ca ??
    les évènements de cycle de vie ont des appelations bien précises .

  12. #12
    Membre confirmé
    Homme Profil pro
    symfony2
    Inscrit en
    Mars 2016
    Messages
    124
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 32
    Localisation : Tunisie

    Informations professionnelles :
    Activité : symfony2

    Informations forums :
    Inscription : Mars 2016
    Messages : 124
    Par défaut
    je sais pas pourquoi en ubuntu je trouve ce probléme , en windows tous se marche

Discussions similaires

  1. Réponses: 2
    Dernier message: 13/12/2011, 20h33
  2. Réponses: 3
    Dernier message: 01/09/2009, 07h38
  3. failed to open stream: No such file or directory
    Par Invité dans le forum Langage
    Réponses: 11
    Dernier message: 17/03/2009, 19h02
  4. "failed to open stream: No such file or directory in.."
    Par Xpertfly dans le forum Langage
    Réponses: 2
    Dernier message: 24/10/2008, 09h56
  5. failed to open stream: No such file or directory
    Par Deallyra dans le forum Langage
    Réponses: 4
    Dernier message: 26/06/2007, 09h33

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo