Cramster.com - Homework Solutions, Lecture Notes, Exams, and Free Online Homework Help
Sign Up Now! Login Customer Support
McAfee Secure sites help keep you safe from identity theft, credit card fraud, spyware, spam, viruses and online scams
Problem Solved.
    Home    
    Homework Help    
   Answer Board   
    Resources (Beta)    
   
Member's Topic Headline:

Programing Question 1

Know the answer? Have a better solution? Share it.
Get Help Now.
View homework problems
explained for free!
Member Testimonials

Question:

Advertisement:

Answer | Ask New Question | Customize Profile | Leaderboards | 
FAQ

Member's Avatar

Scholar
Karma Points: 207
(virtual university)
Respect (76%):
Date Posted: 7/24/2008 7:42:05 AM  Status: Live
Programing Question 1
Course Textbook Chapter Problem
N/A N/A N/A N/A
Question Details:

Write complete setup and installation (step by step) of PHP with apache truncate server, and its configuration for data base programming with MYSQL. Your answer must be concise, clear and to the point showing all steps in real detail.

Answers:

Member's Avatar

Expert
Karma Points: 954
Date Posted: 7/30/2008 11:11:52 PM  Status: Live
Asker's Rating: None Provided    Moderator's Rating: N/A
Response:
Dear user.......
 
hope this will help yu
 
 Installation process:
                 
