Wednesday, 14 July 2010

internalization of mysql

On a recent project I had a problem to import into MySQL a file tab delimited formatted with utf-8. I found that I have to set the collation of the column to utf-8, but there are several. according to what i found in other blogs, i tried utf8_unicode_ci, but after few trials and that i got gibberish for the special characters I changed it to utf8_bin and it works fine.

A later addition:
I repeat what I thought works a bit later and realised I can't repeat my success. It seems only writing php script solves the problem. Another thing if you copy utf8 data and use phpmyadmin it's important to verify the page's encoding is indeed utf8.

Tuesday, 27 April 2010

Transfering the code to Xubuntu production server

I needed  a server to deploy the code for testing. As I have old PC I installed the light linux Xubuntu.
During the development I installed some additional packages to Apache. Mostly it's easy to spot if you check the log files for errors, but for plugin sfImageTransformPlugin I use the mime type detector and in order to use it, the mime type package has to be installed. The result was blank page when manipulating images, which happened when initializing the sfImage class. To enable the detecting mime type I configured app.yml
  sfImageTransformPlugin:
    mime_type:
      auto_detect: true
      library: MIME_Type 

Wednesday, 24 March 2010

cache or why symfony stops running

Installing a new plugin left me with the command line of symfony does nothing.
steps i've made to try and tackle the problem were checking the php_error.log inside MAMP if you go to main folder of MAMP it's under logs (there's an article explaining how to have the error logs as a widget when clicking F4, how to have it.
the symfony file itself is a batch file, so you can try and debug the file, i just use echo to print in the terminal.
well the errors i got aren't very helpful, so last resort i decided after spending quite a while is to delete the cache. 
in the project folder one of the folders is cache. i renamed it and created a new cache folder. i suspect the project_autoload.cache file caused the problem.
although running the dev env should omit the cahce it didn't reach that point in the code :-(

Thursday, 18 February 2010

debug using Netbeans IDE on MAMP

Clicking the debug and hoping it will work without doing anything on Netbeans version 6.8 didn't prove itself. I had to follow the following tutorial http://wiki.netbeans.org/HowToConfigureXDebug to do the configuration.

I had to update the php.ini in the following folder /Applications/MAMP/conf/php5 to start the debug on Mac I use the CMD+F5

Monday, 4 January 2010

symfony with WAMP on Windows 7

my Mac has a major problem with its trackpad so i have to give it away to the lab for a while and use a PC which equiped with Windoews 7. It means I have to install Symfony with WAMP. PEAR is required for this task, but it has a fault so I have to follow this post in order to be able to install it. I use sub version with 2 different usernames to sync between the development on the Mac and PC.

Friday, 25 December 2009

how to use mySQL of MAMP

Navigating to http://localhost:8888/MAMP/ displays the Start page of MAMP with the mySQL settings.
In order to setup symfony to connect to mySQL database we need to run from the command this
symfony configure:database 'mysql:host=localhost;port=8889;dbname=test' root root

test is database name as created for my symfony project using the phpMyAdmin on the MAMP page. By default the port for MySQL is 8889, you can verify it on the MAMP start page. Same with the username and the password, which in this example is root both for username and password.

Wednesday, 9 December 2009

Configure Symfony project on MAMP

I try to learn symfony framework and figure out, the easiest to install it on my Mac would be to use MAMP, the current MAMP version I use is 1.8.2
  1. The symfony package is already installed as I used it when practising the jobeet demo. so in order to create a new project first we want to create a new folder. As we run the symfony commands from the shell we need to open terminal. Then using the mkdir command we create a new folder for our project.
  2. We need to be within the project folder, using cd command and we run the symfony command php /usr/bin/symfony generate:project [project name] in this case I created a symbolic link from the installation of symfony to /usr/bin this is necessary only first time after the creation of the project will have a shortcut to symfony from the project folder.
  3. To create new domain for your web development project, you need to update the following files: /etc/hosts and conf/apache/httpd.conf (in your MAMP folder) .
  4. After changing the server name you need to restart the MAMP service.
The next step is configuring a repository to store data for the web application. I use mySQL that comes with the MAMP, by defaults the port is 8889 and you need to remember that when coming to configure the database in symfony. I'll talk about it including how to use Doctrine in my next post.