ShadowMage Posted February 9, 2010 Share Posted February 9, 2010 Hey guys, I'm jumping into new waters here. I've been programming with PHP for a while now, but it's always been installed and configured. I want to set up PHP on my home computer to use. So...I went to the W3Schools PHP page and went to the Install page for PHP. I followed the link to download PHP, only problem is...What the heck am I supposed to be downloading?! There are so many links I don't know where to click!Can anyone help me? Please? Link to comment Share on other sites More sharing options...
boen_robot Posted February 9, 2010 Share Posted February 9, 2010 From the windows download page, you can see some guidance on the left. If you are using PHP with Apache 1 or Apache2 from apache.org you need to use the VC6 versions of PHPIf you are using PHP with IIS you should use the VC9 versions of PHPIn addition to that, I suggest you get the Thread Safe build of whichever PHP download you choose. The Non Thread Safe version performs better on some setups, but it makes it more possible to crash the places where it doesn't improve performance. If you're interested in the details, here's an article that discusses the differences.And of course, get PHP 5.3 by all means. In the future, get whatever is the latest stable build (note: snapshots are by definition not stable). Link to comment Share on other sites More sharing options...
ShadowMage Posted February 9, 2010 Author Share Posted February 9, 2010 Thanks boen_robot.Which is better IIS or Apache? Link to comment Share on other sites More sharing options...
boen_robot Posted February 9, 2010 Share Posted February 9, 2010 Thanks boen_robot.Which is better IIS or Apache?Now that's a tough one to answer, especially for someone like myself who has used both.I'd say IIS7+ is better than Apache... if you can afford to pay for a host that offers it, and lets you manage it via the IIS Manager, and has installed the RewriteModule in addition to it.If one or more of the above is not true, Apache is better... it's cheaper (free), is good on all versions that are currently in the wild (the same doesn't apply for IIS... IIS6 and below are ridiculous), has mod_rewrite build in (though it may not always be enabled by the host).The reason you'll likely see more hosts offering Apache is that Apache runs on Linux as well, and both Linux and Apache are free. Therefore, the host doesn't have to ask for additional money from you to cover the cost. If cost is not a problem... IIS7 or later all the way!Note: IIS (any version) is also "free", as it comes with Windows. However, Windows itself costs money. The Windows Server (2008) OS that hosts need to use costs even more than your average Home, Professional or Ultimate Windows build. Link to comment Share on other sites More sharing options...
ShadowMage Posted February 9, 2010 Author Share Posted February 9, 2010 Apache is better... it's cheaper (free)OK, Apache it is! :)Thanks, boen_robot, this should get me started. I may come back here when I actually get around to setting stuff up. Link to comment Share on other sites More sharing options...
ShadowMage Posted February 9, 2010 Author Share Posted February 9, 2010 Note: IIS (any version) is also "free", as it comes with Windows. However, Windows itself costs money. The Windows Server (2008) OS that hosts need to use costs even more than your average Home, Professional or Ultimate Windows build.Can I install PHP on a Win7 Pro OS? Or XP Pro? I guess what I'm really asking is does it have to be a Server OS? Link to comment Share on other sites More sharing options...
justsomeguy Posted February 9, 2010 Share Posted February 9, 2010 You need a web server, PHP doesn't really care about the OS though. As long as you have a web server which talks to PHP and tell it when to run that's really all you need. I still have my development computer at home running XP Pro with whatever version of IIS comes with it. That's plenty for me, because I'm interested in what PHP can do for me as opposed to whatever web server it happens to be running on. Link to comment Share on other sites More sharing options...
boen_robot Posted February 10, 2010 Share Posted February 10, 2010 Can I install PHP on a Win7 Pro OS? Or XP Pro? I guess what I'm really asking is does it have to be a Server OS?Yes. You can install IIS on Windows 7 or XP Professional. Keep in mind that Windows Vista comes with IIS7, 7 comes with IIS7.5, and XP Professional comes with IIS6 (or was it 5.5? Either way... it's not IIS7).Non server Windows has the limitation of only letting you have one "site" running on it (i.e. one IP/Domain/Port combo). You can of course change it when you switch from one project to another, but you can only have one running. Other than that, it's the same deal.Like I said, the host needs a server edition, because they need to serve many sites, not just one. Link to comment Share on other sites More sharing options...
ShadowMage Posted February 10, 2010 Author Share Posted February 10, 2010 Thanks! I don't plan on running more than one site and it's only going to be a personal one, not published to the internet so that's not going to be an issue.Thanks again boen_robot! Link to comment Share on other sites More sharing options...
ShadowMage Posted February 10, 2010 Author Share Posted February 10, 2010 In addition to that, I suggest you get the Thread Safe build of whichever PHP download you choose.OK, I have a question. The PHP installation site recommends the Non thread safe builds yet you suggest the thread safe build. Why do they suggest the non thread safe build? Link to comment Share on other sites More sharing options...
boen_robot Posted February 10, 2010 Share Posted February 10, 2010 OK, I have a question. The PHP installation site recommends the Non thread safe builds yet you suggest the thread safe build. Why do they suggest the non thread safe build?Since you weren't sure whether you'd use Apache or IIS, using the Thread Safe built was the safer choise (i.e. it works everywhere), which is why I reccomended it. The Non Thread Safe built performs better on IIS' FCGI module. That's why they reccomend it. However, using the Non Thread Safe built on Apache may cause some crashes or on the very least - be less efficient. Link to comment Share on other sites More sharing options...
ShadowMage Posted February 10, 2010 Author Share Posted February 10, 2010 Ooooooohh...OK, Thanks! Link to comment Share on other sites More sharing options...
ShadowMage Posted August 16, 2010 Author Share Posted August 16, 2010 Alright, I need to resurrect this thread. I just got around to installing PHP this weekend and I've run into a problem. I configured IIS 7 and installed PHP to C:/PHP and everything went fine. It created the inetpub directory on the C:/ drive as well, which has the wwwroot folder in it. When I tried to create a test PHP page and save it in the wwwroot folder, I got an error message from windows saying I don't have permission to save in that folder. So naturally I checked permissions. The administrators group (which my user account is a member of) has access to the entire inetpub directory. I'm not sure why I can't save there. Anyone have any suggestions? Link to comment Share on other sites More sharing options...
ShadowMage Posted August 18, 2010 Author Share Posted August 18, 2010 Nobody has any ideas? Link to comment Share on other sites More sharing options...
boen_robot Posted August 18, 2010 Share Posted August 18, 2010 The app with which you save the file needs to "Run as Administrator", or alternatively, you must explicitly enable your username (and therefore the program) as having access to the folder.The problem here is that if a program needs to use rights from the Administrators group, it needs an administrator token, which is granted by UAC in Vista and 7. Some programs are clever enough to prompt you for a UAC grant when they must, but most just give up and say "Access denied" when they weren't started with UAC. Link to comment Share on other sites More sharing options...
ShadowMage Posted August 18, 2010 Author Share Posted August 18, 2010 The app with which you save the file needs to "Run as Administrator", or alternatively, you must explicitly enable your username (and therefore the program) as having access to the folder.The problem here is that if a program needs to use rights from the Administrators group, it needs an administrator token, which is granted by UAC in Vista and 7. Some programs are clever enough to prompt you for a UAC grant when they must, but most just give up and say "Access denied" when they weren't started with UAC.Oh that's right. Stupid UAC! :)Thanks for the reminder. I'm not currently at my computer, but I'll check it out when I get home. Link to comment Share on other sites More sharing options...
dsonesuk Posted August 18, 2010 Share Posted August 18, 2010 I don't know if you already done this, but this link gives extensive information of setting permissions for running php using iis7 http://www.php.net/manual/en/install.windows.iis7.php Link to comment Share on other sites More sharing options...
ShadowMage Posted August 18, 2010 Author Share Posted August 18, 2010 I don't know if you already done this, but this link gives extensive information of setting permissions for running php using iis7 http://www.php.net/manual/en/install.windows.iis7.php Yea, I ran through that setup. Most of the stuff was already done by the PHP installer. Thanks, though! Link to comment Share on other sites More sharing options...
ShadowMage Posted August 19, 2010 Author Share Posted August 19, 2010 Well, it was the stupid UAC ( ) that was preventing me from saving to the directory. Thanks boen_robot!I could very well be back when I get my website actually set up and get around to testing things out. I'm not sure if my PHP configurations are right... Link to comment Share on other sites More sharing options...
Sami Posted August 20, 2010 Share Posted August 20, 2010 I've always been using apache, because that's inside xampp.I'd recommend xampp for you, because it's friendly for beginners setting up servers! Link to comment Share on other sites More sharing options...
ShadowMage Posted August 20, 2010 Author Share Posted August 20, 2010 I've always been using apache, because that's inside xampp.I'd recommend xampp for you, because it's friendly for beginners setting up servers!Thanks for the suggestion, though it wasn't too horrible to set up IIS7. Besides I paid good money for Win7 I may as well get all the use out of it that I can! :)FWIW, it seems as though my PHP configuration is OK. My test page ran just fine. Now for MySQL...... Link to comment Share on other sites More sharing options...
boen_robot Posted August 21, 2010 Share Posted August 21, 2010 Thanks for the suggestion, though it wasn't too horrible to set up IIS7. Besides I paid good money for Win7 I may as well get all the use out of it that I can! :)FWIW, it seems as though my PHP configuration is OK. My test page ran just fine. Now for MySQL......Note in advance - make sure to start the MySQL installer as Administrator. It is supposed to automatically ask for elevation when it must, but if you don't start it as administrator, it tries to start the MySQL configuration wizzard afterwards, and because that too requires admin privilages, it crashes... or at least it did once... I don't know if they've fixed it already.Also, while it's not required, if you have 64 bit Windows, I'd reccomend you get the corresponding 64 bit MySQL version (with the same thing in mind).If you've successfully gotten that far, the final bit (connecting PHP with MySQL) is trivial - open up php.ini, find and remove the ";" in front of "extension=php_mysqli.dll", restart IIS and you're set. Link to comment Share on other sites More sharing options...
ShadowMage Posted August 22, 2010 Author Share Posted August 22, 2010 Note in advance - make sure to start the MySQL installer as Administrator. It is supposed to automatically ask for elevation when it must, but if you don't start it as administrator, it tries to start the MySQL configuration wizzard afterwards, and because that too requires admin privilages, it crashes... or at least it did once... I don't know if they've fixed it already.Also, while it's not required, if you have 64 bit Windows, I'd reccomend you get the corresponding 64 bit MySQL version (with the same thing in mind).I did all that. It prompted me for elevation and ran through the setup wizard, so they must have fixed it. If you've successfully gotten that far, the final bit (connecting PHP with MySQL) is trivial - open up php.ini, find and remove the ";" in front of "extension=php_mysqli.dll", restart IIS and you're set.While I did successfully get that far, and the ";" was already removed, I still can't connect. I'm missing something, but I'm not sure what. When I try to connect to mysql I get the following errors:Warning: mysql_connect(): [2002] A connection attempt failed because the connected party did not (trying to connect via tcp://localhost:3306) in C:\inetpub\phpinclude\MySQL_Connect.php on line 12 Warning: mysql_connect(): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. in C:\inetpub\phpinclude\MySQL_Connect.php on line 12 Fatal error: Maximum execution time of 60 seconds exceeded in C:\inetpub\phpinclude\MySQL_Connect.php on line 12 Any ideas on what I missed? This is on a Win7 Pro setup (but I think you already knew that ) Link to comment Share on other sites More sharing options...
boen_robot Posted August 22, 2010 Share Posted August 22, 2010 Sounds like a Firewall thing... Try to add "mysqld.exe" (at "%systemDrive%\Program Files\MySQL\MySQL Server 5.1\bin") to the exceptions list. Link to comment Share on other sites More sharing options...
ShadowMage Posted August 22, 2010 Author Share Posted August 22, 2010 Sounds like a Firewall thing... Try to add "mysqld.exe" (at "%systemDrive%\Program Files\MySQL\MySQL Server 5.1\bin") to the exceptions list.Thought for sure you had it there but it doesn't appear to have done anything. I allowed full access for mysqld.exe but I still get those errors. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.