Download PHP for free from http://www.php.net/downloads.php. You'll want
the Windows Binaries package, and be sure to grab the version that includes both
the CGI binary and the server API versions if you have a choice.
In addition to PHP itself, you will need a Web server such as Internet Information
Services (IIS), Apache, Sambar or OmniHTTPD. PHP was designed to run
as a plug-in for existing Web server software. To test dynamic Web pages with
PHP, you'll need to equip your own computer with Web server software, so that
PHP has something to plug into.
If you have Windows 2000, XP Professional
3,
or .NET Server, then install IIS (if it's not already on your system): open Control
Panel, Add/Remove Programs, Add/Remove Windows Components, and select IIS from
the list of components. If you're not lucky enough to have IIS at your disposal,
you can instead use a free 3rd party Web server like Apache. I'll give instructions
for both options in detail.

First, whether you have IIS or not, complete these steps:

1. Unzip the file you downloaded into a directory of your choice. I recommend
C:\PHP and will refer to this directory from here onward, but feel free to
choose another directory if you like.
2. Find the file called php4ts.dll in the PHP folder and copy it to the System32
subfolder of your Windows folder (e.g. C:\Windows\System32).
3. Find the file called php.ini-dist in the PHP folder and copy it to your
Windows folder. Once there, rename it to php.ini.
4. Open the php.ini file in your favourite text editor (use WordPad if Notepad
doesn't display the file properly). It's a large file with a lot of confusing options,b
ut look for a line that begins with
extension_dir and set it so that
it points to your PHP folder:extension_dir = C:\PHP
A little further down, look for a line that starts with session.save_path
and set it to your Windows TEMP folder:
session.save_path = C:\WINDOWS\TEMP
Save the changes you made and close your text editor.

Now, if you have IIS, follow these instructions:

1. In the Windows Control Panel, open Administrative Tools, Internet Information
Services.
3Windows XP Home Edition does not come with IIS.
Installation
2. In the tree view, expand the entry labelled local computer, then under Web
Sites look for Default Web Site (unless you have virtual hosts set up, in which
case, choose the site you want to add PHP support to). Right-click on the
site and choose Properties.
3. Click the ISAPI Filters tab, and click Add.... In the Filter Name fielfield, type PHP,
and in the Executable field, browse for the file called php4isapi.dll in the
sapi subfolder of your PHP folder (e.g. C:\PHP\sapi\php4isapi.dll). ClickOK.
4. Click the Home Directory tab, and click the Configuration... button. On theMappings tab click Add. Again choose your php4isapi.dll file as the executableand type .php in the extension box (including the '.'). Leave everythingelse unchanged and click OK. If you want your Web server to treat other

file extensions as PHP files (.php3, .php4, and .phtml are common choices),repeat this step for each extension. Click OK to close the Application Configurationwindow.

5. Click the Documents tab, and click the Add... button. Type index.php as theDefault Document Name and click OK. This will ensure that a file called index.php will be displayed as the default document in a given folder on yoursite. You may also want to add entries for index.php3 and index.phtml.
6. Click OK to close the Web Site Properties window. Close the Internet Information
Services window.
7. Again, in the Control Panel under Administrative Tools, open Services. Look for
the World Wide Web Publishing service near the bottom of the list. Right-click
on it and choose Restart to restart IIS with the new configuration options.
Close the Services window.
8.  PHP is installed!
If you don't have IIS, you'll first need to install some other Web server. For our
purposes I'll assume you have downloaded and installed Apache server from
http://
d.apache.org/; however, PHP can also be installed on Sambar Serverv,
OmniHTTPDvi, and others. I recommend Apache 1.3 for now, but if you wantto use
Apache 2.0, be sure to read the following sidebar.

vhttp://www.sambar.com/

vihttp://www.omnicron.ca/httpd/

Installing PHP

PHP and Apache 2.x in Windows

As of this writing, the PHP team continues to insist that support for running PHP on
Apache 2.0 is experimental only. There are a number of bugs that arise within PHP when
it is run on an Apache 2.0 server, and on Windows especially, installation can be problematic.
That said, many people are running PHP on Apache 2.0 quite successfully, and thebugs that do exist probably won't affect you if you're just setting up a low-traffic testingserver.
 
The instructions below apply to both Apache 1.3 and Apache 2.0; however, it is possible
at after configuring Apache 2.0 to use PHP, the server will fail to start. It is also possible
that it will start, but that it will fail to process PHP scripts. In both cases, an error message
should appear when you start Apache and/or in the Apache error log file.
This problem is caused by the fact that Apache 2.0 is a server still very much under development.
With each minor release they put out, they tend to break compatibility with allserver plug-in modules (such as PHP) that were compiled to work with the previous version.
On Unix, this isn't such a big deal because people tend to compile PHP for themselves,
so they simply re-compile PHP at the same time they're compiling the new release ofApache and PHP adapts accordingly. Unfortunately, on Windows, where people are usedto simply downloading pre-compiled files, the situation is different.

The php4apache2.dll file that is distributed with PHP will only work on versions ofApache 2.0 up to the one that was current at the time that version of PHP was released.So if you run into problems, the version of PHP you're using is probably older than theversion of Apache you're using. This problem can often be fixed by downloading the verylatest version of PHP; however, every time a new release of Apache 2.0 comes out, the current release of PHP will be incompatible until they get around to updating it.

Should you ever install a later version of Apache and break compatibility with the latestPHP build, you should be able to download a 'work-in-progress' version of PHP and grabjust the files you need (those responsible for the PHP-Apache interface).
Information
about doing this can be found in the PHP bug databasevii.
Once you've downloaded and installed Apache according to the instructions includedwith it, open http://localhost/ in your Web browser, to make sure itworks properly. If you don't see a Web page explaining that Apache was successfullyinstalled, then either you haven't run Apache yet, or your installation isfaulty. Check the documentation and make sure Apache is running properly before
you install PHP.
If you've made sure Apache is up and running, you can add PHP support:viihttp://bugs.php.net/bug.php?id=17826
Installation
1. On your Start Menu, choose Programs, Apache HTTP Server, Configure Apache
Server, Edit Configuration. This will open the httpd.conf file in Notepad.
2. All of the options in this long and intimidating configuration file should have
been set up correctly by the Apache install program. All you need to do is
add the following three lines to the very bottom of the file:

LoadModule php4_module c:/php/sapi/php4apache.dll

AddType application/x-httpd-php .php .php3 .phtml

AddType application/x-httpd-php-source .phps

Make sure the LoadModule line points to the appropriate file in the PHP
installation directory on your system, and note the use of slashes (/) instead
of backslashes (\).
If you're using Apache 2.0 or later, the LoadModule line needs to point
to php4apache2.dll instead of php4apache.dll.
3. Next, look for the line that begins with DirectoryIndex. This line tells
Apache what file names to use when it looks for the default page for a given
directory. You'll see the usual index.html and so forth, but you need to add
index.php, index.php3, and index.phtml to that list if they're not therealready:
DirectoryIndex index.html ... index.php index.php3 index.phtml
4. Save your changes and close Notepad.
5. Restart Apache by choosing Programs, Apache HTTP Server, Control Apache

Server, Restart on the Start menu (or type NET STOP Apache && NET

START Apache at the command prompt). If all is well, Apache will start
up again without complaint.
6. With MySQL and PHP installed, you're ready to proceed to the section called
"Post-Installation Setup Tasks”.



By reading or posting messages on these forums, you are agreeing to the Answer Board's Terms of Service and Conduct (TSC).


About Cramster | Terms of Use | Privacy Policy | Contact Us | Press Room | Site Map | Support | Anti-Cheating Policy

Cramster.com is not affiliated with any publisher. Book covers, title and author names appear for reference only.
Copyright © 2008 Cramster, Inc.