Reviews & Opinions
Independent and trusted. Read before buy PHP PHP!

PHP PHP


Bookmark
PHP PHP

Bookmark and Share

 

Winchester X22LRHSS1 Win 22LR 37gr PHP 100pk
Winchester Super Speed Super-X 22LR 37Gr Plated HollowPoint 100 2000 X22LRHSS1. Available online.

Details
Brand: WINCHESTER
Part Numbers: WNX22LRHSS1, X22LRHSS1, wnx22lrhss1, x22lrhss1
UPC: 020892102026, 2089210202, 20892102026


Here you can find all about PHP PHP, for example input and . You can also write a review.
[ Report abuse or wrong photo | Share your PHP PHP photo ]

 

 

Manual

Preview of first few manual pages (at low quality). Check before download. Click to enlarge.
Manual - 1 page  Manual - 2 page  Manual - 3 page 

Download (French)
PHP PHP Laptop & Notebook, size: 12.2 MB
Download (English)
Check if your language version is avaliable.
Most of manuals are avaliable in many languages.

 

PHP PHP

 

 

User reviews and opinions

<== Click here to post a new opinion, comment, review, etc.

No opinions have been provided. Be the first and add a new opinion/review.

 

Documents

doc0

Functional Behavioral Assessment and Positive Interventions: What Parents Need to Know

By Dixie Jordan

Many children have inappropriate behaviors that are part of their disability. These behaviors may make it dicult to learn, cause harm to the child or others, or isolate a child from his or her peers. Some children have behaviors that they cant control, such as tics for a child with Tourette syndrome or self-harming behaviors for some children with developmental disabilities. Some children may be sad or anxious. Others simply have not learned positive ways to have their needs met. In any of these instances, the behaviors interfere with the childrens ability to learn the skills they need to be successful. We can teach appropriate behavior skills to children! To do so, we need to understand problem behaviors, such as where they occur and what purpose they serve for a child. The process of learning about how children develop problem behaviors is called functional behavioral assessment (FBA). If we learn about the behaviors and know when and where they are likely to happen, we can plan positive strategies to teach new behaviors. These strategies are called positive behavioral interventions. Teachers and parents will use the information from an FBA to help a child learn new skills. The goal is to teach children how to manage their own behaviors. This overview will help parents understand functional behavioral assessments and positive interventions. You have a very important role in this assessment, because you have information about your child that no one else has. When you understand the process, you can work eectively with the rest of the team. You will have the tools to make decisions when a functional behavioral assessment is proposed for your child. What you know about your child will be used to help develop eective instruction.

Thinking about behavior

Adults often have two dierent approaches to dealing with problem behaviors. These dierent approaches are based on dierent beliefs. One belief is that the child is a problem, and the other is that the child has a problem.

The child is a problem

Billy is a 12-year-old sixth-grade student. He refuses to do his schoolwork, and then his teacher does not know what to do. He becomes angry when the teacher reminds him to get to work. He screams, swears, and even throws his work on the oor so the teacher will leave him alone. The teacher may think Billy is lazy, mean, or disrespectful. The teacher may feel angry or threatened. Adults who are angry often use punishment or threats: Do it or else. We do not always realize that children do not think about their problem behaviors the way we do. When we punish often, children may see us as uncaring. Some may come to fear or avoid us. Others may become even louder and angrier because of the punishment. Children who do not back down when arguing with adults often receive increasingly harsh punishments. Many adults think children should not be permitted to win disagreements. Children, on the other hand, often say things they do not really mean because they are angry. They may refuse to give up even if they lose privileges or are suspended from school. When a child is suspended from school for problem behaviors, some people think of it as good medicine for bad behavior. They think the removal teaches the child a lesson and that the child will change the problem behaviors as a result. But what if that child does not like going to school? He or she may learn that using problem behaviors is a good way to earn a vacation from school. The child may actually
2006 PACER Center | ACTion Sheet: PHP-c79
want what we think is a punishment.

The child has a problem

Billy, the 12-year-old described earlier, has behaviors that need to change. Lets assume we have assessment data that give a clearer picture of Billy. We nd that he reads at a second-grade level. He was sexually abused at age three by a neighbor. Billy is angry over his parents recent divorce and continuing custody battle. He is worried about where he will live. Clearly Billys problem behaviors must change. They are serious and interfere with learning. What we decide to do about the behavior, however, comes from how we feel about it and whether we believe it is willful. That is where a functional behavioral assessment comes in. It can help us to identify why Billy is frustrated and angry, so we can help him to learn the skills he needs. A reasonable person would have a hard time believing that punishment alone could help Billy succeed.

likely to argue with the teacher when she sits next to Mark. If the teacher thinks Mary argues because she wants Mark to notice her, there are several things the teacher can do. She can separate Mary and Mark so that Mary does not try so hard to get his attention. She can also teach Mary more positive ways to gain Marks attention and provide positive reinforcement for using the new behaviors.
Behaviors are governed by their consequences
John has a ght (behavior) and is suspended from school (consequence). If John loves school and can control the behavior, the consequence is negative because he has to give up something he wants (school). If John dislikes school, however, he may see that same consequence as positive. He may learn that ghting is a good way to be sent home. The next time John does not want to be in school, what behavior is he likely to use? Many of us have learned to deal with problem behaviors by doing nothing until they occur. After a child uses the behaviors, we punish. Punishment does not teach new skills, though. Its goal is to stop problem behaviors from continuing. If we do not teach a child what to do instead, the child will probably continue to misbehave. Any time a child uses a behavior that is successful in meeting a need, the behavior is likely to be repeated. The behavior serves a function for the child. Most people agree that we need to have consequences for problem behaviors. We must also focus on teaching the positive behavior skills we would like to see. If we can understand the function of problem behaviors, we can teach a child more positive behaviors that serve the same function, and the problem behaviors are no longer needed.
Positive Behavioral Interventions
Positive: characterized by or displaying approval, acceptance, or armation. Behavior: what we do. Intervention: an action that changes a course of events. (Adapted from Merriam Websters Tenth Collegiate Dictionary.)
The 2004 Individuals with Disabilities Education Act (IDEA) states:
The IEP Team shall, in the case of a child whose behavior impedes the childs learning or that of others, consider the use of positive behavioral interventions and supports, and other strategies, to address that behavior. IDEA Section 614 (d) Positive behavioral interventions are used before problem behaviors occur. To develop positive interventions, the team must understand why a child has problem behaviors and what strategies might be helpful. Many dierent strategies can be used to reduce problem behaviors in school: changing where a child sits in the classroom, adjusting the schoolwork, rewarding the child for positive behaviors. The childs teacher may speak in a dierent tone of voice to help the child remain calm. Adults may try to keep calm when the child is angry. The goal is to stop or reduce the problem behaviors so that punishment does not become necessary. Here is an example: The teacher knows that Mary is more

