PHP: Debugger, Profiler and more
Upcoming SlideShare
Loading in...5
×
 

PHP: Debugger, Profiler and more

on

  • 6,350 views

Slide introduce about the process of debugging and profling a web application. How to use PHPED debugger to debug your application and Xdebug to profile your application.

Slide introduce about the process of debugging and profling a web application. How to use PHPED debugger to debug your application and Xdebug to profile your application.

Statistics

Views

Total Views
6,350
Views on SlideShare
4,771
Embed Views
1,579

Actions

Likes
2
Downloads
85
Comments
0

6 Embeds 1,579

http://bloghoctap.com 1559
http://www.connecttoshare.com 10
http://share8c.com 4
http://www.techgig.com 3
http://webcache.googleusercontent.com 2
http://reader.vn 1

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

PHP: Debugger, Profiler and more PHP: Debugger, Profiler and more Presentation Transcript

  • PHP Debugger, Profiler & more Vo Duy Tuan – <tuanmaster2002@yahoo.com> Bloghoctap.com Coding is not enough!
  • $Table_of_contents
    • IDEs for Web Developer
    • Debugging
    • Profiling
    • Load Testing
    Tài trợ:
    • Learn about IDE.
    IDEs for Web Developer 1
  • 1.1. What is an IDE?
    • Integrated Development Environment
    • Application for software development
    • Common Features:
      • Syntax highlight
      • Autocomplete
      • File Explorer
      • Collapse/Expand
  • 1.2. Common IDEs for Web Developer
    • Notepad, Notepad++
    • Adobe Dreamweaver
    • Aptana
    • Komodo
    • PhpEd
    • Zend Studio
    • PHP Designer
  • 1.3. Recommend Features for PHP IDE
    • Built-in parser
    • Documentor
    • Debugger
    • DB Client
    • Text Format
  • 1.4. Small Quizz
      • What is the difference between 2 screenshots?
    • IDE for PHP, support HTML, CSS
    • Paid Software, current version: 5.9
    • Main Features:
      • Debugger
      • Autocomplete
      • DB Client
      • Documentor
      • Code Explorer
      • Exclude folders, files in project.
    1.5. NuSphere PhpEd Introduction
  • 1.6. NuSphere PhpEd screenshot
    • Learn how to use PhpEd Debugger to debug your web applications.
    Debugging 2
    • What is debug?
      • Find errors in your code.
    • How to debug?
      • Output with HTML: echo() , print_r() , var_dump()
      • Store debug information: File, Database
      • Live debug: PhpEd Debugger
    2.1. Debug Introduction
    • Integrate with Firefox (DBGbar addon)
    • Step debugging
    • Multi breakpoint
    • Watch runtime variables
    • Watch call stack
    • Remote debugging
    2.2. PhpEd Debugger features
  • 2.3. PhpEd Debugger Installation
    • Step 1: Install php extension
    • Step 2: Install DBGbar addon for Firefox
    • Step 3: Update PHP.INI config
    • Restart your web server (if needed)
  • Step 1: Install PHP Extension
    • Go to ‘C:..nuspherephpeddebuggerserver’
    • Select correct library for your platform and PHP version
    • Copy file (.dll on Windows) to php extension folder
  • Step 2: Install DBGbar addon
    • In Firefox, go to menu Tools >> Add-ons
    • Search ‘DBGbar’ and install.
    • Restart Firefox, you will get DBGbar toolbar:
  • Step 3: Update PHP.INI config
    • Add dbg extension to extension list:
      • extension=dbg-php-5.2.dll
    • Add configuration for debugger
      • [debugger] debugger.enabled=on debugger.profiler_enabled=on debugger.hosts_allow=localhost apple.com debugger.hosts_deny=ALL debugger.ports=7869, 10000/16
  • 2.4. PhpEd Debugger usage
  • 2.5. DEMO Debugging
    • Learn how to use Xdebug extension to find bottleneck and increase performance for your web applications.
    Profiling 3
  • 3.1. Profiling Introduction
    • Find bottleneck
    • Make application run faste
  • 3.2. Two ways of profiling
    • Built-in profiler
    • 3 rd -party profiler
  • 3.2.1. Built-in profiler
    • Tracking code embed in your PHP code
    • Example: Using timer start & stop
  • 3.2.1. Built-in profiler…cont.
  • 3.2.2. 3 rd -party profiler
    • Install new extension
    • Do not change your PHP code
    • More Information
    • Famous Library: Xdebug
  • 3.3. Xdebug Installation
    • Step 1: Install php extension
    • Step 2: Update PHP.INI config
    • Restart your server (if needed)
  • Step 1: Install php extension
    • Download correct extension for your platform & PHP version
    • Can go to ‘ http://www.xdebug.org/find-binary.php ’ to find correct Xdebug file for your system from phpinfo() output
    • Copy file (.dll on Windows) to php extension folder
  • Step 2: Update PHP.INI config
    • Add configuration for xdebug:
      • [xdebug]
      • zend_extension_ts = C:AppServphp5extphp_xdebug-2.1.0-5.2-vc6.dll
      • xdebug.profiler_output_dir = &quot;C:xdebug&quot;
      • xdebug.profiler_output_name = &quot;callgrind.%R.%t&quot;
      • xdebug.profiler_enable = 0
      • xdebug.profiler_append=0
      • xdebug.profiler_enable_trigger = 1
      • xdebug.extended_info=1
  • 3.4. Xdebug Usage
    • Step 1: Generate cachegrind file
      • Base on xdebug config in PHP.INI to create cachegrind file.
      • For above php.ini config: Add parameter XDEBUG_PROFILE to your request string will create cachegrind file. Examp;e:
        • Normal : http://bloghoctap.com
        • Profiler: http://bloghoctap.com?XDEBUG_PROFILE
  • 2.4. Xdebug Usage…
    • Step 2: View & analyze your profile result:
      • WinCacheGrind
      • Kcachegrind
  • 2.4.1. WinCacheGrind Viewer
  • 2.4.2. Kcachegrind Viewer
  • 3.5. DEMO Profiling
    • Benchmark your web application.
    Load Testing 4
  • 4.1. ApacheBench
  • 4.2. Apache jMeter
    • … Võ Duy Tuấn
    • … [email_address]
    • … Web Freelancer
    • … PHP Trainer
    • … http://blogHoctap.com
    you_forgot If
    • It’s time to query …
    Thanks you!