Installing PHP Under BadBlue Web Server - Installing PHP Interpreter
(Page 3 of 4 )
Download Windows binary for the latest version of PHP. Once you've downloaded it, unzip it into a C:\, rename the folder to "php".
Open the PHP.INI-DIST file from C:\PHP folder, locate the following line:
;cgi.force_redirect = 1We need to uncomment this line and change the setting to 0 as shown below to run PHP under BadBlue, do the necessary changes and save the file as php.ini in your windows folder (C:\windows on my computer).
cgi.force_redirect = 0Configuring BadBlue for PHPOpen your favorite browser, in the address area type http://localhost/ to open the BadBlue welcome page, click on hyperlink Help from the options available below the BadBlue logo in the browser. You can also type in the address http://localhost/help.htm to open that page. Here’s a snapshot of this screen.
In the help screen look in the developer support section and click on the hyperlink PHP installation wizard which shall open the PHP Wizard - Step 1 of 3 window, click next to go to step 2 enter the location of php.exe in this screen eg: c:\php\php.exe.
Click next to reach step 3 and click finish to complete the configuration.
Manual Configuration InstructionsIf you would like to configure BadBlue for PHP manually, open the ext.ini file (usually in the directory c:\program files\badblue\pe) and adding the following lines:
[SERVICES]
extension1=php,c:\php\php.exe
extension2=php3,c:\php\php.exe
extension3=php4,c:\php\php.exeNote: Make sure that the path to PHP.EXE is correct and don’t forget to save the file.
Restart the BadBlue server to reflect the changes.
Testing PHP Under BadBlueOpen the browser, in the address area type the http://localhost/ to open the BadBlue welcome page, click on hyperlink Help from the options available below the BadBlue logo in the browser.
In the help screen go to the developer support section and click on the hyperlink Test PHP support, which shall open the Test PHP Support window. If PHP is correctly installed and configured, you should see today's date and time displayed in that browser window. You can also type in the address type http://localhost/testphp.php to open that test page.
Alternately you could open your favorite text editor and create a text file and type the following in it
<?php
phpinfo();
?>phpinfo() is a PHP function which outputs a large amount of information about the current state of PHP. This includes information about PHP compilation options and extensions, the PHP version, server information and environment, the PHP environment, OS version information, paths, master and local values of configuration options, HTTP headers, and the PHP License.
Save this file as test.php in C:\Program Files\BadBlue\PE\ (your default BadBlue Web root folder).
Open your browser and type http://localhost/test.php in the address bar, click Go to see if you see output like the screen below to make sure PHP in configured and running properly.
If the source code appears in the browser and not the output we are expecting, then PHP has not been properly installed or BadBlue does not recognizes PHP files, please make sure you have followed the instructions properly.
Configuring Web ServerTo change the document root folder (default is the folder where BadBlue is installed), open the ext.ini file in the BadBlue directory and add the following lines:
[SERVICES]
DOCROOT=C:\myfolder\wwwrootTo change the default page (default is index.htm) use the following setting in ext.ini:
[SERVICES]
HOMEPAGE=index.phpEvery time you start the server, the web server opens the browser window to turn this feature off use the following setting in ext.ini:
[CUSTOMIZE]
autobrowser=0Every time you start the server, the web server opens the server window to minimize this window use the following setting in ext.ini:
[CUSTOMIZE]
autominimize=1Note: Always make sure you restart the server to reflect the changes made to ext.ini file.
Next: Conclusion >>
More PHP Articles
More By Jayesh Jain