Month: April 2016

Installation PHP on Windows systems ¶

  1. Download PHP at http://windows.php.net/download/:

VC11 x86 Thread Safe (2016-Apr-01 00:57:09)

  1. Download Apache at http://www.apachelounge.com/download/VC11/

            httpd-2.4.18-win64-VC11.zip

     *** Apache phải giống voi version PHP: VC11, 64 bit.

    Lúc này khi chạy file ApacheMonitor.exe ta sẽ ko thấy server nào hết => ta phải tiến hành cài đặt Apche như là 1 server của window

                 – Chạy câu lệnh sau:

httpd.exe -k install -n “MyServiceName”     => install

httpd.exe -k uninstall -n “MyServiceName” => uninstall

3) Mở file httpd.conf, thêm vào các dòng sau:

 LoadModule php5_module “c:/php-5.5.34-Win32-VC11-x64/php5apache2_4.dll”

AddHandler application/x-httpd-php .php

# configure the path to php.ini

PHPIniDir “C:/php-5.5.34-Win32-VC11-x64”

4.Set up xdebug:

Vui long truy cap vào trang: https://xdebug.org/wizard.php , copy phpinfo() => để lấy version cua xdebug

open php.ini then add follow lines to the end of file:

[xdebug]
zend_extension = c:/php_5.6/ext/php_xdebug-2.4.0-5.6-vc11.dll

xdebug.remote_enable=1
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.remote_mode = req
debug.remote_connect_back = 1
xdebug.remote_log=”c:/xdebug.log”

5. Debug in eclipse:

  • Select Win­dows -> pref­er­ences -> PHP -> Debug
  • 226. Debug in sublime text 3
  • Vao project->Save as project-> input name
  • input some lines into file has just created:

{
“folders”:
[
{
“follow_symlinks”: true,
“path”: “.”
}
],
“settings”:
{
“xdebug”:
{
“url”: “http://localhost/”
}
}
}

  • install xdebug client:
  • *********************Nếu cài debug cho wamp thì lưu ý file php.ini nằm ở path: wamp\bin\apache\apache2.4.9\bin\php.ini

*Vào Preference-> key bindings user: de setting shortcut key for xdebug:

[
{ “keys”: [“f12”], “command”: “goto_definition” },
{ “keys”: [“Ctrl+shift+f”], “command”: “htmlprettify” },
{“keys”: [“f9”], “command”: “xdebug_breakpoint”},
{“keys”: [“ctrl+alt+f8”], “command”: “xdebug_conditional_breakpoint”},
{“keys”: [“f5”], “command”: “xdebug_continue”, “args”: {“command”: “run”}},
{“keys”: [“f10”], “command”: “xdebug_continue”, “args”: {“command”: “step_over”}},
{“keys”: [“f11”], “command”: “xdebug_continue”, “args”: {“command”: “step_into”}},
{“keys”: [“shift+f11”], “command”: “xdebug_continue”, “args”: {“command”: “step_out”}},
{“keys”: [“shift+f5”], “command”: “xdebug_session_stop”},
{“keys”: [“alt+f5”], “command”: “xdebug_session_start”},
{“keys”: [“ctrl+alt+l”], “command”: “xdebug_layout”, “args”: {“keymap” : true}}
]