Jump to content

Installing Php On Windows Platform


sairfan1

Recommended Posts

HiIm new to PHP, i read totorial on w3schools.com they are very helpful my prob is im unable to download and install PHP PWS on my system, i want to know can i install PHP on windows xp? or it can be installed on windows server only? there are too many links on PHP download page (http://www.php.net/downloads.php) they confused me what to download for my windows os. further more it seems much difficult to configur php server. can any body help?

Link to comment
Share on other sites

Dear Ache,I sure am glad that I happened upon this thread today! I haven't been able to get different Apache servers that I've downloaded, to recognize the different PHP versions that I've tried installing; one the 5.2.8 version, and the other just "5," I guess, that's on a disc in a book I bought, PHP 5/MySQL Programming--even when I put them in the same folder with the Apache servers.But, thanks to your link to that Razorx site, I was able to activate the IIS 5.1 web server that I didn't even know was on my computer! I didn't even need to put in a disk or anything.The test .asp file worked, so that's great! Now, I can do the w3schools' ASP tutorials.But, in the middle of the PHP 5.2.8 Installer instructions (the Razorx site has the older PHP 5.1.1 installer pictured), I was asked to select the "Web Server" that I wanted to "setup."There were 3 "IIS" choices below the Apache choices: IIS ISAPI module, IIS FastCGI, and IIS CGI.Do you, or does anyone else, know which of these choices is the right one for my purposes: namely, for practicing PHP, MySQL and ASP on my home computer.Like irfan, I too am new to PHP, and I'm glad that you guys have these answers that are hard to find out on the Internet.Sincerely,Bennie3P.S. If I'm able to successfully install the PHP, is there some immediate adjustment or setting that I should make to keep my IIS server secure; or, isn't that an issue since I won't be interacting with anyone over the Internet with the server? Thanks.

Link to comment
Share on other sites

Do you, or does anyone else, know which of these choices is the right one for my purposes: namely, for practicing PHP, MySQL and ASP on my home computer.
It should work installing PHP on any of them, but to be on the safe side you can just use IIS CGI.
P.S. If I'm able to successfully install the PHP, is there some immediate adjustment or setting that I should make to keep my IIS server secure; or, isn't that an issue since I won't be interacting with anyone over the Internet with the server? Thanks.
It will still be secure (unless there is some specific vunerability you are thinking of?)
Link to comment
Share on other sites

Dear Synook,When I tried the PHP 5.2.8 installer using the IIS CGI choice, I got a message that said:"There is a problem with this Windows Installer package. A script required for this install to complete could not be run. Contact your support personnel or package vender."So, I deleted the installer, and tried the PHP 5.2.8 Non-thread-safe installer, again using the IIS CGI choice...and that worked. (The IIS FastCGI choice wouldn't work,and a message said "Fast CGI is not installed on the current version of IIS"). But when I tried to open this .php file, info.php:<html><head><title>PHP test page</title></head><body><h1>Test</h1><?phpInfo(); ?></body></html>using "http://localhost/info.php" to call it up, all I got was the "Test" text. I even added the location of the PHP file to the "Application Mappings" list, as was suggested to do in the "Help Manual," but then all I got was a "CGI" error message when I tried to open info.php. I did a "Repair," and now I'm back to just the "Test" text on my info.php page.Any ideas?Bennie3P.S. This .asp file, nodoubt.asp, opened fine:<head><title>ASP page test</title></head><body><div><% Response.Write("My ASP test page works. Were there any doubts?")%><br /><br /><% response.write(Request.ServerVariables("SERVER_SOFTWARE"))%></div></body></html>

Link to comment
Share on other sites

The name of the function is phpinfo(), and there must be a space after <?php, like so:

<?php phpinfo(); ?>

Try it like that, and see if that one works.By the way, if you use XAMPP or WAMP, you don't need to install PHP in addition to it - it's installed already. Just place your files in the "htdocs" folder (in XAMPP, that's "C:\Program Files\apachefriends\xampp\htdocs"), and in the browser, call "http://localhost". If you decide to use Apache, you'll have to either abandon IIS, or move it to another port though. And if you decide to use all components separately again (when you feel more comfortable with it), there's a great tutorial about putting it together. It's for slightly older versions, but the methods haven't changed a bit.

Link to comment
Share on other sites

Dear boen_robot,It dawned on me that adding a space to my php code won't help, because php isn't on my machine. I took the PHP 5.2.8 Non-thread-safe installer version off my computer, because the option that I had chosen on the "Web Server Setup" screen was "Other CGI," not "IIS CGI." You get three choices with the Non-thread set-up: IISFastCGI, Other CGI, and "Do not setup a web server." So, that must be why the "Non-thread" installation worked: the "Other CGI" choice wasn't interacting with the IIS 5.1 web server. And "IISFastCGI" doesn't work with IIS 5.1, as I've mentioned. And of course, I get an "error message" with the regular PHP 5.2.8 installer, and the installation doesn't complete.After reading your suggestion, I stopping my IIS 5.1 web server.I just did the whole "http://www.tanguay.info/wamp/installPhp5.php5" installation of the Apache 2.2.11 Win 32 Binary version, and then the PHP 5.2.8 zip package; followed all of the instructions...and it doesn't work! Here's some of the Apache "error.log":"Starting the Apache2.2 serviceThe Apache2.2 service is running.httpd.exe: Could not reliably determine the server's fully qualified domain name, using [my correct IP Address was listed here] for ServerName[Mon Jan 19 12:59:07 2009] [notice] Apache/2.2.11 (Win32) configured -- resuming normal operations[Mon Jan 19 12:59:07 2009] [notice] Server built: Dec 10 2008 00:10:06[Mon Jan 19 12:59:07 2009] [notice] Parent: Created child process 2220httpd.exe: Could not reliably determine the server's fully qualified domain name, using [my correct IP Address was listed here] for ServerName[Mon Jan 19 12:59:07 2009] [notice] Child 2220: Child process is running[Mon Jan 19 12:59:07 2009] [notice] Child 2220: Acquired the start mutex.[Mon Jan 19 12:59:07 2009] [notice] Child 2220: Starting 64 worker threads.[Mon Jan 19 12:59:07 2009] [notice] Child 2220: Starting thread to listen on port 80."Any ideas?Bennie3Thanks

Link to comment
Share on other sites

Hey J,I cleaned everything out; then successfully installed the XAMPP sofware! The Control Panel says that Apache and MySQL are running as Services; I get the orange instruction window when I type in "http://localhost/...but I can't get any of my PHP files to show. I moved two of them to the same file where the XAMPP is installed, C:\xampp\, and couldn't get them to open. I typed in "http://localhost/xampp/info.php," for example, and got this message:"Object not found!The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again. If you think this is a server error, please contact the webmaster. Error 404localhost01/20/09 01:08:53Apache/2.2.11 (Win32) DAV/2 mod_ssl/2.2.11 OpenSSL/0.9.8i mod_autoindex_color PHP/5.2.8,"even though I'm looking right at the info.php file in C:\xampp. Am I supposed to be "extracting" something to get PHP to work? I don't see anything specific in the instructions as to where I'm supposed to "Save" my .php files, or anything about "extracting." The "http://www.apachefriends.org/en/xampp-windows.html" page talks about testing things and "running scripts," but I have no idea what they're talking about.Again, I wait for answers.Bennie3P.S. I just tried opening a php example provided on the instruction page, and got this message:PostScript Module ExampleFatal error: ps_open_file() [<a href='function.ps-open-file'>function.ps-open-file</a>]: PSlib error: Could not open file 'htdocs\xampp\special\ps\draw.ps'. in C:\xampp\htdocs\xampp\special\ps\ps.php on line 75

Link to comment
Share on other sites

http://localhost/maps toC:\xampp\htdocs\so if you've saved your PHP file atC:\xampp\htdocs\test.phpthenhttp://localhost/test.phpshould open your file. The error message you're seeing on the example on the instructions page is actually a good thing. It means PHP is running, but you're missing a certain file for the example to work. I think in this case, the example is simply wrong, that's all. But PHP is working! Any PHP file underC:\xampp\htdocs\is executable fromhttp://localhost/on. Note that files inC:\xampp\are NOT executable.By the way, the Apache error you had wasn't fatal. Apache (and if you've followed the tutorial up to the PHP part - PHP) should be working properly despite it. The simple solution to it is (AFAIK) to open httpd.conf and uncomment/add the line
ServerName your-IP-address:80
(replacing your-IP-address with your actual IP address of course)
Link to comment
Share on other sites

Dear boen_robot,Afte moving my info.php file to the htdocs folder--it opened; and, with the text that I had typed in it! Before, I was getting just the plain phpinfo() screen when I clicked on phpinfo() on the instruction page. And I added my "IP address" where you said to. Thank you very much.Now I can get back to finishing up the w3schools XML tutorials that are augmenting the 6 and 7 year-old XML books that I bought cheap on amazon.com. What a mess trying to keep DTD, XML Schema and XSLT coding separate from each other.Soon I'll be starting the PHP and MySQL tutorials over again from scratch, but in the meantime:I noticed "forbidden" and "restricted" folders in the htdocs folder. Is the htdocs folder a normal place where people save all of their files to, or do they change the "Directory" location on the httpd.conf file? Can another folder-name be added easily to the file?'## DocumentRoot: The directory out of which you will serve your# documents. By default, all requests are taken from this directory, but# symbolic links and aliases may be used to point to other locations.#DocumentRoot "C:/xampp/htdocs"'I'm glad the PHP finally works! Thanks again.Sincerely,Bennie3P.S. Where is "http://localhost/ maps to C:\xampp\htdocs\" explained anyway? I can't seem to find it. Are the very basics of PHP such as this covered on some online article? The various ones that I've seen kind of skip around and bypass the minutia.

Link to comment
Share on other sites

P.S. Where is "http://localhost/ maps to C:\xampp\htdocs\" explained anyway? I can't seem to find it. Are the very basics of PHP such as this covered on some online article? The various ones that I've seen kind of skip around and bypass the minutia.
That doesn't have anything to do with PHP, that's how the Apache web server works. The web server that XAMPP installs is Apache, and you chose to install it in c:\xampp, which made the web root c:\xampp\htdocs. You might be able to find a note about that in the documentation for XAMPP.
Link to comment
Share on other sites

<html><head><title>for justsomeguy</title></head><body><script language="php">print "You were right, justsomeguy! XAMPP has documentation on everything. Now all I have to do is read it! The book I just began, PHP5/MySQL Programming, says that you can write PHP script this way, too. Thanks to you and everyone else for your help. I'll be back when I get stuck again! Bennie3"</script></body></html>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...