What is a functional behavioral assessment?
A Functional behavioral assessment (FBA) is a process for collecting information. The data the team collects are used to help determine why problem behaviors occur. The data will also help identify ways to address the behaviors. Functional behavioral assessment data are used to develop a positive behavioral intervention plan. The Individuals with Disabilities Education Act of 2004 specically requires an FBA whenever a child with a disability has his or her current placement changed for disciplinary reasons. This does not mean that we should not think about FBA at other times, too. The evaluation requirements of IDEA make it clear that children must be evaluated in all areas related to the suspected disability. This means that if your child has problem behaviors that are not improving, your child may
need an evaluation to examine the behaviors more closely. You may request a FBA at any time if your childs problem behaviors are becoming worse, or when the team cannot explain to you why the problem behaviors occur. There are many reasons a child might misbehave. Some have to do with the nature of the child, such as allergies to dust, foods, or plants. A sinus infection, headache, or toothache can also lead to problem behaviors. Some children have a medical diagnosis, such as bipolar disorder or attentiondecit/hyper-activity disorder that aects behavior. The teams responsibility is to collect data to help it understand why a child has problem behaviors. The people who complete the functional behavioral assessment use dierent ways to collect data. School sta may interview you and your child. They observe your child in dierent settings, such as the lunchroom or classroom, or on the playground. They gather reports from teachers and others. The team reviews your childs records, including any assessments you would like to share. The results of this process should lead to a hypothesis about why problem behaviors occur. A hypothesis is an educated guess, based on the data the team has gathered. Assessment results are used to develop a positive behavior intervention plan.
not there. Or the child may be anxious about what to expect with a new teacher. A child who is upset about having a new teacher may use problem behaviors in order to be placed in a less stressful setting. Some children would rather be in a time-out space than in their classroom. Unfortunately, consequences that improve the behaviors of most students do not work with all. Sending a child to the principals oce, for example, can be ineective if the consequence does not address the complex function of a childs behavior. What a child does (the behavior) and why a child does it (the function) may be unrelated. Skipping school and getting good grades are two very dierent behaviors. Yet they may serve the same function for dierent childrengaining adult attention. Two children may both want to be noticed by their parents; one may study hard to have good grades while the other skips class. They do very dierent things to get the attention they want. While the function of both behaviors is positive (parent attention), skipping class is not an acceptable way to be noticed.

Behaviors are inuenced by events in the environment (antecedents)
What happens in an environment aects behavior. The size of a classroom, the number of students, transitions, or early morning bus incidents are all antecedents that might aect a childs behavior. It is important to know what leads to both positive and negative behaviors. If teachers and parents understand the conditions that lead to problem behaviors, then changing the conditions may reduce the need for the behaviors. Positive teaching strategies such as providing structure, routine, and rewards for appropriate behaviors help to increase positive behavior skills.
Behaviors are context-related
Most behaviors are related to their context. This means that behaviors often result from what is happening in the childs world or environment. These are just a few of the factors that may lead to problem behaviors:
a disagreement between children the number of children in a classroom the quality of peer relationships the size of the classroom medicine changes the diculty of schoolwork
Steps in conducting a functional behavioral assessment
The Individuals with Disabilities Education Act of 2004 does not dene how a functional behavioral assessment is done. The process may vary with the needs of each child. However, several specic steps are always part of this kind of assessment. The process begins with identifying the specic behaviors that must change. If a child has many problem behaviors, it will be important to focus on the most serious one or two behaviors. The problem behaviors are described in a way that helps everyone to understand exactly what the behaviors are. These are typical steps: 1. Identify and agree on the behavior(s) that most need to change.
Other things, such as whom is present and what their expectations are, also aect behaviors. Behaviors may also be a problem when a child is emotionally upset and cannot handle the demands of the environment.
Behaviors serve a function
Problem behaviors usually serve a function, or purpose, for the child. Sometimes we see problem behaviors when a substitute teacher is in the classroom. In this case, we must be careful not to assume that the child doesnt like the teacher or that the child wants to show o for friends. Perhaps the child likes his or her regular teacher and is upset when she is

