Windows 7 Apache + MySQL + PHP

Discussion in 'Programming and Scripting' started by bitumen, Jan 21, 2009.

  1. bitumen

    bitumen New Member

    Joined:
    Jan 9, 2009
    Messages:
    48
    Likes Received:
    0
    Apache 2.2.11
    MySQL 5.1.30 (64 bit)
    Java JDK 6u11 (64 bit)
    Netbeans (developer nightly build 20090120401) (admin rights)
    PHP 5.28
    xdebug ( thread safe) 2.0.4-5.2.8

    Built basic php DB connection ALL working as expected (html, php, debugging also working)

    Will test further with complex php web application
    and then jsp + tomcat

    Suns Openoffice works nicly on windows 7 download: OpenOffice.org Downloads
     
    #1 bitumen, Jan 21, 2009
    Last edited: Jan 23, 2009
  2. bfj

    bfj New Member

    Joined:
    Feb 8, 2009
    Messages:
    2
    Likes Received:
    0
    How did you set up permissions in httpd.conf?

    I managed my sites to work only by specifying 'Allow from all'... And that is not good.

    EDIT:
    Never mind. Managed to get things working the way I want. :)
     
    #2 bfj, Feb 8, 2009
    Last edited: Feb 8, 2009
  3. jimbo45

    jimbo45 New Member

    Joined:
    Jan 20, 2009
    Messages:
    1,208
    Likes Received:
    41
    Works fine on Windows 7 X-64 --however I only did this for testing --I still run this type of stuff on a Linux server.

    Depending on the number of connections you want to allow this type of stuff is really a Server type app -- W7 isn't actually a server although I suspect some code was lifted from Server 2008, and the Beta is an "Ultimate" version which has more Networking capabilities in it than a "Bog standard" home edition.

    Cheers
    jimbo
     
  4. kevin from Chi-town

    Joined:
    Jan 11, 2009
    Messages:
    714
    Likes Received:
    8
    I'm running apache+mysql+php 5 on win 7 now with Wamp server. I had to build a forum for an organization, so I used phpbb and wamp...took me about 2 hours and I was done
     
  5. jerryscript

    jerryscript New Member

    Joined:
    Mar 19, 2009
    Messages:
    4
    Likes Received:
    0
    Works fine, after figuring out why I couldn't make changes to the config files at first.

    If you have trouble editing the httpd.conf and/or php.ini files, try copying them to the desktop first. Open the desktop copy in an editor and make the needed changes and save it. Then drag it to the apache or php folder as needed, at which point you will have to have administrator rights to overwrite the original files. That's it, restart Apache and your changes should be running.
     
  6. RKramkowski

    RKramkowski New Member

    Joined:
    May 30, 2009
    Messages:
    44
    Likes Received:
    0
    Can't get it to work to save my life!

    I've been running Apache, PHP, mySQL, etc. in the past on WindowsXP and Vista. I've recently installed Windows 7 RC. Problem is that when I point to http://localhost (or http://www.myserver.dev) it only echoes the php command but doesn’t display the PHP information screen. It’s as if PHP isn’t running and it doesn’t know what to do with the command. In my Apache service monitor I see Apache/2.2.11 (Win32) PHP/5.2.9-2 so it appears that it is running. I’ve gone over all config changes in my files with a fine tooth comb but cannot find anything amiss.

    I’m at my wit’s end! I’ve reinstalled three times now. The last time, I went back and redownloaded the distribution files. I’ve gone through this with a fine-tooth comb and every time, the result is the same.

    I’m running a Windows7, build 7100 64 bit machine but with all 32 bit apps for web development. All the latest Microsoft patches are installed. IIS is turned off and so is UAC (temporarily). I’ve even set all executables to run as administrator and turned on compatibility mode.

    When I did a WAMP install, the results were the same and there were no material differences between config files.

    I've even tried older versions of Apache and PHP, and even tried PHP 5.3.

    On a whim I thought it may be an IE8 issue so I installed Firefox. Same result, I get my PHP code echoed back.

    No errors are generated.

    Anyone have any ideas where I should look next?
     
  7. kevin from Chi-town

    Joined:
    Jan 11, 2009
    Messages:
    714
    Likes Received:
    8
    I have WAMP installed and running fine. I'm also using running phpbb v3 on it, it works like a charm. This is the fourth install of WAMP , and I only had one issue and it was on the first install. It was in the httpd.config file. You have to scroll down to where it says Document Root and map your own index behind C:/wamp/www/" asuming you have wamp set right to your c: drive. Please repost if thats not right and I'll try to help you work it out
     
  8. RKramkowski

    RKramkowski New Member

    Joined:
    May 30, 2009
    Messages:
    44
    Likes Received:
    0
    Well, I reverted back to installing each separately but are you saying you have two DocumentRoots? One that points to the default path from the install and one as a path to where you really are keeping your docs? I know the path shows up twice in httpd.conf - 0nce as DocumentRoot and once in brackets around line 207. But I didn't think two DocumentRoot statements were allowed.
     
  9. kevin from Chi-town

    Joined:
    Jan 11, 2009
    Messages:
    714
    Likes Received:
    8
    the path should be the one in brackets...as a side note I'm not on the pc I've installed it on so I'm speaking from memory.
    Your doc root should be in the www file and then whatever your chosen path is from there. I also remember another setting change in the config file, but I'll have to verify that when I get to the pc I'm running wamp on. This will be in a few hrs

    edit: I'm looking at the httpd file now, both Document roots are pointed to the path . Mine looks like this "c:/wamp/www/phpbb/"

    thats in both Document root lines
     
    #9 kevin from Chi-town, Jun 12, 2009
    Last edited: Jun 12, 2009
  10. RKramkowski

    RKramkowski New Member

    Joined:
    May 30, 2009
    Messages:
    44
    Likes Received:
    0
    Well that looks ok as well. I found another forum that says that another way to verify PHP installation is to type httpd -v from a command window. That also checks out OK. I found another forum that said the .MSI file from php.net doesn't always have all the .DLLs that are needed for PHP under Apache - that they cater more toward ISS. They recommended downloading the snap file and copying over the DLLs. So I did that but there were no .DLL files in there. It appeared to be the C code, include files, etc.

    So even though all outward signs point toward Apache and PHP being installed properly, it won't execute the PHP commands. It just echoes the PHP code back.
     
  11. kevin from Chi-town

    Joined:
    Jan 11, 2009
    Messages:
    714
    Likes Received:
    8
    .........can you even open a php file, like write one as test and see if it opens? and am I to understand thaat you 've installed all of these separately or are you now using wamp?
     
  12. RKramkowski

    RKramkowski New Member

    Joined:
    May 30, 2009
    Messages:
    44
    Likes Received:
    0
    I created a file called index.php and it's contents are the standard:

    <?php phpinfo(); ?>

    When I type http://localhost into my browser, I get exactly that echoed on my screen in my browser: <?php phpinfo(); ?>

    I do not get the purple screen with all the PHP info. Nor do I get any errors in any logfiles that I can find, including the windows logfile.
     
  13. kevin from Chi-town

    Joined:
    Jan 11, 2009
    Messages:
    714
    Likes Received:
    8
    yeah...it sounds to me like one of your services isn't starting. I'm still not sure what your running (meaning that you installed Apache=mysql=php separately or if your still using wamp). The reason I went with WAMP was because when I installed them separately, if just one line of syntax was off, it would disable everything. There is a separate line besides the Doc root in the httpd.config file that had to be edited that is not present in the httpd.config file that comes with WAMP. If your running WAMP you should have myphpadmin installed. You can also start and stop services very easily. The below thumbnail will attest to that. If you've installed separately, you need to go through the httpd file, and make sure you grant yourself permission (or make sure it sees you as admin). With Wamp it automatically recognizes you as admin. Let me know if you got them on separately, .....or if you've got wamp
     
  14. RKramkowski

    RKramkowski New Member

    Joined:
    May 30, 2009
    Messages:
    44
    Likes Received:
    0
    Sorry about that. I downloaded Apache from Apache.org and installed it and verified that it works. I then downloaded and installed PHP from PHP.NET. That's where I get stuck. Eventually I'd have mySQL, phpMyAdmin, Netbeans, and Wordpress installed. But I verify each piece before going to the next.

    I have used WinXP and Vista previously and have always done it this way without a problem. I agree that syntax must be perfect or it will fail. In this case, I even had another person look at my .conf and .ini files and he couldn't find anything amiss either.

    That's why I began to think that maybe there's some kind of permission I missed that's changed with Win7. But I did the obvious like disable UAC, run as admin, compatibility mode.
     
  15. kevin from Chi-town

    Joined:
    Jan 11, 2009
    Messages:
    714
    Likes Received:
    8
    you know....maybe just maybe..theres a corrupt file in Apache thats causing this. If your stuck on #2 of the 3 point install (which I agree your doing correctly), then maybe sometthing else is amiss. Let me go through mine again looking for a fresh idea. And when I installed separately, it was on win 7 version 7000 beta, so there shouldnt be an issue there.


    Have you checked the apache error logs?
     
    #15 kevin from Chi-town, Jun 16, 2009
    Last edited: Jun 16, 2009
  16. RKramkowski

    RKramkowski New Member

    Joined:
    May 30, 2009
    Messages:
    44
    Likes Received:
    0
    Kevin, thanks for your help so far.

    I did think of that and re-downloaded the installation files for both PHP and Apache but I ended up with the same result.

    My development system is a 64 bit quadcore desktop but I also have a dual core 32 bit laptop. Both are running Win7 RC, I never installed on the beta. One thing I hadn't tried is installing on the 32 bit laptop to see what happens. Although I don't want to use the laptop as my development machine, it would be a good test.

    I'll let you know how I make out.
     
  17. kevin from Chi-town

    Joined:
    Jan 11, 2009
    Messages:
    714
    Likes Received:
    8
    May I suggest WAMP for testing. Installation and throwing on Phpbb would only cost about an hour...good luck and let me know what happens
     
  18. RKramkowski

    RKramkowski New Member

    Joined:
    May 30, 2009
    Messages:
    44
    Likes Received:
    0
    Well, I did a clean install on my Win7 laptop. It's 32 bit, not 64 bit. The results are exactly the same.... it echoes back my php commands instead of executing them. It's as if there's some security setting somewhere in Windows preventing it from running. It's probably not IE8 though because when I installed Firefox, it did the same thing, too.

    UAC is off and I run all executables as administrator, in compatibility mode (but none of that made a difference anyway).
     
  19. RKramkowski

    RKramkowski New Member

    Joined:
    May 30, 2009
    Messages:
    44
    Likes Received:
    0
    OK, I have new information... When I install WAMP, it installs and runs properly. But during the install, a msg box popped up stating that Windows firewall was blocking some of the feature and do I want to unblock. So I said yes. It didn't display the changes it made though. So I compared firewall settings between both systems and could find no differences relative to Apache or PHP (beyond the obvious paths that would be different).

    I did a Google search and couldn't find anything specific to Windows firewall settings for Apache and PHP though.
     
  20. kevin from Chi-town

    Joined:
    Jan 11, 2009
    Messages:
    714
    Likes Received:
    8
    if i remember correct the process in question is Apache. You have to remember that this is a learning firewall, once acknowledged, it won't bother you anymore. Look at the thumbnail....and see the apache server on top. Do you have a site running locally yet?
     

Share This Page

Loading...