Install PHP on IIS in Windows 7
Steps for configuring PHP to work with IIS in Windows 7
Follow all the steps for installing PHP manually on your Windows 7 system, before you configure php to work with IIS.
Make Sure that you have IIS up and running with ISAPI Filter installed.
1. Click on Start, in the Search programs and files type "inetmgr" and press Enter. Internet Information Management window opens, Now double click on Handler mappings.
2. Now click on the Add script map.
src="install-php-on-iis-in-windows-7_iis2.png" alt="iis2" />
3. In the Add Script Map window, add *.php in the Request path, click the button next to Executable and select php5isapi.dll file from php installation folder (i.e. D:\php, if you have installed php on D), add a name like php in Name field and click OK.
4. Go back to the previous screen of Internet Information Manager by click on the blue arrow on the left corner of the screen.
5. On this screen, double click on the ISAPI Filters.
6. Click on Add on the next screen.
7. Add *.php in the Filter name and select php5isapi.dll from the php installation folder by clicking on the button next to the Executable field.
8. Click OK.
9. Testing if PHP is installed properly.
Create a php file containing code <?php echo phpinfo(); ?> and save it as test.php.
Run this file on your web server and if you get an output like this :
then your php installation is working properly on IIS in Windows 7.
A similar process can be followed for configuring PHP to work with IIS on Windows XP.
PHP: Tips of the Day
Get the full URL in PHP
Have a look at $_SERVER['REQUEST_URI'], i.e.
$actual_link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
(Note that the double quoted string syntax is perfectly correct)
If you want to support both HTTP and HTTPS, you can use
$actual_link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
Editor's note: using this code has security implications. The client can set HTTP_HOST and REQUEST_URI to any arbitrary value it wants.
Ref : https://bit.ly/2ZYItNJ
- New Content published on w3resource:
- Scala Programming Exercises, Practice, Solution
- Python Itertools exercises
- Python Numpy exercises
- Python GeoPy Package exercises
- Python Pandas exercises
- Python nltk exercises
- Python BeautifulSoup exercises
- Form Template
- Composer - PHP Package Manager
- PHPUnit - PHP Testing
- Laravel - PHP Framework