PHP Parse error Fatal error Warning Notice Updated : August 23,2012

Slides:



Advertisements
Similar presentations
Error HandlingPHPMay-2007 : [#] PHP Error Handling.
Advertisements

CSCI 215 Web Programming II Debugging & Error Handling.
 2000 Deitel & Associates, Inc. All rights reserved. Chapter 17 - The Preprocessor Outline 17.1Introduction 17.2The #include Preprocessor Directive 17.3The.
Intermediate PHP & MySQL
ITM 352 © Port,KazmanDebugging - 1 ITM 352 Debugging.
PHP Tutorials 02 Olarik Surinta Management Information System Faculty of Informatics.
Introduction to PHP and Server Side Technology. Slide 2 PHP History Created in 1995 PHP 5.0 is the current version It’s been around since 2004.
Open Source Server Side Scripting ECA 236 Open Source Server Side Scripting PHP Form Handling.
IST Database and the Web IST 210. Dynamic Web Applications Static Web application Request with a URL (e.g., Which contains three.
Lecture Note 3: ASP Syntax.  ASP Syntax  ASP Syntax ASP Code is Browser-Independent. You cannot view the ASP source code by selecting "View source"
Writing Web Pages By Shyam Gurram. Agenda Writing Web Pages Delimiting PHP Program Units. Displaying Output to Web Pages Putting Comments in PHP Programs.
PHP Workshop ‹#› PHP Error Handling. PHP Workshop ‹#› Types There are 12 unique error types, which can be grouped into 3 main categories: Informational.
November 2003Bent Thomsen - FIT 6-11 IT – som værktøj Bent Thomsen Institut for Datalogi Aalborg Universitet.
PHP - Basic Language Constructs CSCI 297 Scripting Languages - Day Two.
PHP2. PHP Form Handling The PHP $_GET and $_POST variables are used to retrieve information from forms, like user input. Name: Age:
Interpretation Environments and Evaluation. CS 354 Spring Translation Stages Lexical analysis (scanning) Parsing –Recognizing –Building parse tree.
13/2/12 Lecture 6. Functions 2 types: – Built in functions – Custom defined functions Functions minimize the amount of repetition of code. function consists.
_______________________________________________________________________________________________________________ PHP Bible, 2 nd Edition1  Wiley and the.
Introduction.  The scripting language most often used for client-side web development.  Influenced by many programming languages, easier for nonprogrammers.
PHP Update : August 23,2012.
Week 4 PHP H ypertext P reprocessor Reference : Official Site :
Server-Side Scripting with PHP ISYS 475. PHP Manual Website
8 th Semester, Batch 2008 Department Of Computer Science SSUET.
Lecture 2 Conditional Statement. chcslonline.org Conditional Statements in PHP Conditional Statements are used for decision making. Different actions.
Hints on debugging
Just a Little PHP Programming PHP on the Server. Common Programming Language Features Comments Data Types Variable Declarations Expressions Flow of Control.
Fall 2004CSI University of Ottawa Introduction to PHP Basic principles and syntax.
Open Source Server Side Scripting ECA 236 Open Source Server Side Scripting PHP Basics.
Chapter 8 Error Handling and Debugging. Debugging “When you get frustrated, step away from the computer!”
8 th Semester, Batch 2008 Department Of Computer Science SSUET.
PHP Syntax You cannot view the PHP source code by selecting "View source" in the browser - you will only see the output from the PHP file, which is plain.
1 PHP Intro PHP Introduction After this lecture, you should be able to: Know the fundamental concepts of Web Scripting Languages in general, PHP in particular.
Creating FunctionstMyn1 Creating Functions Function can be divided into two groups: –Internal (built in) functions –User-defined functions.
PHP-Basic By- Tanvi Raval. Pre-requisites Before you continue you should have a basic understanding of the following: 1. HTML 2. JavaScript.
Unit – 3 Control structures. Condition Statements 1.If.…..else :- Has someone ever told you, "if you work hard, then you will succeed"? And what happens.
IST 210: PHP Basics IST 210: Organization of Data IST2101.
PHP. What is PHP? PHP Hypertext Processor – Dynamic web development – Scripting language – Can be procedural or OOP(preferred) – PHP code can be embedded.
1 ENERGY 211 / CME 211 Lecture 3 September 26, 2008.
1 PHP and MySQL Web Development When you install PHP, you can select from a number of extensions. The MySQL support in PHP consists of a number of functions.
Click to edit Master subtitle style 03/02/11 Web And Coding Club IIT Bombay PHP (pre hypertext processor) By: Saurabh Goyal Apekshit Sharma.
PHP using MySQL Database for Web Development (part II)
C Formatted Input/Output
ITM 352 Debugging.
CHAPTER 5 SERVER SIDE SCRIPTING
Homework 4.
PHP Functions Besides the built-in PHP functions, we can create our own functions. A function is a block of statements that can be used repeatedly in.
PHP Hypertext Preprocessor
Algorithms Problem: Write pseudocode for a program that keeps asking the user to input integers until the user enters zero, and then determines and outputs.
Loop Structures.
PHP (PHP: Hypertext Preprocessor)
Class07 PHP: loops and includes
Exploring JavaScript Ch 14
Introduction to C Topics Compilation Using the gcc Compiler
Intro to PHP & Variables
For & do/while Loops.
WEB PROGRAMMING JavaScript.
A290 TOOLS IN COMPUTING: PHP
תיכון אהל שם, רמת גן קורס PHP – הרצאת העשרה
PHP.
Spot the bug!.
Friends, Overloaded Operators, and Arrays in Classes
Basics (Cont...).
Lecture 5: Functions and Parameters
Intro to PHP.
Server Side Programming Overview And file system basics
ITM 352 Debugging.
Error Handling and Debugging
Building Java Programs
SEEM 4540 Tutorial 4 Basic PHP based on w3Schools
The Web Wizard’s Guide to PHP by David A. Lash
Presentation transcript:

PHP Parse error Fatal error Warning Notice Updated : August 23,2012 Reference : http://www.thaiall.com/php/training49.htm

PHP Config C:\thaiabc\php\php.ini error_reporting = E_ALL phpinfo(); <? // ini_set('display_errors', '0'); // or // ini_set('error_reporting', E_ALL); // error_reporting(0); ?> HTTP 500 Internal Server Error The Website cannot display the page Reference : http://www.thaiall.com/php/training49.htm

ERROR TYPE Parse error: A problem with the syntax of your program, such as leaving a semicolon off of the end of a statement. The interpreter stops running your program when it encounters a parse error. Fatal error: A severe problem with the content of your program, such as calling a function that hasn't been defined. The interpreter stops running your program when it encounters a fatal error. Warning: An advisory from the interpreter that something is fishy (เหม็นคาว) in your program, but the interpreter can keep going. Using the wrong number of arguments when you call a function causes a warning. Notice: A tip from the PHP interpreter, playing the role of Miss Manners. For example, printing a variable without first initializing it to some value generates a notice. Reference : http://onlamp.com/pub/a/php/2004/08/12/DebuggingPHP.html

Fatal error <? echo a(); ?> Fatal error: Call to undefined function a() in C:\thaiabc\apache2\htdocs\x.php on line 2

Notice โปรแกรมทำงานต่อไป หากพบ Notice จะไม่หยุดการทำงาน <? echo $a; ?> Notice: Undefined variable: a in C:\thaiabc\apache2\htdocs\x.php on line 2

Parse error <? $a = 1; if ($a > 1) { echo "ok"; ?> Parse error: syntax error, unexpected $end in C:\thaiabc\apache2\htdocs\x.php on line 6

Parse error <? $a = 1; if ($a > 1 { echo "ok"; } ?> Parse error: syntax error, unexpected '{' in C:\thaiabc\apache2\htdocs\x.php on line 3

Notice <? $a = "true"; if ($b) { echo "ok"; } ?> Notice: Undefined variable: b in C:\thaiabc\apache2\htdocs\x.php on line 3

Parse error <? <body> echo "hello"; ?> Parse error: syntax error, unexpected '<' in C:\thaiabc\apache2\htdocs\x.php on line 2

Parse error <? $a = "hello'; if ($b) echo "c"; ?> Parse error: syntax error, unexpected T_STRING in C:\thaiabc\apache2\htdocs\x.php on line 3

Notice <? $a = array(5,6,7); echo $a[0]; echo $a[$a[0]]; ?> 5 Notice: Undefined offset: 5 in C:\thaiabc\apache2\htdocs\x.php on line 4

Notice <? $a = array(5,6,7); foreach($a as $b) { $c += $b; } echo $c; ?> Notice: Undefined variable: c in C:\thaiabc\apache2\htdocs\x.php on line 3 18

Warning <? a(5); function a($b,$c){ echo $b; } ?> Warning: Missing argument 2 for a(), called in C:\thaiabc\apache2\htdocs\x.php on line 2 and defined in C:\thaiabc\apache2\htdocs\x.php on line 3 5

Parse error <? $a ="1" $a = 1234; // decimal number $a = -123; // a negative number $a = 0123; // octal number (equivalent to 83 decimal) $a = 0x1A; // hexadecimal number (equivalent to 26 decimal) ?> Parse error: syntax error, unexpected T_VARIABLE in C:\thaiabc\apache2\htdocs\x.php on line 3 T_VARIABLE is a token in the interpreter's list.

Warning & Fatal error <? include(""); require(""); ?> Warning: include() [function.include]: Failed opening '' for inclusion (include_path='.;C:\php5\pear') in C:\thaiabc\apache2\htdocs\x.php on line 2 Fatal error: require() [function.require]: Failed opening required '' (include_path='.;C:\php5\pear') in C:\thaiabc\apache2\htdocs\x.php on line 3