I am trying to set up Apache as a webserver so I can do Development work on my local machine before uploading it to my website (hosted by someone else using UNIX/Apache).

I am trying to get PHP to be able to query the MYSQL server I have on my system.

I am running Windows XP Home Edition.

I installed MYSQL, installed PHP, installed Apache.

I modified the Apache httpd document with:

ScriptAlias /php/ "c:/php/"
AddType application/x-httpd-php .php
Action application/x-httpd-php "/php/php.exe

The Apache Service is running. Yes, the MYSQL Service is running.
I have stopped and started Apache. I have rebooted.

I do get the Apache localhost page.

I get a Server Not Found if I try and open a php page that queries the MYSQL DB.

I don't want this to sound bad, but I am really not interested in learning depth about Apache or webservers, nor do I know much about them. I make the changes that the PHP and Apache sites tell me to, and it dosen't work. I am just trying to do some development in PHP.

Thanks in advance for your help.

    1. In what order did you install the products?

    2. What was the name of the PHP file that you downloaded?

      Originally it was PHP -> MYSQL -> Apache.

      I just uninstalled PHP and reinstalled it (file php-4.3.7-installer).

      That didn't help.

        Try doing it in this order:

        1. MySQL
        2. Apache
        3. PHP

        PHP won't know about Apache or MySQL if you they haven't already been installed.

        Post back with your results.

          I already uninstalled and reinstalled PHP making it MYSQL -> Apache -> PHP.

          Didn't change anything.

            Can you post back if you can get into MySQL at all? In other words, can you open up a command prompt and get into your MySQL db?

            After that, tell me if you can even properly display a PHP page? Let's see if that can work before we start dealing with talking to the MySQL db via a PHP script.

            Try this to test if your PHP is working:

            1. create a file called phpinfo.php.
            2. Inside of it put this:

            <?php phpinfo(); ?>

            1. save it in your web server root directory. I don't know what it is called on Windows with Apache, but my guess would be htdocs or something like that.

            2. Open up a browser and see if you can open up the page phpinfo.php. You should see a whole bunch of PHP config info inside of tables.

            Answer all of the questions I've asked so I can help you out. It sounds like you have half of your stuff already working, so you're on the right track so far.

              I can get into MYSQL. I have set up a table in it via the MYSQL command center.

              It does appear that the problem is PHP. phpinfo.php gave me a 404 error. I put it in the d:\Program Files\Apache Group\Apache2 folder.

              It's frustrating because not only can't I get it to work, but I don't really know what I am doing (like the htt file I updated in Apache...I have no idea what it is doing or how what I put in helps...the documentation on these things is just "do this and it should work.").

              Thanks for your help...any other ideas?

                No problem. I understand how frustrating it can be to set this all up.

                Well, if you are able to get into MySQL, then that's working as it should. If you are saying you get the default Apache web page, then you know your Apache is working.

                My guess at this point is that something went wrong with you PHP installation OR you still aren't putting your phpinfo.php page in the right directory. My guess is that it isn't in the correct directory because you are getting the 404 (file not found) error.

                It's not entirely necessary (especially on Win32 systems) to know all the interals of what httpd.conf or other files are in this case since this is just for "test" pages, right?.

                Double check that you saved the phpinfo.php page in the correct directory. Even if PHP wasn't installed correctly, you shouldn't be getting the 404 error page. If you installed PHP incorrectly or it isn't running, you'd see the contents of you phpinfo.php page in your web browser: <?php phpinfo(); ?>

                Since you aren't, my guess is that you didn't save it to the correct directory under Apache. Double check and post again.

                  A-HA!

                  Root directory is D:\Program Files\Apache Group\Apache2\htdocs.

                  I did get the complete PHP page.

                  OK. Now I get it. I have to have anyPHP documents I want to use in the root directory! 🙂

                  My MYSQL/PHP query works now. Thank you for walking me through it!!!!!!

                    See, you learned something new today. Now go out and help others. ;-)

                    Happy coding,
                    Rachel

                    (Be sure to mark your thread resolved).

                      Write a Reply...