Configure XDebug with WAMP and NetBeans IDE 6.8 on Windows 7

This is step – by – step procedure (with sample):

  1. Install WAMP, default location is at c:\wamp
  2. Download latest release of xdebug for PHP version you are using.
    1. I use WampServer 2.0i [07/11/09] and it includes :
      – Apache 2.2.11
      – MySQL 5.1.36
      – PHP 5.3.0 ———> 5.3 is what we need
    2. write a phpinfo() to know what PHP compiled, Find “PHP Extension Build”  ———–>   API20090626,TS, VC6 is what we need
    3. I use Windows 7 64bit, there is nothing 64bit at XDebug (at the moment Apr 2010)  —–> so this is not important
    4. After all, this is what we should download from Xdebug: 5.3 VC6 (32 bit)   ———-> we have php_xdebug-2.0.5-5.3-vc6.dll
  3. Copy php_xdebug-2.0.5-5.3-vc6.dll file into php’s extension directory, it is c:\wamp\php\ext
  4. Now open php.ini (click WAMP tray icon, PHP/php.ini), we need to configure xdebug so that it get recognized by PHP
  5. Add following at the end of your php.ini
  6. [xdebug]
    xdebug.profiler_output_dir = "c:/wamp/tmp/xdebug"
    xdebug.profiler_output_name = "cachegrind.out.%p"
    xdebug.profiler_enable = 0

  7. Just create   c:\wamp\tmp\xdebug folder.
  8. Finally restart Apache service .
  9. Now you can write PHP code and debug with NetBeans

Install all simple thing Apache PHP MySQL Mono Eclipse NetBean to work with Ubuntu for beginner

Some developer install Ubuntu to give it a try, but they do not know how to go further step, they will be bored and quit Ubuntu. I don’t like it (I like Ubuntu) so I make some simple steps that beginner (of Ubuntu) should do to play more (programming) with it:

Open your console (by opening menu Application/Accessories/Terminal), type some command:

Apache, good HTTP Web Server (it will take the lastest version of series 2)
sudo apt-get install apache2
(after installed, open http://localhost with your firefox  , if some text display, it’s work)
(the webroot folder is at /var/www by default)

MySQL, good DBMS
sudo apt-get install mysql-server
(when installing, it will ask you to make the root password of MySQL)
(after installed, type this command in the terminal: mysql
if the console become mysql> , it’s work)

PHP, good “script” web language
sudo apt-get install php5

PHPMyAdmin, good web management tool to control your MySQL Server
sudo apt-get install phpmyadmin
(after installed, you use it by going to http://localhost/phpmyadmin)

Mono runtime (CIL) is installed (by default) on Ubuntu, you only need to install MonoDevelop (IDE for coding) to work with C# on Ubuntu
sudo apt-get install monodevelop
(after installed, you open IDE by opening menu: Application/Programming/MonoDevelop)

Truetype font (because someone told me text look bad on Ubuntu)
sudo apt-get install msttcorefonts

SSH Server on Ubuntu, it will give you OS console remotely
sudo apt-get install openssh-server
/etc/init.d/ssh stop/start/restart

FTP Server, it will help you upload/download file to your OS remotely. I recommend using vsftpd. It is simple and quite secure FTP server. According to vsftpd man page:

vsftpd is the Very Secure File Transfer Protocol Daemon. The server can be launched via a super-server such as inetd or xinetd. Alternatively, vsftpd can be launched in standalone mode, in which case vsftpd itself will listen on the network.

Default ftp port : 21
Default configuration file : /etc/vsftpd.conf
Install by sudo apt-get install vsftpd
Cần chú ý chỉnh những tham số sau trong file config của nó:
local_enable=YES (cho phép các account ubuntu sử dụng FTP, nên bật)
write_enable=YES (cho phép các loại lệnh ghi FTP, vì ta sẽ không cho anonymous user nên bật write_enable sẽ đơn giản hoá việc tạo file, folder)
local_umask=022 (nên đặt ở 022, các file sẽ mặc định có quyền 755)

Để nguyên các dòng comment sau để không cho anonymous access

Chỉnh lại dòng ftpd_banner theo ý bạn, để chào mừng user khi họ login vào hệ thống. Tuy nhiên không nên giới thiệu quá nhiều về hệ thống (tránh lộ các thông tin nhạy cảm), chỉ nên điền vài thông tin cơ bản để biết được là mình đang connect đúng vào server của mình

using memcache with multi ClientAPI multi platforms and languages

When your system is large, compose by several programs, in several languages. If every programs need to access memcacheD, you should use the correct ClientAPI to make them talk with each other.
Of course, if you set value by PHP, you get value by PHP, it works. If you set value by Java, then you get value by other Java program, it work too.

BUT, this time (this post time), if PHP says, maybe Java can’t hear, C# can’t here, and vice versa.

in PHP, $memcacheClient->set(“test”,”lockevn”);     // it will go to memcache server

in Java, Object oValue = oMemcacheClient.get(“test”) ;      // it will return null, supprise!!! @:@

I have some experience with Java, PHP. PHP website (using default pecl extension module) set value to memcache, if Java program need to get that value, you should use ClientAPI (at the time of this post). The other won’t work. Follow this link to get more info.

I do not test .NET client

You also need to store value as native format, only use 32bit integer, or string. If you put PHP object, Java program can not understand it, neither the C# program.

If your really need to store object, serialize it (to XML, JSON, … encode with UTF-8) BEFORE put it in memcache. The others must deserialize after get that value. Believe me, do that will save you a lot of time.

There is a similar alternative project on Windows: Velocity from MS

And an alternate one


memcache is good, but it make only to store data, only data, it does not like “object” things, don’t push it too hard. If you want some program say and other “different language” program hear, check it carefully, ask the ClientAPI author if it does not work. You should use native data format for value (int and string only), do serialize by yourself if you want to store data object.