2. Determine where the behaviors occur and where they do not. Identify what may contribute to the behaviors. The team will ask these kinds of questions:
What is unique about the environments where behaviors are not a concern? What is dierent in the places where the problem behaviors do occur? Could they be related to how the child and teacher get along? Does the number of other students or the work a child is asked to do cause the problem? Could the time of day or a childs mood aect the behaviors? Was there a bus problem or a disagreement in the hallway? Are the behaviors likely to occur in a specic set of circumstances or a specic setting? What events seem to support the problem behaviors?
strategies to replace problem behaviors with appropriate behaviors that serve the same function for the child supports for the child to use the appropriate behaviors
A positive behavior intervention plan is not a plan to determine what happens to a student who violates a rule or code of conduct. That would be more appropriately called a discipline plan or a punishment plan.
School discipline policies
The IEP team determines whether the school discipline policies need to be amended for a child, or whether the consequences need to be dierent from those written into the policy. This decision should be based on evaluation and a review of the records, including the discipline records or any manifestation determination review(s) that have been completed by the school. A childs IEP or behavior intervention plan should focus on teaching skills. Sometimes school discipline policies are not successful in correcting problem behaviors. That is, the child does not learn what the school sta intended through the use of punishments such as suspension. The child may learn instead that problem behaviors are useful in meeting a need, such as being noticed by peers. When this is true, it is dicult to defend punishment, by itself, as eective in changing problem behaviors. One of the most useful questions parents can ask when they have concerns about the discipline recommendations for their child is Where are the data that support the recommendations? Special education decisions are based on data. If school sta wants to use a specic discipline procedure, they should check for data that support the use of the procedure. For instance, if your child has been repeatedly suspended from school for a problem behavior, has suspension taught your child the skills he or she needs to learn?
3. Collect data on the childs performance from as many sources as possible. 4. Develop a hypothesis about why problem behaviors occur (the function of the behaviors). A hypothesis is an educated guess, based on data. It helps predict where and why problem behaviors are most likely to occur, and where and why they are least likely to occur. 5. Identify other behaviors that can be taught that will serve the same function for the child. 6. Test the hypothesis. The team develops and uses positive behavioral interventions that are written into the childs IEP or behavior intervention plan. 7. Evaluate the success of the interventions. Change or netune as needed. If children have behaviors that place them or others in danger, they may need a crisis intervention plan. Crisis interventions should be developed before they are needed. The team should decide what behaviors are crises and what they (and the child) will do in a crisis. By having a plan that guides actions, teachers can help children through dicult emotional situations.

Zero-tolerance policies

Many school districts have zero-tolerance policies that provide immediate negative consequences for specic behaviors. Such policies simply do not provide eective consequences for all children who violate them. If a child with a disability violates a zero-tolerance policy, the consequence may or may not be eective, given that childs needs. Consequences for problem behaviors must not discriminate against a child based on his or her disability. The IEP team is responsible for determining whether exceptions need to be made to the written school district discipline policy for a student, or whether the student needs
Behavior intervention plan
An eective behavior intervention plan (often called a behavior support plan or positive intervention plan) is used to teach or reinforce positive behaviors. Typically, a childs team develops the plan. It usually includes:
skills training to increase appropriate behavior changes that will be made in classrooms or other environments to reduce or eliminate problem behaviors
a dierent consequence for misbehaviors than is written into the school discipline policies. Instructional goals may need to be written into the IEP to help remediate the problems a child is having in following school discipline policies. While some administrators may not want to make exceptions to schoolwide discipline policies established for all students, exceptions are sometimes necessary. Some students who are unable to conform their behavior to the school expectations may need to have individualized consequences that will be more eective in supporting positive behaviors. In the U.S. legal system, the consequences for breaking a law are generally based on an evaluation of the events around the violation. Yet schools often have one discipline standard for all students regardless of individual needs. They may use the same consequences for all students. Parents must carefully examine school policies to help determine whether modications need to be made to meet the needs of their child.
is especially useful for parents when their child is having a tantrum for attention. Many adults nd it dicult to ignore behaviors, however, especially if the behaviors interrupt what the adult is doing. Also, attention-seeking behaviors often get worse before they eventually go away. Planned ignoring is not suitable for behaviors that are extremely disruptive. It also may not work if other children laugh at the problem behaviors the adult is trying to ignore. Some behaviors, including those that are unsafe or that include peer issues such as arguing, can grow quickly into more serious behaviors. It may not be possible to ignore these kinds of behaviors. Planned ignoring should never be used for unsafe behaviors. As children grow older and want attention more from their friends than from adults, planned ignoring is less useful. Preventive cueing (also called signal interference) lets a child know when he or she is doing something that is not acceptable. Teachers or parents can frown, shake their head, make eye contact, point to a seat for a wandering child, or snap their ngers, to let the child know he or she needs to pay attention or to stop the problem behaviors. When using preventive cueing it is important not to smile or look pleased with a child. Preventive cueing may be used in steps, depending on the behaviors and how often they occur or how serious they are. For instance, a hand motion may work the rst time or two, but it may need to be combined with eye contact or a shake of the head for the next oense. Proximity control means that a teacher or adult moves closer to the child in a gentle way. If the teacher does not get the childs attention by using cues, then he or she may move closer to the student or give the lesson while standing near the childs desk. Touch control, meaning touch that is not resisted, is a nonverbal guided intervention. It is used to direct a student toward positive behavior. For example, a teacher may gently place a hand on a childs shoulder to steer the child back to his or her desk. Touch control should never be used with children who react angrily or when school policy does not permit its use. If a childs records show that he or she has a history of violence, has been abused or maltreated, is anxious, or has a mental illness or psychosis, touch control should not be used, unless specically agreed to by a physician or psychologist. Humor directed either at the teacher or the situationnever at the childcan defuse tensions as well as redirect children. Humor must never be used to demean a child or be used in a manner that might encourage others in the class to ridicule the child.

Examples of behavioral intervention strategies
Schools use the following common strategies to help reduce problem behaviors and teach children positive behavioral skills. Stop, Relax, and Think teaches children how to think about the problem they are having and nd a solution. Children learn the steps:
1. Dene the problem. 2. Decide who owns the problem. 3. Think of as many solutions as possible to solve the problem. 4. Select a solution to try. 5. Use the solution. 6. Evaluate its success.
After children understand the steps, role-play and practice can help the process become habit. Helping children to recognize their own response to stress (clenched hands, voice tone, etc.) may become part of the instruction needed to use this strategy eectively. Planned ignoring is useful in stopping behaviors that are annoying. For example, it is useful for students who yell or interrupt the class to attract the teachers attention or that of students who are not prepared for class. Planned ignoring acknowledges that childrens problem behaviors serve a function. If the purpose of a problem behavior is to gain adult attention, then not providing attention means that the behavior does not work. The behavior lessens over time and eventually disappears. Ignoring nonserious behavior
Nonverbal warnings give a child the opportunity to regain control without being singled out for a verbal reprimand. For example, a teacher might place a colored warning cue card or a note on a desk as he or she moves through the room, or hold up the number of ngers that corresponds to the rule being challenged. Discipline privately. Many children see it as a challenge when teachers attempt to discipline them in front of their peers. Children rarely lose these challenges, even when adults use negative consequences. Young people can gain stature from peers by publicly refusing to obey a teacher. A child is more likely to accept discipline if his or her peers are not watching the process. Positive phrasing lets children know the positive results for using appropriate behaviors. As simple as it sounds, this can be dicult. Teachers and parents are used to focusing on misbehavior. Warning children about a negative response to problem behaviors often seems easier than describing the positive impact of positive behaviors. Compare the dierence between positive phrasing and negative phrasing:
Positive phrasing: If you nish your reading by recess, we can all go outside together and play a game. Negative phrasing: If you do not nish your reading by recess, you will have to stay inside until its done.
Behavior shaping acknowledges that not all children can do everything at 100 percent. If a child does not turn in papers daily, expecting that papers will be turned in 100 percent of the time is not realistic. By rewarding small gains and reinforcing the gains as they occur, children learn how to stick with a task and to improve the skill. Clear routines and expectations let children know what comes next in their school day, reducing anxiety or fear. Teachers who post and review the rules daily establish expectations for behavior during the day. For additional information on positive behavioral interventions and functional behavioral assessment as well as related topics, contact the following:

