Introduction to PHP

2,027 views
1,921 views

Published on

Prepared by Amit Seal Ami, BIT0122, IIT
Institute of Information Technology,
University of Dhaka

For the use of students of Institute of Information Technology, University of Dhaka

Published in: Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
2,027
On SlideShare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
21
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Introduction to PHP

  1. 1. Introduction to PHP & Debugging (Just a bit)
  2. 2. Presented by Amit Seal Ami BIT0122
  3. 3. <ul><li>PHP = PHP: Hyper-Text Preprocessor for.. PHP Hypertext preprocessor? </li></ul><ul><li>PHP is an HTML-embedded scripting language. </li></ul><ul><li>Borrowed from C, Java and Perl </li></ul><ul><li>The goal of the language is to allow web developers to write dynamically generated pages quickly. </li></ul>27/4/2011 PHP-Introduction and Debugging
  4. 4. How PHP Works 27/4/2011 PHP-Introduction and Debugging
  5. 5. Xampp <ul><li>Apache </li></ul><ul><li>MySQL </li></ul><ul><li>PHP </li></ul><ul><li>Perl/Python </li></ul>27/4/2011 PHP-Introduction and Debugging
  6. 6. Why not XAMPP <ul><li>Default security = null </li></ul><ul><li>Not exactly standard </li></ul><ul><li>Gives everything in a package </li></ul><ul><li>“ The default configuration is not good from a securtiy point of view and it's not secure enough for a production environment – please don't use XAMPP in such environment.”-Xampp </li></ul>27/4/2011 PHP-Introduction and Debugging
  7. 7. Installing PHP <ul><li>sudo apt-get install </li></ul><ul><li>apache2 </li></ul><ul><li>php5 </li></ul><ul><li>mysql-server </li></ul><ul><li>php5-mysql </li></ul><ul><li>apache2-dev </li></ul><ul><li>php5-dev </li></ul><ul><li>php5-xdebug </li></ul>27/4/2011 PHP-Introduction and Debugging
  8. 8. Controlling Apache <ul><li>sudo /etc/init.d/apache2 [start]|[stop]|[restart] </li></ul>27/4/2011 PHP-Introduction and Debugging
  9. 9. Server Path and Local Path <ul><li>file:///var/www/helloWorld.php </li></ul><ul><li>http://localhost/helloWorld.php </li></ul>27/4/2011 PHP-Introduction and Debugging
  10. 10. PHP.ini <ul><li>PHP reads this file for settings. </li></ul><ul><li>It is a text file which can be edited using any text editor. </li></ul>27/4/2011 PHP-Introduction and Debugging
  11. 11. PHP.ini types <ul><li>Production </li></ul><ul><li>Standards </li></ul><ul><li>Not Compatible </li></ul><ul><li>Security </li></ul><ul><li>Best performance </li></ul><ul><li>Best practise </li></ul><ul><li>Development </li></ul><ul><li>Testing </li></ul><ul><li>Debugging </li></ul><ul><li>Error Handling </li></ul>27/4/2011 PHP-Introduction and Debugging
  12. 12. Modifying PHP.ini <ul><li>display_errors = On </li></ul><ul><li>error_reporting = E_ALL & ~E_DEPRECATED </li></ul><ul><li>log_errors = On </li></ul>27/4/2011 PHP-Introduction and Debugging
  13. 13. <ul><li>“ Xdebug is a PHP extension which provides debugging and profiling capabilities.” </li></ul>27/4/2011 PHP-Introduction and Debugging
  14. 14. Why XDebug <ul><li>Profiling </li></ul><ul><li>Stack trace </li></ul><ul><li>Memory Usage </li></ul><ul><li>Time Index </li></ul>27/4/2011 PHP-Introduction and Debugging
  15. 15. Xdebug Configuration 27/4/2011 PHP-Introduction and Debugging
  16. 16. References <ul><li>http://www.xdebug.org/docs/all_settings </li></ul><ul><li>http://lordamit.blogspot.com/2010/11/lamp-xdebug.html </li></ul>27/4/2011 PHP-Introduction and Debugging

×