Friday, January 28, 2011

Install Php on Windows


Steps:
1.  http://www.php.net/downloads.php download the zip file unzip at C:/php
Download and install apache2 http://httpd.apache.org/download.cgi
httpd-2.2.17-win32-x86-no_ssl.msi

2 Go C:/Program Files/Apache2. In httpd.conf of Apache Software Foundation/conf add the following code


LoadModule php5_module "c:/php/php5apache2_2.dll"
AddHandler application/x-httpd-php .php
3.
# configure the path to php.ini which is present at location C:/php find
PHPIniDir "C:/php"
4. In C:\Apache Software Foundation\Apache2.2\htdocs place the file
test.php

echo "Hello World";
?>
Now start apache2 by clicking on exe in bin folder.

If you want to change the path to other than htdocs go to sites-enabled folder 000-default  in C:/Program File/Apache2....
and change the DocumentRoot to folder you want.

5. http://localhost:8080/test.php should generate the hello world.
Reference

Install Mysql http://harshal-techapps.blogspot.com/2011/01/steps-to-install-mysql-on-windows.html
To configure with Mysql

1. Uncomment the line extension=php_mysql.dll in php.ini which is present in C:/php
2. Set this path extension_dir = "C:\php\ext" in php.ini
3. To change the upload file location
;upload_tmp_dir =
4. Uncomment session.save_path = "C:\WINDOWS\temp"
5. Copy the php.ini to C:\Windows
6.Next we must add the PHP directory to the Windows PATH. To do this, click: Start > My Computer > Properties > Advanced > Environment Variables. Under the second list (System Variables), there will be a variable called "Path". Select it and click "Edit". Add ";C:\php" to the very end of the string and click "OK".
7. In mysql follow the steps below:
use test;
create table name ()
select * from name;
8. Place the attached file at location : C:\Apache Software Foundation\Apache2.2\htdocs
9. Restart the computer and all the servers.
11. Should display
ID: 1
Name: John
Hello
Links for linux

No comments:

Post a Comment