PACER Center 8161 Normandale Boulevard Minneapolis, MN 55437-1044 952-838-9000, Voice 952-838-0199, Fax 952-838-0190, TTY 800-537-2237, Toll-free in MN pacer@pacer.org www.pacer.org Center on Positive Behavioral Interventions and Supports 1235 University of Oregon 1761 Alder Street Eugene, OR 97403 Voice (541) 346-2505 E-mail: pbis@oregon.uoregon.edu www.pbis.org American Institute for Research 1000 Thomas Jeerson Street, NW Washington, DC 20007 202-403-5000 E-mail: inquiry@air.org www.air.org
Positive phrasing helps children learn that positive behaviors lead to positive outcomes. This, in turn, can help them gain control of their behaviors. I-messages, described by Thomas Gordon in his 1974 book Teacher Eectiveness Training, helps children learn about how their problem behaviors aect others. It also demonstrates the importance of taking responsibility for ones own behavior. For example, parents or teachers will use language like Im upset when. not You are bad when. When a child has a good relationship with parents and teachers, I-messages can help him or her to understand how the problem behaviors aect adults. If the child dislikes the teacher, though, using I-statements can be a problem. It may even help the child to more eectively annoy the teacher.

doc1

Debugging PHP using Eclipse and PDT
Use XDebug or Zend Debugger to boost your productivity when fixing bugs in PHP applications
Skill Level: Intermediate Nathan A. Good (mail@nathanagood.com) Senior Information Engineer Consultant
17 Jun 2008 The PHP Development Tools (PDT) plug-in, when installed with Eclipse Europa, gives you that ability to quickly write and debug PHP scripts and pages. PDT supports two debugging tools: XDebug and the Zend Debugger. Learn how to configure PDT for debugging PHP scripts and discover which perspectives you use when taking closer looks at your scripts.
Section 1. Before you start

About this tutorial

This tutorial demonstrates how to configure the PHP Development Tools (PDT) plug-in for Eclipse to debug your PHP scripts. It also introduces the perspectives you'll use (namely, PHP Debug) when taking closer looks at your PHP scripts.

Objectives

After completing this tutorial, you'll be able to set up either XDebug an open source project that allows you to debug executable scripts and scripts running on a Web server or the Zend Debugger in Eclipse using the PDT project to develop
Debugging PHP using Eclipse and PDT Copyright IBM Corporation 1994, 2008. All rights reserved.

Page 1 of 35

developerWorks

ibm.com/developerWorks

PHP applications. You'll understand the various parts of the PDT project's PHP Debug perspective and learn how to set up, view, and work with breakpoints. You also learn how to inspect the values of variables as you are stepping through the code, as well as how to debug PHP Web applications on your local server so you can run through your PHP Web application with the debugger.

Prerequisites

To get the most out of this tutorial, you should have done a bit of PHP development. But what matters more is that you've done software development in general. You'll understand the debugging concepts better if you're familiar with debugging any other language. I wrote this to be helpful to those who are fairly new to Eclipse, rather than to those who have been using Eclipse for a while.

System requirements

To complete this tutorial, you need: Computer running Microsoft Windows, Mac OS X, or Linux The examples of the php.ini file shown in this tutorial are for Mac OS X and Linux. Because both debuggers require a configuration that tells PHP where the debugger extensions are located, the only noticeable difference if you're looking for Windows examples is the path to the debugger extension. Library names end in.so. for Mac OS X and Linux and.dll for Windows; also, paths use a forward slash (/) instead of a backslash (\) as a directory-separator character. PHP V5.x Linux users can install PHP using the software package system included in their distribution. OS X, and Windows users can find PHP V5.x at PHP.net. Note: The examples in this tutorial were written using PHP V5.2.5. Eclipse V3.3 Again, Linux users have it easy: Eclipse is usually available through the package system included in their distribution. Everyone else can find the Eclipse integrated development environment (IDE) at the Eclipse downloads. Apache or Microsoft Internet Information Services (IIS) for serving Web applications You need a Web server installed to run the examples that demonstrate how to debug PHP Web pages on the server. However, if you're interested only in debugging PHP scripts that aren't Web pages, you won't need a Web server. For this tutorial, we have Apache V2 set up as the Web server. If you're using
Debugging PHP using Eclipse and PDT Page 2 of 35
Copyright IBM Corporation 1994, 2008. All rights reserved.
Windows and would rather use IIS, that works, too. This tutorial assumes you have the proper access to write to directories inside the document root of the Web server. Eclipse PHP Development Tools framework If you don't already have PHP Development Tools (PDT) installed, you may want to read ahead to the "Overview of the PDT project" section so you can decide whether you want to download and install PDT already bundled with the Zend Debugger. The Eclipse Foundation PDT/Installation wiki is brief, but helpful. Zend Studio Web Debugger Download a 30-day trial version of the Zend Studio Web Debugger.

