21
Mar

Errors while installing Symfony 2 and Doctrine on Mac/OS X Lion

Written by admin. Posted in php

If like me it took you more than you initially thought when installing symfony 2 with MAMP Pro.

Here’s a quick article to make it easier to everyone:

First thing make sure to run these 2 commands:

chmod -R 777 your-sf2-folder/

If you are using symfony 1.4, do the same. That will fix a lot of permission errors while setting up your symfony project.

 

Error while trying to create your database with Doctrine

When I tried running this command

php symfony doctrine:build-schema

it gave me this error:

Warning: PDO::__construct(): [2002] No such file or directory (trying to connect via unix:///var/mysql/mysql.sock) in /Users/toto/projects/myproject/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Connection.php on line 470

Run these commands

cd /var;
sudo mkdir mysql;
cd mysql;
sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock mysql.sock

Tags: ,

27
Oct

Google +1 button javascript error not working on IE

Written by admin. Posted in Javacript

Hi Guys,

I had the bad experience today of receiving a call from my client saying the website was not working properly due to javascript errors on IE7 and IE 8. I jumped on my IE and started to debug the Javascript console.

 

The little Story of how I found out and how I fixed it (skip this if in rush)

I could see an error making my jquery unusable. I thought about all the changes I made since yesterday and as a matter of chance (not really lol), I changed few things in the Google Analytics Tracking Code. So here I am debugging the google analytics code, reverting the old code etc etc. Bad luck, errors are still showing up and challenging me. I could see the code was coming from google and then tadaaaaa I thought about Google +1, removed the call to their js library and voila!

 

The issue in more details

I had the following issues:

No relay set (used as window.postMessage targetOrigin), cannot send cross-domain message

Object doesn’t support this property or method ‘K’

This error was making my jquery fail and I found other guys having the same issue with mootools. So no matter which JS framework you are using, this could cause severe troubles to your website on IE.

 

This issue was occuring on IE8 and IE7. Everything was working fine yesterday (the 25th October 2011), I suspect Google of having released something in the file you call below (or they simply don’t care about IE):

<script type="text/javascript">
  (function() {
    var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
    po.src = 'https://apis.google.com/js/plusone.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
  })();
</script>

 

My advice

Remove it for now! Hope it helps and thank you Google for making my day a nightmare :) !

 

I have to say this Google +1 button really challenged me since I integrated it on my client’s website. When you make something like a share button, you work on the accessibility and the usability. But I guess Google is Google, so they can say whatever!

Tags: ,