PHP Installation Tutorial 2 - Configuring WAMP - Page 3 of 3
PHP Configuration
Now we are going to edit PHPs config file, php.ini. php.ini should be in the Apache folder (C:\Program Files\Apache Group\Apache2\php.ini).
Note in php.ini comments are show with the semi-colon character (;) not the hash sign. Anything following the semi-colon character (;) is commented out, to uncomment it, delete the semi-colon.
Line: short_open_tag = On
Its really up to you how this is set, If you set it to off then scripts will not be allowed to use short open tags (<? ... ?>) if it is set on, scripts can use them. For more portable code it is 'best' to code using full tags (<?php ... ?>) not short ones, however quite a few freely available scripts will use short tags and so these would have to be edited. I have this set on so other peoples scripts will (hopefully) work without editing, but I remember to code my scripts using full tags.
Line: asp_tags = Off
Who wants to use asp style <% %> tags (apart from asp developers)? Nasty(!)
Line: highlight.string = #DD0000
Line: highlight.comment = #FF9900
Line: highlight.keyword = #007700
Line: highlight.bg = #FFFFFF
Line: highlight.default = #0000BB
Line: highlight.html = #000000
Simply uncomment these lines (remove the semi colon ; before it). This will allow script highlighting for .phps files.
Line: error_reporting = E_ALL
For a development server this sets PHP to tell us about all errors. For a production server this should be E_NONE.
Line: display_errors = On
PHP tells us about errors rather that just sit there with a blank screen if something goes wrong!
Line: register_globals = Off
Stops many possible security issues
Line: doc_root = C:\Program Files\Apache Group\Apache2\htdocs
This path should be the same as the document root you set in apaches httpd.conf
Line: ;extension= ...
This allows you to include various PHP extensions, a bit like modules in apache, only turn then on when you need them.
Line: session.save_handler = files
Make sure this line is the same.
Line: session.save_path = c:/temp
Change the directory to a temp dir on your pc, for sessions to save data to. Make sure this directory exists!
That's about it for PHP configuration. Save the file and restart Apache, view the test.php file you wrote in Installing WAMP to check that everything is still working ok.
Download
Download here
Includes source files for PHP scripts discussed above, and a phptutorials recommended php.ini file.
Copyright
Copyright 2003 Matthew Phillips. Permission is granted to copy, distribute and/or modify this document as long as this notice is included. The original version can be found at http://www.phptutorials.cjb.net/ If you make this text available on your website please notify the author, For details of how to notify the author please go to the aforementioned web site and click on the 'Webmasters' link.