Section 2. Getting started
Debugging PHP the old way
Before being able to use a debugger inside an IDE, my main methods for debugging PHP scripts were to: 1. 2. Set up a bunch of echo statements that printed variable values. I'd have to take these out or comment them out before deploying the script. Use "I am here" echo statements to print the position in the scripts. I'd also have to remove these lines of code or comment them out before deploying the script. Tweak the php.ini file to tell PHP to print verbose messaging, including warnings. Doing this can be a security concern, as it may display things you don't want to display. If you're doing development locally and deploying the scripts to a different server, this is less of an issue. Use a logger class, such as the Log PEAR module. This is a great option because the logger allows you to set priorities so you can quiet debugging messages later. However, it requires an amount of time albeit relatively small to configure and to come up with a process for having different logging levels in different environments. Typically, you might want to see "debug" messages in development environments, but only "warning" messages or above in production environments. Regardless of your

Page 3 of 35

debugging technique, I recommend finding and using a logging framework for your PHP applications. A drawback of debuggers is that sometimes developers are tempted to neglect the time investment of adding proper logging. All these techniques, while they worked fine for me for a few years, consume much more time than stepping through an application in a debugger. So, you can save a great deal of time using a debugger from inside the IDE. The setup of both debuggers XDebug and the Zend Debugger is covered here.
Overview of the PDT project
The PDT plug-in, when installed with Eclipse Europa, gives you that ability to quickly write and debug PHP scripts and pages. The PDT project supports two debugging tools: XDebug and the Zend Debugger. This tutorial demonstrates how to configure PDT for debugging PHP scripts using either debugger. PDT V1.0 was released in September 2007. The tools work with the Web Tools Platform (WTP) to provide the ability to build PHP projects and PHP files with Eclipse. The PDT project provides features you'll be used to if you're already using Eclipse for Java development like the PHP perspective and the PHP Debugging perspective. The PHP editor has syntax highlighting, code formatting, syntax verification, and code templates. Using PDT, you can execute PHP scripts and run them on a Web server, and PDT also supports debugging PHP files locally and on a server (although the debugging requires a bit of setup). This tutorial focuses on configuring PDT to use one of the supported debuggers for PDT: XDebug or the Zend Debugger by Zend Software (see Resources). You don't need both debuggers installed; you can pick and use one of them. This tutorial covers both, allowing you to make a decision about which one you would like to use and install. When you have one installed, you can debug any PHP script. With the PHP Debug perspective, you can view variable values and breakpoints as well as step through the code. The next section dives into the different parts of the perspective and how you use them.

Getting ready for this tutorial
Web server-accessible folders
The Apache Web server supports a feature called UserDir, or user directories, where the Apache Web server looks for a folder matching a preconfigured folder name and, when found, maps it to a URL with a tilde (~) appended to the user name. On Mac OS X, this folder is called Sites by default; on other operating systems, it has names like public_html or public_www or even www. Check your Web-server configuration because limiting your project's
Debugging PHP using Eclipse and PDT Page 4 of 35
contents to your home directory can be a really good idea. If you have IIS, it's convenient enough to create a virtual folder mapped to a directory in which you can place your project contents. As a last option, create a folder directly under your Web server's document root and place the project resources in that.
After you've installed PDT, you must add a couple of projects you can use to follow along. The first is a simple script that prints a greeting a certain number of times. The second project is a Web application with two pages. These examples work fine with either debugger, and you don't need to set up the debuggers before adding these projects. Add the simple project The simple PHP project with a simple example script demonstrates the features of the debuggers and PDT Debug perspective. Perform the following steps to create a simple PHP project to use as an example if you don't already have an example available. (Alternatively, download the code from the Download section.) 1. Choose New > Project, then select PHP Project from the list, as shown in Figure 1, then click Next.
Figure 1. Adding a PHP project

Page 5 of 35

Type simpleDebugExample for the project name, as shown below. Select the Use default checkbox, then click Finish.
Figure 2. Entering the project information
Debugging PHP using Eclipse and PDT Page 6 of 35
When the project appears in your workspace, add the file in Listing 1.
Listing 1. helloworld.php
<?php $name = "world"; for ($i = 0; $i %gt; 100; $i++) { print("Hello, $name ($i)!\n"); } ?>
Add the Web application sample The Web application example has a couple of Web pages so you can see how to

Page 7 of 35

use the debuggers to debug PHP Web pages on the server from page to page. You'll be able to see how you can catch variables posted from one page to another. To set up the Web application example: 1. Choose New > Project to add a new project, then select PHP Project from the list, as shown in Figure 3, then click Next.
Figure 3. Adding a PHP Web project
Modify where the project contents reside. Unlike the simple example, you may need to modify where the project contents are located. To make such a modification, clear the Use default checkbox, then click Browse to find a suitable location for your PHP Web
Debugging PHP using Eclipse and PDT Page 8 of 35
pages. Because these Web pages need to be executed on the server, you can either build your entire workspace in a location where your Web server can reach it or tweak this setting to put certain package contents in an accessible location. I don't like having my whole workspace accessible by the Web server, so I use this setting to put only my Web application contents in a folder. My setting, for example, is /Users/nagood/Sites/webDebugExample. On my computer, that directory is accessible at the URL http://localhost/~nagood/webDebugExample. 3. After adding the new project, add three new files. The first enterGreeting.php is shown in Listing 2.
Listing 2. enterGreeting.php
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Insert title here</title> </head> <body> <?php $name = "world"; print("<b>Hello, $name</b>"); ?> <form action="results.php" method="post"> <input type="hidden" name="name" value="<?php print($name); ?>" /> <input type="text" name="greeting" value="" /> <input type="submit" value="Submit" /> </form> </body> </html>
Add the second of the three files: results.php. The contents of this file are shown in Listing 3.

Listing 3. results.php

<html> <head><title>Results</title> </head> <body> <?php include_once 'GreetMaster2000.php'; print ("Hello, ". $_POST['name']. "!"); print ("<br />"); $gm = new GreetMaster2000(); $gm->setGreeting($_POST['greeting']);

Page 9 of 35

