PHP Learning Environment
Learning PHP, we need to prepare for a possible support PHP runtime environment:
- PHP compiler: support the core PHP runs
- Apache Web server: to provide Web services, and supports PHP parsing
- MySQL Database: MySQL database operations for learning PHP
- Operating System: The default for personal PC, install Windows 2000 and above systems
- Editing Tools: EditPlus or IDE tools such as Zend Studio or Eclipse, etc.
- Browser: IE6 or later, Firefox latest version
- File storage location: E: html
Note: The file storage location is not certain, as long as your Apache Web server can be resolved to the line, in this setting is to be with XHTML + CSS tutorial consistent.
PHP official Download: http://www.php.net/downloads.php
Download PHP Compiler download from the above address win32 compression package (currently Universal version 5.2.x), such as: php-5.2.13-Win32.zip, and extract it to a local hard disk, such as E: php5.
In E: php5 within files and directories as follows:
- dev folder
- ext folder
- extras folder
- PEAR folder
- Some dll files, such as aspell-15.dll etc.
- Some exe executable programs such as php.exe etc.
- Type some text files such as php.ini-dist, etc.
After extracting the correct confirm the above, in accordance with the following steps:
1, first of all within the dll file php5 (including dll file ext folder) is copied to the system32 folder of Windows, such as C: WINDOWSsystem32. This step is to allow the system to get PHP running windows dll file, its significance with the specified system environment variables, but for simplicity, and the dll files are copied directly to the windows system directory.
Second, the “php.ini-dist” was renamed “php.ini”. php.ini PHP configuration information is recorded file. Open php.ini with an editor, the configuration inside the following format:
; Extension = php_bz2.dll
Preceded by “;” indicates that the configuration is invalid, so we want to front configuration items we need the “;” sign removed:
extension = php_curl.dll extension = php_gd2.dll extension = php_mysql.dll extension = php_pdo.dll extension = php_pdo_mysql.dll extension = php_pdo_sqlite.dll
Like let PHP extension = php_gd2.dll expressed open support for the GD2 image library. Above these are more common configuration, most hosts are also supported.
Third, set the Extended Support directory
If you follow the above settings, the system still does not support expansion modules such as the prompt does not support mysql, etc., you can manually set the extension directory in the php.ini file:
extension_dir = "E: / php / ext"
Time Zone Settings
PHP from 5.1 introduces the concept of time zone is set, it will affect the time formatting and other functions, to confirm the time setting section php.ini file area as follows:
[Date] ; Defines the default timezone used by the date functions date.timezone = PRC
After setting, save, copy php.ini file to the Windows system folder as: under WINDOWS: C.