•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 429,968 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,662 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 1572 | Replies: 0
![]() |
Introduction and Installation of PHP
Intro
This tutorial describes:
PHP stands for PHP: Hypertext Preprocessor, a recursive acronym. It is mainly a Web server side scripting language. But it can also be used for other purposes.
PHP was originally created by Rasmus Lerdorf in 1995 as a simple Web page generation tool named as PHP/FI (Personal Home Page/Forms Interpreter). Today it becomes the number one of server side scripting languages. Here is a comparison of number of matches on Google for key words: "PHP script", "Perl script", and "ASP script":
Downloading PHP 5.0.4 for Windows
1. Go to http://www.php.net, and download PHP 5.0.4 binary for Windows. You will get a file called php-5.0.4-Win32.zip of 7488 KB.
2. Unzip php-5.0.4-Win32.zip to \php directory.
3. Open a command window, and try the following commands:
Cool, both Command Line Interface (CLI) and Common Gateway Interface (CGI) are working!
My First PHP Script - Hello.php
Use any text editor, and enter the first PHP script, Hello.php:
Let's run it PHP CLI first:
Now run it PHP CGI:
As expected, PHP CGI did generate the HTTP response header for me.
Installing PHP with IIS as CGI
1. Add \php to the PATH environment variable. I assume you know how to do this.
2. Set up PHP configuration file. First rename \php\php.ini-recommended to \php\php.ini. Then edit \php\php.ini to set the following values:
3. Create a new environment variable PHPRC with \php. This is needed to access php.ini.
4. Now we need to change IIS configuration to run PHP scripts as CGI scripts. Run Control Panel, Internet Information Service, Default Web Site, and Properties. On the Directory tab, first set Execute Permissions to "Scripts only". Then click Configuration to add a new Application Mapping with Executable=\php\php-cgi.exe, Extension=.php, and Script engine checked.
5. Stop and start Default Web Site.
6. Copy Hello.php to \inetpub\wwwroot.
7. Run Internet Explorer (IE) with http://localhost/Hello.php. You should see:
Congratulation, you have installed PHP with IIS as CGI correctly!
Conclusion
Installation PHP on Windows IIS as CGI seems to be simple.
Of course, you can also install PHP with IIS as a server module, using php5isapi.dll.
For additional installation instructions, please read \php\install.txt.
Intro
This tutorial describes:
What Is PHP?
What is PHP.
Download PHP binary version for Windows.
Writing the first PHP script.
Installing PHP on IIS as CGI.
PHP stands for PHP: Hypertext Preprocessor, a recursive acronym. It is mainly a Web server side scripting language. But it can also be used for other purposes.
PHP was originally created by Rasmus Lerdorf in 1995 as a simple Web page generation tool named as PHP/FI (Personal Home Page/Forms Interpreter). Today it becomes the number one of server side scripting languages. Here is a comparison of number of matches on Google for key words: "PHP script", "Perl script", and "ASP script":
Key words Number of matches PHP script 13,600,000 Perl script 11,900,000 ASP script 8,650,000
Downloading PHP 5.0.4 for Windows
1. Go to http://www.php.net, and download PHP 5.0.4 binary for Windows. You will get a file called php-5.0.4-Win32.zip of 7488 KB.
2. Unzip php-5.0.4-Win32.zip to \php directory.
3. Open a command window, and try the following commands:
>\php\php -v PHP 5.0.4 (cli) (built: Mar 31 2005 02:45:48) Copyright (c) 1997-2004 The PHP Group Zend Engine v2.0.4-dev, Copyright (c) 1998-2004 Zend Technologies >\php\php-cgi -v PHP 5.0.4 (cgi-fcgi) (built: Mar 31 2005 02:45:43) Copyright (c) 1997-2004 The PHP Group Zend Engine v2.0.4-dev, Copyright (c) 1998-2004 Zend Technologies
Cool, both Command Line Interface (CLI) and Common Gateway Interface (CGI) are working!
My First PHP Script - Hello.php
Use any text editor, and enter the first PHP script, Hello.php:
Hello <?php echo "world!"; ?>
Let's run it PHP CLI first:
>\php\php Hello.php Hello world!
Now run it PHP CGI:
>\php\php-cgi Hello.php Content-type: text/html X-Powered-By: PHP/5.0.4 Hello world!
As expected, PHP CGI did generate the HTTP response header for me.
Installing PHP with IIS as CGI
1. Add \php to the PATH environment variable. I assume you know how to do this.
2. Set up PHP configuration file. First rename \php\php.ini-recommended to \php\php.ini. Then edit \php\php.ini to set the following values:
cgi.force_redirect = 0 doc_root = "c:\inetpub\wwwroot" cgi.redirect_status_env = ENV_VAR_NAME
3. Create a new environment variable PHPRC with \php. This is needed to access php.ini.
4. Now we need to change IIS configuration to run PHP scripts as CGI scripts. Run Control Panel, Internet Information Service, Default Web Site, and Properties. On the Directory tab, first set Execute Permissions to "Scripts only". Then click Configuration to add a new Application Mapping with Executable=\php\php-cgi.exe, Extension=.php, and Script engine checked.
5. Stop and start Default Web Site.
6. Copy Hello.php to \inetpub\wwwroot.
7. Run Internet Explorer (IE) with http://localhost/Hello.php. You should see:
Hello world!
Congratulation, you have installed PHP with IIS as CGI correctly!
Conclusion
Installation PHP on Windows IIS as CGI seems to be simple.
Of course, you can also install PHP with IIS as a server module, using php5isapi.dll.
For additional installation instructions, please read \php\install.txt.
Last edited by happygeek : Oct 28th, 2006 at 10:13 am. Reason: Formatting
![]() |
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
apple browser choose computer core crack dell development download drm explorer fedora france ie 7 install installation internet leopard license linux microsoft mobile network newbie news office open operating operating system os parliament phishing photo php security server software source surface computing system ubuntu unix upgrade vista volume web windows windows update windows vista xp
- Can't Configure Apache 2.2.4 for Php 5.2.3 on windows (Need Urgent Help) (PHP)
- like php but have windows xp home (PHP)
- OEM PC -Windows XP Home (oem) does not complete installation-set up loops (Troubleshooting Dead Machines)
- PHP 5 - Over before it began (PHP)
- What is the use of PHP (PHP)
- Jumping into Php (PHP)
- ICS not working after installation of SP1 with windows XP 2003 Server (Windows NT / 2000 / XP / 2003)
- Redirection to http://th.msie.cc/index.php?aid=20038 (Viruses, Spyware and other Nasties)
Other Threads in the PHP Forum
- Previous Thread: hit another brick wall, mysql :S
- Next Thread: howto: expire cookie at end of session?


Linear Mode