print ("<b>Your greeting is: "</i></b>"); ?> </body> </html>
<i>". $gm->getFormalGreeting().
Add the third of the three files GreetMaster2000.php which is shown in Listing 4. This file contains a class to demonstrate what classes look like when they're debugged.
Listing 4. GreetMaster2000.php
<?php class GreetMaster2000 { private $greeting; private $name; public function __construct() { $this->name = "The GreetMaster 2000 (model Z)"; } public function setGreeting($message) { $this->greeting = $message; } public function getGreeting() { return $this->greeting; } public function getFormalGreeting() { return "I, the ". $this->name. ", say to you: $this->getGreeting(). "\""; } } ?>

\"".

Section 3. The PHP Debug perspective
Before setting up the debuggers and starting to debug the projects you've just created, familiarize yourself with the PHP Debug perspective so you feel comfortable debugging your PHP application. The first time you choose Debug As > PHP Script or Debug As > PHP Web Page to debug a PHP file, Eclipse asks if you want to switch to the PHP Debug
Debugging PHP using Eclipse and PDT Page 10 of 35
perspective. If you click Yes, the perspective shown in Figure 4 appears. The different views contain most commonly used information while debugging a PHP script. Figure 4. The PHP Debug perspective

The Debug view

The Debug view displays information about the processes that are running. On the tab shown in Figure 5, the code is stopped at line 5. Line 5 is inside the sayHello() function, which is listed in the view. The {main} entry always refers to the main body of the script, and you can tell by looking at the information in the Debug view that sayHello() is at line 13 of the script. Figure 5. The Debug view

Page 11 of 35

The Debug view has several buttons along its top border. While debugging, you use these buttons to step through, over, or out of parts of your PHP files. The buttons most commonly used are: Remove all terminated launches This cleans up your Debug view by clearing all the terminated (completed) launches from the view. Whenever you start debugging a PHP file, a launch is recorded in the Debug view that has information about the process that was executed. After the process is terminated, it still hangs around in the Debug view. You can relaunch it by clicking Relaunch in the context menu. Execute to the next breakpoint The debugger runs the current debug process until the next breakpoint. If you have no breakpoints set, the process runs through to completion. Pause the debugger Pause the process wherever it is currently. This can be convenient when debugging long-running loops to find out where you are if a breakpoint wasn't set. Terminate the debugger Stop debugging.

Debugging PHP using Eclipse and PDT Page 12 of 35
Disconnect the debugger If you're debugging on the server, clicking this disconnects the debugger client from the server. The server continues processing. Step into the code If the current line is a function, the debugger steps into the function so you can debug it. Step over the code If the current line is a function, the debugger skips over the function. The code inside the function will still be executed, but you won't have to step through it. Step out of the code If you're in a function and decide you don't want to debug anymore, click this. The function executes to completion, and your current stop point in the debugger jumps to the caller of this function.

The Variables view

The Variables view contains information about the variables that are in scope. Variables appear or disappear from this view as they come in and out of scope. The example below shows the values of the variables $howManyTimes and the looping variable $i. Figure 6. The Variables view

Page 13 of 35

The Breakpoints view
The Breakpoints view displays all breakpoints set for the entire project. From this view, you can temporarily disable a breakpoint by clearing the checkbox next to the breakpoint. Figure 7. The Breakpoints view
Debugging PHP using Eclipse and PDT Page 14 of 35

The Editor view

While you are stepping through the code, you can see the code in the PHP editor in the Editor view. Figure 8. The Editor view

Page 15 of 35

The Console view
If your PHP file is a simple script that prints messages using the print() or echo() method, those messages will appear in the Console view. For the simple example in this tutorial, you'll see the greeting printed to the console several times.

The Debug Output view

The Debug Output view displays the output from the debugger, where applicable. The Zend Debugger displays information in this view.

The Browser Output view

The Browser Output view shows what would be displayed to the browser if the PHP script were a Web page. When using the Zend Debugger, the output of the Web page while it is being drawn is printed here, in its raw HTML form. Seeing your page in this form may be helpful for those HTML elements that aren't necessarily visible when viewing your Web page in a browser.
Section 4. Installing and configuring the debuggers
At this point, you should have a couple of example projects set up in your workspace
Debugging PHP using Eclipse and PDT Page 16 of 35
and be familiar with the different views in the PHP Debug perspective. This section covers getting the debuggers configured and hooked into PDT so you can start debugging the PHP files in the example projects. Both debuggers require setup that basically includes copying an extension into a directory, configuring the php.ini file to use the extension, configuring the extension itself with a couple of configuration values, and restarting your Web server. After this work is done, you're able to start debugging your PHP Web application using either debugger. Note: If you only want to debug PHP scripts (and not Web pages on the server) and don't have PDT already installed, the fastest way for you to get debugging your PHP script is to use the Eclipse update site at Zend.com to install the version of PDT bundled with the Zend Debugger. After installing it, you will be immediately able to debug PHP scripts inside your IDE.

Install XDebug

To use XDebug as a debugger for PDT, you need to download XDebug and install it just like you would if you weren't using Eclipse at all. There are very good instructions for downloading and installing XDebug in Martin Streicher's article titled "Squash bugs in PHP applications with XDebug" (see Resources). As of this writing, these instructions still apply, and this tutorial covers them only at a very high level: 1. 2. Download the binary files (Windows) or source files (Linux or Mac OS X), as appropriate. If you're on Mac OS X or Linux, compile the XDebug libraries. To do so, first run the phpize command in the directory, then run the make command, as shown below.
Debugging PHP using Eclipse and PDT Page 18 of 35
Listing 7. Commands for compiling XDebug
# cd [directory_with_source] # phpize # make
Edit the php.ini file to include the module for XDebug using the appropriate zend_extension directive (see "Troubleshooting" for details). Restart your Web server. Verify that XDebug was installed correctly by using the php -m command or the phpinfo() function in a script on your Web server. An example of the phpinfo() output is shown in Figure 9. The php -m output is shown in Listing 8.
Figure 9. XDebug in the phpinfo() output
Listing 8. Example php -m output with XDebug

[Zend Modules] Xdebug

Page 19 of 35
zend_extension or zend_extension_ts?
If you don't already know which zend_extension directive to use, finding out can be a bit tricky. I was using the wrong one for a while, and it really threw me for a loop. See the "Troubleshooting" section for tips on determine which directive to use.
Before you can debug using PDT and XDebug, the module must be correctly installed. If you don't see the module information, check the "Troubleshooting" section for tips. Debugging takes a bit more work up front with XDebug than with the Zend Debugger because you may have to compile the module yourself. But now you're ready to debug both local scripts and files on the Web server.

Configure the debuggers

When you've installed either of the supported debuggers, you can configure how PDT works with it, further using the preferences in Eclipse under PHP\Debug, as shown below. Figure 10. PHP Debug preferences
Debugging PHP using Eclipse and PDT Page 20 of 35
Note that by default, the two debuggers are set up to listen on different ports: 10000 and 9000 for the Zend Debugger and XDebug, respectively. Depending on what you have set up in your environment, you may have to modify the settings. If you change the port settings, make sure the debuggers are not configured to be bound to the same ports (if you have both installed).
Section 5. Setting up PDT

Page 21 of 35

At this point, you should have XDebug or the Zend Debugger installed and configured, and you should have verified that it is properly installed. Before you can attach to either debugger and use it with PDT, you have to make a few configuration changes to PDT to tell it which debugger to use.

Set up your PHP servers

When you installed PDT, you should have gotten a PHP server on which to run your projects. If you already have a default Web server set up, you can skip this section. But if you didn't, you can set up a server so you can debug PHP Web pages on your local computer. To set up the server: 1. Open the PHP server preferences, expand PHP, then click PHP Servers, as shown below.
Figure 11. PHP server preferences
Debugging PHP using Eclipse and PDT Page 22 of 35
Click New to add a new server to the list. In Configure a PHP Server, type a name such as PHP Server in the Name field, then type the base URL (for example, http://localhost). Click Next. Click Add to add a new path mapping (see Figure 12). You can click Browse to select a location from your workspace, then make sure the full path to the resources appears in the Path on Server field. For example, in my webDebugExample project, I have /webDebugExample in the Path

Page 23 of 35

in Workspace and /Users/nagood/Sites/webDebug in the Path on Server fields. Figure 12. Adding a new server mapping
Set up the PHP executables
Before using the debugger, you must verify that the PHP executables are set up properly. Open the Eclipse preferences, expand PHP, then click PHP Executables, as shown in Figure 13. Here, you see a fresh installation of the bundled version of the PDT project from Zend's site; the executables are already set up, and there is nothing to do. Figure 13. PHP Executables preferences

Debugging PHP using Eclipse and PDT Page 24 of 35
To add and configure a new executable, click Add. The Add new PHP Executable window appears, as shown in Figure 14. Type a descriptive name (the name can include spaces) in the Name field, then click Browse to locate the PHP executable path (that is, /usr/local/php5/bin or C:\PHP) and the php.ini file (see "Troubleshooting" for hints on locating this file if you don't know where it is). Figure 14. Defining a PHP executable

Page 25 of 35

Finally, choose the correct PHP debugger. It matters: If you choose the incorrect debugger, your project might not execute at all or could execute, but not stop at breakpoints.
Section 6. Debugging your simple script or Web application
You have a few sample projects in your workspace. You should also have some familiarity with the PHP Debug perspective. Either or both of XDebug or the Zend Debugger is installed, configured properly, and verified. Finally, you should have PDT configured to use the debugger you installed. With all that complete, you're ready to debug your first PHP script.
Set breakpoints to debug your script
Debugging PHP using Eclipse and PDT Page 26 of 35
To see how debugging works, it's best to set up a breakpoint at which the debugger will stop. When the debugger has stopped at the breakpoint, you can use the various views in the PHP Debug perspective to inspect the variable values. You can also step through the code using the buttons in the Debug view. So set up a breakpoint on line 7 of your helloworld.php script. To do so, select helloworld.php, then choose Run > Debug As > PHP Script. If this is your first time debugging, Eclipse asks if you want to automatically switch to the PHP Debug perspective. If you want the PHP Debug perspective to be activated whenever you debug a PHP script, click Yes, then select Remember my decision, as shown below. Figure 15. Switching to the Debug PHP perspective automatically
When started, the PHP script breaks at the first line of code. This is by design in the default configuration. From here, you can step through the code or advance to the next breakpoint. If you advance to the breakpoint you set on line 7, the Debug view will say you are suspended at a breakpoint. Figure 16. Suspended at the breakpoint (line 7)
While you're still paused at the breakpoint, look at the Variables view (see Figure

Page 27 of 35

17). Both of the variables, $name and $i, are now in scope and you can see their values. The $name variable contains the string world, and the $i variable is set to 0. Figure 17. Variables at line 7 of helloworld.php

Because the breakpoint is inside a loop, executing to the next breakpoint goes to the next iteration in the loop. You can watch the value of $i increment in the Variables view. To continue execution without stopping at every iteration, open the Breakpoints view, as show in Figure 18. Temporarily disable the breakpoint by clearing the checkbox beside helloworld.php (line: 7). Now when you execute again to the next breakpoint, the debugger will skip all the next iterations and run to the end. Figure 18. Breakpoints in helloworld.php
You can add variables and modify the code to experiment and see how the debugger behaves.
Debug your Web application
Odds are you're using PHP to build a Web application and you want to debug your PHP scripts on the server. Debugging your PHP Web page on the server allows you to see how server variables such as $_GET and $_POST are set, so you know their value and can debug from page to page.
Debugging PHP using Eclipse and PDT Page 28 of 35
To try debugging a PHP application, use the webDebugExample project. This is a simple example that allows you to type a value in an input field, then submit the form for processing by the results.php script. In completing this exercise, you can follow how the $_POST variables are populated with the names and values of the variables from your form. Select enterGreeting.php, then choose Run > Debug As > PHP Web Page. If this is your first time running the debugger, you will be prompted for the launch URL for the file. Here, you type the full URL to your file, remembering that it will be at the location in which your Web resources reside. For example, mine is at http://localhost/~nagood/webDebug/enterGreeting.php. Next, set a breakpoint at line 14 in the results.php file. Listing 9. Breakpoint at line 14
print ("<b>Your greeting is:. "</i></b>"); <i>". $gm->getFormalGreeting()
When you launch the PHP Web application, the debugger stops at the first line in the enterGreeting.php file. You can step through it to see the debugger in action or just execute to the end. Type a value in the text input box in the form, then click Submit. Now the debugger stops at the first line of the results.php file. Execute to the breakpoint you set at line 14 of the script, and you will see that the $gm variable is populated with a value and that the $_POST array has the values from the previous page. Figure 19. Variables in results.php

From line 14, you can execute to the end or you can click Step Into in the Debug

Page 29 of 35

view to step into the getFormalGreeting() function on the GreetMaster2000 class.
Section 7. Troubleshooting
This section provides processes and techniques for troubleshooting the debuggers and associated files.
Finding the correct php.ini file
When configuring PHP to use the debugger extensions either XDebug or the Zend Debugger it's important to make sure that you're editing the correct php.ini file and that you have the correct zend_extension variable for the debugger. To find the full path of the php.ini file your installation of PHP uses, use the phpinfo() function in a simple script placed in a Web directory. Listing 10. Simple phpinfo.php script
<?php phpinfo(); ?>
Alternatively, type the command php -i | grep "Loaded Conf" and you'll get a result like Loaded Configuration File => /usr/local/php5/lib/php.ini.
Use the correct zend_extension directive
Now that you're sure which php.ini file you need to edit, it's important to get the correct zend_extension directive to use for your installation. Use the phpinfo() or php -i method again to find two values: Thread Safety and Debug Build. Table 1 can help you determine which one to use. A common mistake is using zend_extension when you need to use zend_exention_ts, and it's a difficult mistake to catch (at first). Table 1. Choosing the correct configuration key
Key name zend_extension zend_extension_ts Thread safety Off On Debug Off Off
Debugging PHP using Eclipse and PDT Page 30 of 35
zend_extension_debug zend_extension_debug_ts

Off On

The debugger doesn't stop
If the debugger doesn't stop at all, most likely one of three issues is occurring: The first is that you don't have the extension module set up correctly (see "Use the correct zend_extension directive" for the likely cause). If you've verified that the extension is set up correctly, you may not have PDT set up to use the debugger you have installed. If you've selected the Zend Debugger as the debugger for your PHP executable, but have XDebug set up in your php.ini file, you'll get some very unexpected behavior. Or it could be a firewall issue. Make sure you have the ports configured in your PHP Debugger preferences your firewall allows (if you have a firewall installed and running).
Determining your extension directory location
To install your XDebug or Zend Debugger extension binary in the same place as all your other extensions, use phpinfo() or php -i to find out where you directory is. See Listing 11 for an example from the php -i command. Listing 11. Finding the extension directory

Debugging PHP using Eclipse and PDT Page 34 of 35
resources. Get products and technologies Download the Eclipse IDE and install it from the official site. Download XDebug and learn more about it from the official site. Download the PDT bundled with the Zend Debugger from Zend's site. Innovate your next open source development project with IBM trial software, available for download or on DVD. Download IBM product evaluation versions, and get your hands on application development tools and middleware products from DB2, Lotus, Rational, Tivoli, and WebSphere. Check out the latest Eclipse technology downloads at IBM alphaWorks. Download Eclipse Platform and other projects from the Eclipse Foundation. Discuss Participate in developerWorks blogs and get involved in the developerWorks community. Participate in the developerWorks PHP Forum: Developing PHP applications with IBM Information Management products (DB2, IDS).

About the author

Nathan A. Good Nathan Good lives in the Twin Cities area of Minnesota. When he isn't writing software, he enjoys building PCs and servers, reading about and working with new technologies, and trying to get all his friends to make the move to open source software. When he's not at a computer (which he admits isn't often), he spends time with his family, at his church, and at the movies. Visit his Web site.

Page 35 of 35

 

Tags

17LS5R 3 RS KX-TG7220G EP-7E GNC 420 Portege 3110 SGH-C160 LCD51VM Syncmaster 913B Majesty250-2000 Elna 5200 MH6387TFL Vapomaster 2 Vaci-5300plus SLV-E730B Multifunzionale 2 0 RSH1nhmh SE 330 YDP-140 Suunto T4D Astrale Fender 2224 DEH-2900MPB MDT402S LP150CED HQ7815 Krups 962 2101 DVD Acernote 370P KX-TGA560M ACS 100 RMD169 TL522C 26PFL5322 Server XE3-GC Pressure Travelmate 3280 Scooba 5900 VP-D101 II S VGN-CS11s W PW50-2006 DCS601C51 Valve Type 2 S I U-smart 2 DLP D45S 3600N Lexmark Z735 Builder 1-0-0 SX-303RDS Fr Sandiego Fo-p610 AG-DVX100A RP605Z Fossil FS00 CD1401B 57 81834 I8000H Laserline 291 HTS335W-12 RXV 550 IC-E7 FX-9750G 41819 30 DA DH504ELY7 WD620 Chapters TM-D1000 Princess MDX-C6500RX PCG-GRX516SP I845D Jimmy 1997 UC200 HH-12 RHT600R 315-277140 9902S Edition DX-C370 NN-GD377 RSA1dtwp1 Starlette 18 LC37A1E TM-D710E PRG-50 DV-585K-S Elite Cry 2 1 0 GR-P207dxza SU-V5 KX-TES824

 

manuel d'instructions, Guide de l'utilisateur | Manual de instrucciones, Instrucciones de uso | Bedienungsanleitung, Bedienungsanleitung | Manual de Instruções, guia do usuário | инструкция | návod na použitie, Užívateľská príručka, návod k použití | bruksanvisningen | instrukcja, podręcznik użytkownika | kullanım kılavuzu, Kullanım | kézikönyv, használati útmutató | manuale di istruzioni, istruzioni d'uso | handleiding, gebruikershandleiding

 

Sitemap

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101