Bunpu - Mot-clé - command non reconnuTutoriaux, didacticiels aides en informatique. Le bute de Bunpu ? Allez directement à l'essentiel de façon simple2023-04-14T14:03:00+02:00Arobaseurn:md5:a59f25f2a0a36d13929ef592a788ddbcDotclearSymfony2 - stty problème commande non reconnu - créer ou générer la base de donnéeurn:md5:d88e4df05375c552a2bef87b1b5431692012-08-06T01:00:00+02:002013-03-26T06:30:58+01:00Arobaseinformatique / Webcommand non reconnuconsoledoctrinepdo driversymfony2<p><img src="http://bunpu.free.fr/public/Code_prog/symfony2.png" alt="logo symfony2" style="float:left; margin: 0 1em 1em 0;" title="logo symfony2, août 2012" /> Dans Symfony2 beaucoup peuvent rencontrer ce type de problème, ce message exactement : ATTENTION : This opération should not be executed in a production environement.
Creating database schema ....
<a href="http://bunpu.free.fr/index.php?post/2012/08/06/PDOException" title="PDOException">PDOException</a>SQLSTATE<a href="http://bunpu.free.fr/index.php?post/2012/08/06/42000" title="42000">42000</a> <a href="http://bunpu.free.fr/index.php?post/2012/08/06/1049" title="1049">1049</a> Unknow database ...</p> <h2>Problème Console commande Create database schem</h2>
<p>Ce type de problème comme la commande <strong>stty</strong> non reconnu, certaines personnes l'on souvent rencontré lorsqu'ils débutent sous le <strong>framework Symfony2</strong>.</p>
<p>Personnellement j'ai eu ce type de problème très embarrassant lorsque j'ai voulu créer (ou générer) mes tables SQL via mes entitées.
Vraiment très agaçant car je n'ai strictement rien trouvé sur internet une réponse à ce problème, car bon nombre tout compte fait créaient leurs tables manuellement du coup.</p>
<p>A force de chercher et remonter les symptômes un par un j'ai finis par savoir d'où cela provenait.</p>
<p>Donc lorsque vous rencontrer ce type de problème ou bien encore 'STTY' commande non reconnu :</p>
<pre class="sql sql" style="font-family:inherit"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">ATTENTION : This opération should <span style="color: #993333; font-weight: bold;">NOT</span> be executed <span style="color: #993333; font-weight: bold;">IN</span> a production environement<span style="color: #66cc66;">.</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Creating <span style="color: #993333; font-weight: bold;">DATABASE</span> schema <span style="color: #66cc66;">....</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #66cc66;">[</span>PDOException<span style="color: #66cc66;">]</span>SQLSTATE<span style="color: #66cc66;">[</span><span style="color: #cc66cc;">42000</span><span style="color: #66cc66;">]</span> <span style="color: #66cc66;">[</span><span style="color: #cc66cc;">1049</span><span style="color: #66cc66;">]</span> Unknow <span style="color: #993333; font-weight: bold;">DATABASE</span> <span style="color: #ff0000;">'Symfony'</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">doctrine:schema:<span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #66cc66;">[</span><span style="color: #808080; font-style: italic;">--dump-sqll] [--em[="---"]]</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">problème stty commande non reconnu </div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">copier php<span style="color: #66cc66;">.</span>ini du dossier apache et le coller dans le dossier php<span style="color: #66cc66;">,</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">ouvrir le fichier php ini si l<span style="color: #ff0000;">'erreur PHP Warning: Xdebug MUST be loaded as a Zend extension in Unknown on line 0</span></div></li></ol></pre>
<p>C'est du à un problème de <strong>PATH variable d'environnement</strong>, lorsque que vous rentrez les commandes "php app/console" vous pensez utiliser le php.ini de votre wamp, easyphp ou bien xamp mais il n'en est pas. En fait votre commande PHP se réfère en premier certainement au php.ini qui se trouve dans votre windows.</p>
<p><code>C:\WINDOW\php.ini</code></p>
<h3>Comment faire alors pour faire pointer directement en premier au path de votre variable d'environnement php ?</h3>
<p>Au lieu de modifier en ligne de commande l'alias du PATH qui fait référence au fichier php.ini de windows, on va faire encore plus simple.</p>
<p>Allez dans votre répertoire wamp ou easyphp (enfin votre virtual server)
Allez dans le dossier __Apache__
Récupérer le fichier <strong>php.ini</strong> en le copiant (pas le couper)
Et collez le dans le répertoire php, le même chemin que vous avez spécifié en variable d'environnement de windows
Une fois cela fait redémarrer votre console et votre serveur</p>
<p>Et là Surprise vous n'avez plus l'erreur spécifié plus haut et vous pouvez donc appeler la commande :</p>
<p><code>php app/console doctrine:create:database</code></p>
<h2>Si vous désirez connaitre à quel php.ini votre commande se réfère</h2>
<p>Alors tapez dans votre fenêtre MS-DOS ou Shell<br /></p>
<p><code>C:\ php --ini</code>
<br /><br /></p>http://bunpu.free.fr/index.php?post/2012/08/06/Symfony2-stty-command-non-reconnucr%C3%A9er-ou-g%C3%A9n%C3%A9rer-la-base-de-donn%C3%A9e#comment-formhttp://bunpu.free.fr/index.php?feed/atom/comments/22