Installing PHP 5 on IIS in 5 simple steps

Categories:

Restart and verify

Almost done now. Restart your server so that all the changes we have made are made effective in one swoop. Once your server has restarted create a file called phpinfo.php and place it in one of your websites that you can get access to. Open the file and enter this code;

<?php

phpinfo();

?>

Save the file and then open your web browser and access you phpinfo.php file and you should be presented with a screen detailing your PHP configuration. If this is what happens then you are up and running, if not then something has gone amiss. Feel free to ask me for help in the forums though.

As already stated if you require PHP 4 (for legacy code, etc) then your job is much easier. Just Download the IIS Aid PHP Installer and run through the GUI based installation wizard and everything is setup for you. With PHP now enabled you are on your way to being able to utilize one of the most popular web scripting languages in the world, which is used by thousands of free, and commercial web applications. Be sure to check back on this site in future for some PHP tuning tips and performance comparisons to make sure you are getting the most out of your PHP environment.

Comments

Anonymous's picture

failed to open stream: No such file or directory in

Hi, i followed your guide and I installed fine (good guide), I can see the phpinfo.
but when i run my proyect i recieved

Warning: include(ayto_gestion/SqlFun.php) [function.include]: failed to open stream: No such file or directory in C:\Archivos de programa\PHP Designer 2005\webs\ayto_gestion\login.php on line 36

Warning: include() [function.include]: Failed opening 'ayto_gestion/SqlFun.php' for inclusion (include_path='.;C:\php5\pear:/docroot') in C:\Archivos de programa\PHP Designer 2005\webs\ayto_gestion\login.php on line 36

Fatal error: Class 'SqlFun' not found in C:\Archivos de programa\PHP Designer 2005\webs\ayto_gestion\login.php on line 37

Obviously i put these files in this direction, but i suppose i have to change anything in the php.ini could you help me?

Brashquido's picture

Glad the guide helped! First

Glad the guide helped! First thing to check will be your NTFS permissions. Ensure you IUSR account has read permissions to all your application directories and files. Using the incude() function will also mean you will need to add the directories which contain the files referenced by your include statement to the "include_path" directive in php.ini.
----------------
Dominic Ryan
3 x Microsoft IIS MVP, MCSE, MCSA
IIS Aid owner/webmaster

Anonymous's picture

Hi again;

I set my route in include_pat (C:\Archivos de programa\PHP Designer 2005\webs), and I'm sure that i have permission because i use administrator, but i recieve the same.
I have read that i have to change doc_root and set the path, but it doesn´t work. You can see that it is a page for login, and after this I try to connect to mysql, could it be a problem?
sorry I'm very lost with it.

thank a lot.

Brashquido's picture

You have spaces in your

You have spaces in your path. Did you ensure you enclosed the path with ""? Sp the include_path would look something like;

include_path = "C:\Archivos de programa\PHP Designer 2005\webs"

----------------
Dominic Ryan
3 x Microsoft IIS MVP, MCSE, MCSA
IIS Aid owner/webmaster

Anonymous's picture

thanks

thanks for your help...
It was bizarre, because I was using php 4, and when i upgrade to 5, the path sttoped working, so i added a "/", it started working again.
bye and good work

Anonymous's picture

First ,thanks for your tutorial,but for connecting to mysql ?

Hi,
Thanks for your help.
I used your guides and i can see information of phpinfo() function in my browser ,but when i want connect to mysql i receive this error :
Fatal error: Call to undefined function mysql_connect()
is there any help?
Thanks
Jamshid

Brashquido's picture

Is the MySQL extension loaded?

When using the phpinfo() function is the MySQL extension loaded?
----------------
Dominic Ryan
3 x Microsoft IIS MVP, MCSE, MCSA
IIS Aid owner/webmaster

Anonymous's picture

PHP IIS W2003 HTTP 500 Internal Server Error on subdirectories

I am getting the
HTTP 500 Internal Server Error
on tested working php scripts
in sub directories only !

They work fine in the root of the website.

PHP Version 5.2.5
Windows 2003 server
IIS

Permissions are the same in the sub directories.

Any ideas?

Cheers
Alex

Anonymous's picture

the page cannot be displayed

Hi,
After I carefully follow your instructions, still the page cannot be displayed. Im running at win xp, iis 5.1 with asp.net 2.0 installed. I try to install PHP 5.2.5

HTTP 403.1 Forbidden: Execute Access Forbidden
Internet Information Services

--------------------------------------------------------------------------------

You have attempted to execute a CGI, ISAPI, or other executable program from a directory that does not allow programs to be executed.

Need your help. Thanks!

Mark

Brashquido's picture

PHP HTTP 500 error

Hi Alex,

Have you had a look through the article I wrote on troubleshooting the PHP HTTP 500 error?

Mark,

Can you look at the "home directory" tab in your IIS admin manager and let me know what your execute permission is set to?
----------------
Dominic Ryan
3 x Microsoft IIS MVP, MCSE, MCSA
IIS Aid owner/webmaster