Thursday, July 16, 2009

SimpleTest Eclipse Plugin Issue

SimpleTest is a TDD template for PHP, I feel interest to it is because it provides a plugin for Eclipse which I use for my PHP development. There is an installation guide provided by SimpleTest official website:, but the problem is when I tried to follow it, there are several steps not match.

Firstly, it says you can "new" a SimpleTest project, but actually there is no SimpleTest project type for you to choose. This is actually not a big deal, you can just create a normal project, it will have no bad impact.

The most frustrating thing happen later is when you run your first test, it will complain cannot find eclipse.php. Several other users complain about this issue too, see here. To solve this issue, I searched in whole package for the file, and finally got it in a file of, once I extracted it to a folder, and in Windows->Preferences->SimpleTest, set SimpleTest folder to that extracted folder, everything solved.

Friday, June 19, 2009

Eclipse can not debug PHP web page (session terminated)

When using Eclipse with PDT to debug PHP, it can successfully debug PHP script, but everytime when tring to debug PHP webpage, it will terminated quickly with information saying of "session terminated".

The reason is because there are 3 lines must be added in php.ini.

zend_extension_ts="C:\Program Files\PHP\ext\ZendDebugger.dll" (You need to search in your Eclipse folder to find out where the file exists and use the full path to it.)

After adding these 3 lines, restart Apache, then it works.

Monday, June 15, 2009

Fatal error: Call to undefined function mysql_connect()

Well, I've long time not used PHP, and now I am back.

I installed the newest Apache, the newest PHP, the newest Mysql, and everything is smooth. Seems the UIs are much better than 4 years ago. I took pretty caution to the PHP configuration, and choosed to install mysql support at beginning, so everything seems ok at first.

But I met issue soon. When I call mysql_connect, it immediately says:

Fatal error: Call to undefined function mysql_connect() ...

As I am experienced engineer, I don't worry about this, checked all website for this issue, but everyone just repeatedly saying: check your php.ini file to remove the semicolon before the line of extension=php_mysql.dll, or check your extension_dir setting to make sure it's correct, something like that, blah, blah, blah... I checked again at my php.ini setting, it's pretty correct, because when I install php I already choose to have mysql support installed, so everything already correctly setting for me. I tried many other ways, to copy php.ini file into windows folder, to copy php_mysql.dll into windows folder, and also tried windows system32 folder, and also checked the environment variable of PHPRC, the problem just still be there.

Finally I got the problem solved. Now let me tell you the truth, this IS the exactly quite important step, but the PHP installation program did not do it correctly.

Very simple, that is: to copy the file libmysql.dll from your PHP folder into Windows folder. Very simple, right? But that's it.

Now we know, there are 3 files related to mysql support in php:

1. libmysql.dll (this by default is in ext folder, you can leave it there)
2. php_mysql.dll (this be default is in your php folder, you need to manually copy it into windows folder)
3. php.ini (this by default is in your php folder, you can leave it there)

You made them in correct folder, you got it.

Thursday, February 19, 2009

.NET assembly and SharePoint Workflow

As you may know, Windows SharePoint Services can only be run on Windows Server 2003, it can not be run on Windows XP. But my client side development environment is Windows XP, my Visual Studio is installed on Windows XP. I need a solution to develop workflow programs on my Windows XP instead of Windows Server 2003.

After a long time research, finally I got clear how to develop workflow in Visual Studio on a Windows XP machine.

To do such work, it's very simple, but to understand, it take some time.

Ok, now I just say the simple thing.

All you need to do is just copy the .dll files you need on your machine, then register it in .net.

1. What files you need?
Some assembly dlls. Include Microsoft.SharePoint.dll, and others.

2. Where can I get these files?
These files are in an install sharepoint machine. Directory is at c:\windows\assembly\gac_msil
In that folder, you can see a lot of directories start with Microsoft.SharePoint, copy all thoese folders to your machine.

3. How do I register them?
Open your Control Panel->Administrative Tools->Microsoft .net Framework 2.0 Configuration, then click on the "Assembly Cache", then you can register them.

Ok, now you can enjoy on it!