<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4954095172854051030</id><updated>2011-07-30T08:13:39.866-07:00</updated><category term='astuce'/><category term='windev'/><category term='MySQL'/><category term='SQL'/><category term='HyperFile'/><title type='text'>Karl COSSE</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://karl-cosse.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4954095172854051030/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://karl-cosse.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>ZoRdAK</name><uri>http://www.blogger.com/profile/03512568890664821825</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_pu1nEFSLpVw/Sr_jQ7TashI/AAAAAAAAACg/I0peQjZWUi0/S220/photo.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>5</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4954095172854051030.post-4665515131533399344</id><published>2010-04-24T06:58:00.001-07:00</published><updated>2010-04-24T07:12:35.089-07:00</updated><title type='text'>Internal Server Error 500 - ioncube résolu !</title><content type='html'>Après 3 jours d'incompréhension, j'ai trouvé mon problème d'Internal Server Error 500.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Voilà ma situation.&lt;/div&gt;&lt;div&gt;J'ai une application web (Php/MySQL) encodée avec ionCube.&lt;/div&gt;&lt;div&gt;Sur un hébergeur et que sur certaines pages, j'ai des erreur 500.&lt;/div&gt;&lt;div&gt;Lorsque je remplace les fichiers encodés par les fichiers sources, aucun problème.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Après avoir épluché des milliers de lignes de code, ligne par ligne, j'ai trouvé la fonction qui posait problème. Elle ressemblait à :&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;&lt;b&gt;function img($url,$parametres=array()){&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;&lt;b&gt;...&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;&lt;b&gt;}&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;La page qui appelait cette fonction est une page non encodée et ressemblait à :&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;?php echo img('http://www....'); ?&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;?php echo img('http://www....'); ?&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Surpris par le comportement de l'application, j'essaye de ne faire qu'un appel de fonction.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;&lt;?php echo img('...'); ?&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Et là, la page fonctionne.&lt;/div&gt;&lt;div&gt;C'est donc lorsque j'ai deux ou plusieurs appels à cette fonction, que le serveur apache affiche une erreur 500.&lt;/div&gt;&lt;div&gt;Dans le error_log d'apache j'ai :&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;/span&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;[Sat Apr 24 03:11:22 2010] [error] [client X.X.X.X] Premature end of script headers: index.php, referer: http://www.mon-site.com/&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Le problème venait de la déclaration de la fonction img(). La valeur par défaut "=array()" provoque une erreur au deuxième appel de cette fonction.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new', serif; color: rgb(0, 153, 0); font-weight: bold; "&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"   style="font-family:Georgia, serif;color:#000000;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;function img($url,$parametres&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new', serif; font-weight: bold; "&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;=array()&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new', serif; color: rgb(0, 153, 0); font-weight: bold; "&gt;){&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span"   style="font-family:'courier new', serif;color:#009900;"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;J'ai donc remplacé cette déclaration par :&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new', serif; color: rgb(0, 153, 0); font-weight: bold; "&gt;&lt;span class="Apple-tab-span" style="white-space: pre; "&gt;&lt;span class="Apple-style-span"   style="font-family:Georgia, serif;color:#000000;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;function img($url,$parametres&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new', serif; font-weight: bold; "&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;=null&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new', serif; color: rgb(0, 153, 0); font-weight: bold; "&gt;){&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Maintenant tout fonctionne parfaitement, je peux faire autant d'appels à la fonction img() que je veux.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;J'espère vous avoir aidé !&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4954095172854051030-4665515131533399344?l=karl-cosse.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://karl-cosse.blogspot.com/feeds/4665515131533399344/comments/default' title='Publier les commentaires'/><link rel='replies' type='text/html' href='http://karl-cosse.blogspot.com/2010/04/internal-server-error-500-ioncube.html#comment-form' title='0 commentaires'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4954095172854051030/posts/default/4665515131533399344'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4954095172854051030/posts/default/4665515131533399344'/><link rel='alternate' type='text/html' href='http://karl-cosse.blogspot.com/2010/04/internal-server-error-500-ioncube.html' title='Internal Server Error 500 - ioncube résolu !'/><author><name>ZoRdAK</name><uri>http://www.blogger.com/profile/03512568890664821825</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_pu1nEFSLpVw/Sr_jQ7TashI/AAAAAAAAACg/I0peQjZWUi0/S220/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4954095172854051030.post-6605300367602170747</id><published>2010-02-28T06:28:00.000-08:00</published><updated>2010-02-28T06:50:56.664-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MySQL'/><category scheme='http://www.blogger.com/atom/ns#' term='astuce'/><category scheme='http://www.blogger.com/atom/ns#' term='windev'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><category scheme='http://www.blogger.com/atom/ns#' term='HyperFile'/><title type='text'>Exporter données HyperFile SQL vers MySQL</title><content type='html'>&lt;span class="Apple-style-span" style="font-size: large;"&gt;Voici le but de ce projet.&lt;/span&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;J'ai une application windev avec une base HyperFile SQL (non client/serveur).&lt;/div&gt;&lt;div&gt;J'ai un site internet à distance avec une base MySQL.&lt;/div&gt;&lt;div&gt;Je souhaite faire une synchronisation de l'application windev vers la base de données à distance.&lt;/div&gt;&lt;div&gt;A chaque synchronisation, les tables sont remises à zéro sur la base distante.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;Comment j'ai fait&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Dans l'application windev et plus particulièrement dans l'analyse, j'ai ajouté une &lt;b&gt;connexion MySQL vers la base distante&lt;/b&gt;. (Pensez à installer l'accès natif MySQL pour windev)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;J'ai fait la synchronisation dans une nouvelle fenêtre.&lt;/div&gt;&lt;div&gt;Ayant une base d'environ 1000 lignes, j'ai trouvé une "astuce" pour réaliser la synchronisation facilement.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Ajouter un tableau d'un fichier Windev voulu, sélectionnez tous les champs (&lt;b&gt;chargé en mémoire !&lt;/b&gt;)&lt;br /&gt;Tester la fenêtre, vos enregistrements devraient s'afficher.&lt;br /&gt;Ajoutez ensuite un bouton, nous allons mettre du code dedans...&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;L'idée est de stocker dans le tableau les enregistrements de votre base HyperFile SQL puis de changer de connexion vers MySQL, de reparcourir le tableau et d'ajouter dans MySQL chaque ligne de ce tableau. Astucieux non ? :D&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Dans le code du bouton, avant toute chose, il faut forcer le parcours de toutes les lignes du tableau pour que windev mette en mémoire l'ensemble des lignes.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;&lt;b&gt;POUR i = 1 _A_ TABLE_Produits..Occurrence&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;&lt;b&gt; &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;&lt;b&gt;//Rien&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;&lt;b&gt;FIN&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Ensuite on change de connexion. De HyperFile SQL vers MySQL&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;HChangeConnexion("*",ConnexionMySQL)&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;HSupprimeTout(Produits)&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;HCréationSiInexistant("*")&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Je crée également les tables MySQL si elles n'existent pas (hCréationSiInexistant).&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Puis on re-parcours le tableau en ajoutant les lignes dans MySQL&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;POUR i = 1 _A_ TABLE_Produits..Occurrence&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt; &lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;HRAZ(Produits)&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt; &lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;Produits.id= TABLE_Produits.COL_id[i]&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt; &lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;Produits.nom= TABLE_Produits.COL_nom[i]&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt; &lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;HAjoute(Produits)&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;FIN&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;On peut finalement compter le nombre d'ajout dans MySQL. Soit en ajoutant un compteur lorsque le hAjoute réussit (meilleure fiabilité), soit en faisant :&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;Info(TABLE_Produits..Occurrence + " produits ajoutés")&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Je vous conseille également de vérifier le nombre de lignes dans votre base HyperFile SQL et le nombre de lignes ajoutées afin de contrôler l'intégrité des données.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;On lance la synchronisation&lt;/span&gt;&lt;/div&gt;&lt;div&gt;Windev a créé dans MySQL les tables nécessaires et à ajouté les enregistrements.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;Problème d'accents&lt;/span&gt;&lt;/div&gt;&lt;div&gt;Windev fait la synchronisation mais on peut avoir des problèmes d'accents. L'astuce est d'ajouter une information dans les connexions windev. Dans l'onglet "&lt;b&gt;Avancé&lt;/b&gt;" de la connexion MySQL (dans votre analyse), mettre dans la zone "&lt;b&gt;Infos. étendues&lt;/b&gt;" :&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#009900;"&gt;&lt;b&gt;WD Unicode Support = 0;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: large; "&gt;Conclusion&lt;/span&gt;&lt;/div&gt;&lt;div&gt;Ce n'est pas la solution idéale je pense, mais c'est une solution rapide pour transférer les informations de HyperFile SQL vers une base MySQL distante (ou locale).&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4954095172854051030-6605300367602170747?l=karl-cosse.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://karl-cosse.blogspot.com/feeds/6605300367602170747/comments/default' title='Publier les commentaires'/><link rel='replies' type='text/html' href='http://karl-cosse.blogspot.com/2010/02/exporter-donnees-hyperfile-sql-vers.html#comment-form' title='0 commentaires'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4954095172854051030/posts/default/6605300367602170747'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4954095172854051030/posts/default/6605300367602170747'/><link rel='alternate' type='text/html' href='http://karl-cosse.blogspot.com/2010/02/exporter-donnees-hyperfile-sql-vers.html' title='Exporter données HyperFile SQL vers MySQL'/><author><name>ZoRdAK</name><uri>http://www.blogger.com/profile/03512568890664821825</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_pu1nEFSLpVw/Sr_jQ7TashI/AAAAAAAAACg/I0peQjZWUi0/S220/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4954095172854051030.post-1625833864457424321</id><published>2009-11-08T05:17:00.000-08:00</published><updated>2009-11-08T05:35:00.071-08:00</updated><title type='text'>Sendmail PHP sur virutalbox ubuntu</title><content type='html'>&lt;div&gt;Développant la plus part du temps sous Windows, j'ai besoin de tester mes applications sous unix afin de vérifier que tout fonctionne correctement. Pour cela j'utilise VirtualBox sur lequel j'installe un Ubuntu 9.10.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Voici comment j'ai paramétré mon Ubuntu pour activer l'envoie de mail via PHP.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;blockquote&gt;sudo apt-get install ssmtp&lt;/blockquote&gt;&lt;/div&gt;&lt;div&gt;Editer le fichier /etc/ssmtp/ssmtp.conf&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;sudo vim /etc/ssmtp/ssmtp.conf&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;div&gt;(Une fois vim ouvert, pour éditer appuyez sur "&lt;b&gt;i&lt;/b&gt;", pour enregistrer et quitter l'édition faire : "&lt;b&gt;Echap&lt;/b&gt; puis &lt;b&gt;:wq!&lt;/b&gt;")&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Voila à quoi ressemble mon fichier ssmtp.conf&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;root=&lt;/div&gt;&lt;div&gt;mailhub=smtp.mon_fai.fr&lt;/div&gt;&lt;div&gt;rewriteDomain=mon_fai.fr&lt;/div&gt;&lt;div&gt;hostname=localhost&lt;/div&gt;&lt;div&gt;FromLineOverride=YES&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Il faut ensuite modifier le &lt;b&gt;php.ini&lt;/b&gt; pour lui dire d'utiliser ssmtp.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Editer le fichier &lt;b&gt;/etc/php5/apache2/php.ini&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;blockquote&gt;sudo vim /etc/php5/apache2/php.ini&lt;/blockquote&gt;&lt;/div&gt;&lt;div&gt;Trouver la ligne "sendmail_path" et mettre&lt;/div&gt;&lt;div&gt;&lt;blockquote&gt;sendmail_path = /usr/sbin/ssmtp -t -i&lt;/blockquote&gt;&lt;/div&gt;&lt;div&gt;Enregistrez et quitter.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Il ne reste plus qu'à &lt;b&gt;redémarrer Apache&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;blockquote&gt;sudo /etc/init.d/apache2 restart&lt;/blockquote&gt;&lt;/div&gt;&lt;div&gt;L'envoi de mail devrait maintenant fonctionner sur votre Ubuntu avec la fonction mail().&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://forum.ubuntu-fr.org/viewtopic.php?id=186827"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Source&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4954095172854051030-1625833864457424321?l=karl-cosse.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://karl-cosse.blogspot.com/feeds/1625833864457424321/comments/default' title='Publier les commentaires'/><link rel='replies' type='text/html' href='http://karl-cosse.blogspot.com/2009/11/sendmail-php-sur-virutalbox-ubuntu.html#comment-form' title='0 commentaires'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4954095172854051030/posts/default/1625833864457424321'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4954095172854051030/posts/default/1625833864457424321'/><link rel='alternate' type='text/html' href='http://karl-cosse.blogspot.com/2009/11/sendmail-php-sur-virutalbox-ubuntu.html' title='Sendmail PHP sur virutalbox ubuntu'/><author><name>ZoRdAK</name><uri>http://www.blogger.com/profile/03512568890664821825</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_pu1nEFSLpVw/Sr_jQ7TashI/AAAAAAAAACg/I0peQjZWUi0/S220/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4954095172854051030.post-4811580328291394754</id><published>2009-09-27T15:13:00.000-07:00</published><updated>2009-09-27T15:29:22.116-07:00</updated><title type='text'>SPBAS - Down for maintenance</title><content type='html'>Bonjour,&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;img src="http://www.ioncube.com/images/solidphp_new.gif" style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 149px; height: 70px;" border="0" alt="" /&gt;&lt;div&gt;Il m'arrive d'utiliser dans un cadre professionnel l'outil &lt;b&gt;&lt;a href="http://solidphp.com/products/spbas/index.php"&gt;SPBAS v1.1.0&lt;/a&gt;&lt;/b&gt; développé par &lt;a href="http://www.solidphp.com/"&gt;l'équipe de solidPhp&lt;/a&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;En quelques mots, cet outil fait office de boutique et de gestion de licences. Lorsqu'un client passe commande, une clé de licence lui est automatiquement attribuée. Dans l'application qu'elle télécharge vous devez incorporez un peu de code de SPBAS pour qu'il effectuer les vérifications de licence.&lt;/div&gt;&lt;div&gt;Cela permet de facilement gérer les licences pour vos applications web et de vous créer une petite boutique pour vendre vos applications web (Php, Mysql, ...)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Cet outil est customisable a volonté. On peut entre autres, lors de l'installation, changer les noms de dossiers par défaut qui définiront chaque espace. L'espace administration, l'espace client, ...&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Ainsi on peut dissimuler son espace administration dans un dossier nommé "odzoaiuzeo90238". Gage de sécurité ? Cela va ralentir les pirates mais ils trouveront bien un autre moyen de s'infiltrer si ils le souhaitent :)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Bref, Nous pouvons donc définir les dossiers à notre guise. Cependant un bug dans le code de SPBAS empèche le site de fonctionner correctement. Le message "Down for maintenance" apparaissant peut importe les modifications dans l'administration.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Pour résoudre ce problème, il faut éditer le fichier suivant :&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;api/configuration.php&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;A la &lt;b&gt;ligne 2&lt;/b&gt;, on voit qu'il fixe le nom du dossier admin. Or il est &lt;b&gt;écrit en dur&lt;/b&gt; "admin".&lt;/div&gt;&lt;div&gt;Notre dossier admin étant "&lt;b&gt;odzoaiuzeo90238&lt;/b&gt;", &lt;b&gt;il faut remplacer "admin" par "odzoaiuzeo90238"&lt;/b&gt;, &lt;b&gt;enregistrer &lt;/b&gt;et revenir à l'accueil de votre boutique. (en enlevant &lt;span&gt;&lt;span&gt;le ?task=down_for_maintenance).&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"   style="  color: rgb(113, 116, 120); font-weight: bold; line-height: 18px; font-family:verdana, arial, helvetica, serif;font-size:11px;"&gt;&lt;span&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Bon courage pour votre boutique avec SPBAS !&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Liens interessants :&lt;/div&gt;&lt;div&gt;Documentation sur SPBAS : &lt;a href="http://solidphp.com/docs/"&gt;http://solidphp.com/docs/&lt;/a&gt;&lt;/div&gt;&lt;div&gt;Solid PHP : &lt;a href="http://solidphp.com/"&gt;http://solidphp.com/&lt;/a&gt;&lt;/div&gt;&lt;div&gt;SPBAS : &lt;a href="http://solidphp.com/products/spbas/index.php"&gt;http://solidphp.com/products/spbas/&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4954095172854051030-4811580328291394754?l=karl-cosse.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://karl-cosse.blogspot.com/feeds/4811580328291394754/comments/default' title='Publier les commentaires'/><link rel='replies' type='text/html' href='http://karl-cosse.blogspot.com/2009/09/spbas-down-for-maintenance.html#comment-form' title='0 commentaires'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4954095172854051030/posts/default/4811580328291394754'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4954095172854051030/posts/default/4811580328291394754'/><link rel='alternate' type='text/html' href='http://karl-cosse.blogspot.com/2009/09/spbas-down-for-maintenance.html' title='SPBAS - Down for maintenance'/><author><name>ZoRdAK</name><uri>http://www.blogger.com/profile/03512568890664821825</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_pu1nEFSLpVw/Sr_jQ7TashI/AAAAAAAAACg/I0peQjZWUi0/S220/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4954095172854051030.post-6145537421043808540</id><published>2009-09-27T03:38:00.000-07:00</published><updated>2009-09-27T03:40:19.458-07:00</updated><title type='text'>Ouverture</title><content type='html'>Ouverture du blog,&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Il sera pour moi le lieu d'essai de la plateforme blogger et entrepôt d'articles intéressants.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4954095172854051030-6145537421043808540?l=karl-cosse.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://karl-cosse.blogspot.com/feeds/6145537421043808540/comments/default' title='Publier les commentaires'/><link rel='replies' type='text/html' href='http://karl-cosse.blogspot.com/2009/09/ouverture.html#comment-form' title='0 commentaires'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4954095172854051030/posts/default/6145537421043808540'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4954095172854051030/posts/default/6145537421043808540'/><link rel='alternate' type='text/html' href='http://karl-cosse.blogspot.com/2009/09/ouverture.html' title='Ouverture'/><author><name>ZoRdAK</name><uri>http://www.blogger.com/profile/03512568890664821825</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://3.bp.blogspot.com/_pu1nEFSLpVw/Sr_jQ7TashI/AAAAAAAAACg/I0peQjZWUi0/S220/photo.jpg'/></author><thr:total>0</thr:total></entry></feed>
