Let's begin!
First download and install the following packages in the this way:
1. Apache Win32 Binary http://httpd.apache.org/download.cgi
2. PHP installer http://www.php.net/downloads.php
3. mysql community server http://dev.mysql.com/downloads/mysql/5.0.html
(optionally: mysql php_mysqli.dll driver from http://dev.mysql.com/downloads/connector/php-mysqlnd/)
APACHE
Check up: After the initial installation in a browser window address bar window type: http://localhost
If working properly the Apache server will show you this message: It works!
PHP
1. Open the file httpd.conf found in directory: C:\Program files\Apache Software Foundation\Apache2.2\conf\ and add after the last LoadModule section:
LoadModule php5_module "C:\Program Files\PHP\php5apache2_2.dll" where php4apache2_2.dll is the file telling Apache to load dynamically the PHP language.
Note: if your file has different name please use it!
2. Find the AddType line and add the following under:
AddType application/x-httpd-php .php
This tell the webserver to associate all .php files to the interpreter. Otherwise when you run a .php file in your browser you'll see i as normal text file followed by the usual Save as dialogue.
Check: Create a new file named index.php and type in the following: <? phpinfo(); ?> . Place it in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs. Open the browser again and load the index.php file. If it loads up properly then your Php is being installed correctly!
MYSQL
1. Rename the file php-dist.ini to php.ini and copy it from directory it's installation directory i.e. Program files\PHP in c:\windows. Then copy the files php_mysql.dll and libmysql.dll in directory c:\windows\system32.
2. Open c:\windows\php.ini and add after the section Dynamic extensions the following 2:
extension=libmysql.dll
extension=php_mysql.dll
Check: If everything is ready create index.php file having content <? phpinfo(); ?> in: C:\Program Files\Apache Software Foundation\Apache2.2\htdocs
Point your browser to: http://localhost and you'll have to see in the information the Mysql section.
When having problems:
If Apache fails to run open Start->Run->eventvwr.msc and check under the Application tab the type of error coming from Apache Service. Most common error is:
Only one usage of each socket address (protocol/network address/port) is normally permitted. : make_sock: could not bind to address 0.0.0.0:80
Solution: open httpd.conf and change the listening port used by Apache to 3128 for example.
Other often harder to see error is being produced when you use the short <? when typing your code - this is forbidden in some of php versions. If you want to use this functionality then change the option:
short_open_tag = On
in php.ini
Cheers, and if you have any questions just ask! by Nevyan Neykov
hey you explained it step by step and i did install in the same way.. now it works..!thank you
ReplyDelete