PHP and Apache installation
Posted 09 April 2006 - 11:18 PM
1) I am running XP (home edition), with no IIS. I installed Apache (httpd-2.0.55-win32-src), which run ok; I can view an htm file i.e [a href=\"http://localhost/hello.htm\" target=\"_blank\"]http://localhost/hello.htm[/a]. Thereafter I run php4.exe (php-4.4.2-Win32). When I tried .php file I receive error “Page cannot be found.” please let me why I can not run the file and how to correct it.
2) Is possible to run php on IIS, if yes, please let me know how.
Posted 10 April 2006 - 09:16 AM
In order to get your pages to work you will need to configure Apache so it uses PHP as Module which is easy to do.
You will need to find the Apache config file which is called httpd.conf. Open that file up for editing in Notepad or what ever editor you wish to use.
And scroll downwards until you come across the following:
#LoadModule ssl_module modules/mod_ssl.soYou will need to add the following line to after the line stated above:
LoadModule php4_module ""C:/php/php4apache2.dll"Now directly after that line add the following:
#PHPIniDir PHPIniDir "C:/php"
You're almost done. Now scroll down and find the following line:
DirectoryIndex index.html index.html.varNow add a space a after index.html.var and type index.php so the DirectoryIndex line should look like this:
DirectoryIndex index.html index.html.var index.php
Now scroll down a little further and find the following:
AddType application/x-gzip .gz .tgzNow add the following directly after it:
#PHP5 AddType application/x-httpd-php .php .phtml AddType application/x-httpd-phps .phps
You have now configured APache to use PHP as an Apache Module. Now save the httpd.conf file ie File -> Save or Ctrl+S for short.
After changing the httpd.conf file go to where you have installed PHP to, which I presume is C:\php, and go to a folder called sapi (C:\php\sapi) now move a file called php4apache2.dll to the root of the PHP folder (C:\php\). ANother step is to rename a fiole called php.ini-recommend to just php.ini (only if a file called php.ini is not there).
Once you have followed the steps above. You will need to restart Apache for the changes to take affect. To do so there should be an icon in the lower right hand corner of the screen in the taskbar with a small green triange inside a white circle pointing to the right and a purple feather pointing upwards to the left.
If you do click it and Select Apache 2 from the menu and then select Restart. Apache should restart and attempt to apply the changes made to the httpd.conf file. If apache doesn't come up with a warningthen you have successfully configured Apache and PHP to work together.
Now go to [a href=\"http://localhost/\" target=\"_blank\"]http://localhost/[/a] in web browser and find your .php file. Click it and the output of the file should be displayed in the browser window. If no .php files are listed in the directory index when you go to [a href=\"http://localhost/\" target=\"_blank\"]http://localhost/[/a] you will need to move your .php files to the folder where you store your files be seen by the webserver.
Hope that helps.
Posted 11 April 2006 - 12:28 PM
Here are the steps to follow when installing php on IIS / Windows
[a href=\"http://www.php.net/manual/en/install.windows.iis.php\" target=\"_blank\"]http://www.php.net/manual/en/install.windows.iis.php[/a]
Chris, Developer, Chrisranjana.com
Chennai, Tamil Nadu, India.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users