I am an experienced web designer, programmer and IT teacher. I use PHP extensively and decided to avoid having to uload php files to my ISP for testing by installing Apache and PHP on my computer.

After many weeks of struggling to get PHP, MySQL, Apache installed, I must now give up to presrve my sanity. Apache and MySqL installed and functioned without problem, but PHP just would not function despite studying 3 text books and every FAQ on the internet.
The installation instructions have great big gaps in them, and what instruction there are ask me to locate sections of the 'conf' file which don't exist.

Now I wish to remove the PHP program and its files from my computer but there is no PHP program shown in the Add/Remove programs list. Does any one know how to safely remove this flakey mess of a program (PHP5)?

Best wishes

Awestruck

    You installed on windows using the installer? The only thing i can figure is that you could look in your Program Files directory and see if php or php5 or php.net is a folder in there. If so, then you can probably delete it.

    You might also search the registry for installed software for PHP or php.net or php5 and remove those entries as well. And also remove the entries from the windows path.

    Next time you decide to do something like this (since it's really very easy), I'd suggest you look at my "stuck" post at the top of this forum. The images aren't there currently; however, in time I'll get them back. Probably today (like right now).

      Out of curiosity, which installation instructions did you follow? The first time I ever touched PHP, all I did was follow the instructions in the PHP manual (e.g. [man]install.windows.apache2[/man] and [man]install.windows.manual[/man]).

      Also, the "conf" file would be Apache's configure file, e.g. httpd.conf in the "conf" subdirectory where you installed Apache.

        Thank you for the very prompt replies. As you both say that the intallation of Apache/MySQL and PHP should have been trouble free, and because I am stuck indoors wirth a severe bout of tonsilitis, I decided to investigate the installations on my computers one last time.
        (I had installed the programs on two computers with the same disappointing results). The problem is that phpinfo.php will not show but I can view the source code. No other php files will show although the source code can be accessed from the View menu of the browser. In I.E. I get the 'Open or Save' dialog followed by the Windows 'Open With dialog. This normally means that Apache is not sending the code to PHP for interpretation, or that PHP is not interpretting, or that Apache is not confgured correctly. I have checked the configuration of Apache and php.ini hundreds of time and can find nothing wrong. I ran CMD with php -1 and could not recognise any error message. I did not get a screen full of HTML code either. I tried Mozilla Firefox and got the following message: Not Found. The requested URL /phpinfo.php was not found on this server. Apache/2.0.43 Server at localhost Port 80. Yet phpinfo.php is sitting right there in the htdocs folder.
        I am in despair.
        Awestruck

          Incidentally I could not find "Stuck" I tried Sticky and the instruction therein were exactly the same as the ones I used without success.
          Regards
          Awestruck

            Thank you for the very prompt replies. As you both say that the intallation of Apache/MySQL and PHP should have been trouble free, and because I am stuck indoors wirth a severe bout of tonsilitis, I decided to investigate the installations on my computers one last time.
            (I had installed the programs on two computers with the same disappointing results). The problem is that phpinfo.php will not show but I can view the source code. No other php files will show although the source code can be accessed from the View menu of the browser. In I.E.
            I get the 'Open or Save' dialog followed by the Windows 'Open With dialog. This normally means that Apache is not sending the code to PHP for interpretation, or that PHP is not interpretting, or that Apache is not confgured correctly. I have checked the configuration of Apache and php.ini hundreds of time and can find nothing wrong. I ran CMD
            with php -1 and could not recognise any error message. I did not get a screen full of HTML code either. I tried Mozilla Firefox and got the following message: Not Found. The requested URL /phpinfo.php was not found on this server. Apache/2.0.43 Server at localhost Port 80.
            Awestruck

              Can you show us the modifications you made to Apache's httpd.conf file in order to implement PHP?

              Also, did you add the main PHP directory to your system's PATH environment variable?

                Platform Windows XP
                Apache ver 2.0.43.0[/B] expanded from apache_2.055-win32-x86-no_ssl.msi
                Apache directory is C:\Apache
                Setup as Typical as I would not know how to customise it.

                MySQL ver 1.4 was expanded from httpd-2.0.43.tar.gz
                Directory C:\MySQL

                PHP ver 5.1.2 expanded from php_5.1.2-win32.zip
                Directory C:\php
                Key files C:\php\php.exe C:\php\php.ini

                Apache names. Network domain: Localhost

                Server name: Localhost
                Admin email: adrian@localhost

                Apache configuration changes made in C:\apache\httpd.conf

                ServerRoot “C:/Apache”
                #
                PHPIniDir "C:/php"

                #Start of Addition-----------------------------
                #
                LoadModule ph5-module c:/php/php5apache2.dll
                AddModule mod_php5.c
                AddType application/x-httpd-php .php .phtml .php5
                #End of Addition----------------------------------

                ServerAdmin adrian@localhost

                DocumentRoot "C:/Apache/htdocs"

                ServerName localhost:80

                This should be changed to whatever you set DocumentRoot to.

                #
                <Directory "C:/Apache/htdocs">
                Alias /icons/ "C:/Apache/icons/"
                Alias /manual "C:/Apache/manual"

                Changes made to C:\php\pp.ini

                Doc_root = “C:\Apache\htdocs”

                Extension_dir = “C:\php\ext”

                Extension = "php_msql.dll"

                I set the path in the Control Panel--System--Advanced as PHPRC and C:\php
                Best wishes
                Awestruck

                  I'm not sure if that's a typo or not, but your extension= line doesn't point to a valid DLL - did you mean it says extension = "php_mysql.dll" ?

                  Also, what exactly is the problem? Do no .php pages work correctly, or is it just that you can't use any of the mysql_*() commands?

                    Umm... why do you add the statically compiled module mod_php5.c when you dynamically load it as with LoadModule ph5_module?

                      Good catch - I skimmed over that for some reason. As bpat points out (indirectly), the AddModule line should be removed.

                        It seems to make no difference to the problem whether that line is in or out, however I have removed it. Thanks for spotting it. The problem is as if Apache is just not functioning as a server. Yet the confirmation Apache page appears when I test it.
                        In I.E or Mozilla when I enter http://localhost/phpinfo.php (or any other php file taken from one of my websites) I get a '404 page not found'. If I use File, Open on either browser and navigate to C:\Apache\htdocs, I can load an html file from there but not a PHP file.

                        Regards

                        Awestruck

                          If you create a new HTML file (called new.html for example) in c:\Apache\htdocs\ can you successfully view it at http://localhost/new.html ?

                          Since you're using Windows, are you viewing file extensions? To verify that you are, open My Computer, go to Tools->Folder Options, click the View tab, and make sure that the checkbox for "Hide file extensions for known file types" is unchecked. If it was checked, go back and make sure your PHP files weren't inadvertently named something like test.php.txt or something along those lines.

                            File type is always visible on my machines as this is essential for my web design work. The new.html file showed up only if I used File Open in IE it would not show up if I usd the address bar and http://localhost/new.html
                            None of the PHP files in htdocs used for testing have extra file types tagged on the end.
                            As I said in my previous reply, HTM amd HTML files show up if I load them in IE using 'File Open' but not if I use http://localhost/anyfile.html in the Address bar. I get a 404 message.
                            PHP files will not show up by using either http://localhost/anyfile.php or by using IE, File, Open, then C:/Apache/htdocs/anyfile.php. This produces a download dialog box with Save or Open buttons.
                            If I type http://local host in the address bar of either IE or Mozilla, the Apache's 'successful installation' page appears.

                            Incidentally the line that you suggested I remove yesterday (mod_php5.c) I had entered because the text book PHP in easy steps instructed me to.
                            As previously reported, I have removed it.

                            Best regards

                            Awestruck

                              Awestruck wrote:

                              As I said in my previous reply, HTM amd HTML files show up if I load them in IE using 'File Open'

                              Well using Open from the File menu has nothing to do with using a webserver so that's really irrelevant.

                              This may sound stupid, but I just want to cover everything; when you made the changes to Apache's .conf file, you did restart Apache afterwards, correct?

                              Also, where is Apache's config file placed on your hard drive?

                              EDIT: Hmm... Try doing this, just out of curiosity:

                              cd c:\Apache\bin
                              httpd -k stop
                              httpd -k start -d "C:\Apache\htdocs"

                              Then see if you can retrieve the HTML files.

                              One last thing - are you sure it's a 404 Not Found error you're getting, and not a 403 Forbidden error?

                                Hey guys,

                                I am having a similar problem to Awestruck and I am a PHP/Apache newboy. When I try to view my test.php page in my root directory C:\htdocs\ and type http:// localhost/ into my address bar in IE7, it is showing'Internet Explorer cannot display the webpage'.
                                I have the following code for the location of my root in httpd.conf...

                                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:/htdocs/"

                                #

                                Each directory to which Apache has access can be configured with respect

                                to which services and features are allowed and/or disabled in that

                                directory (and its subdirectories).

                                #

                                First, we configure the "default" to be a very restrictive set of

                                features.

                                #
                                <Directory />
                                Options FollowSymLinks
                                AllowOverride None
                                Order deny,allow
                                Deny from all
                                Satisfy all
                                </Directory>

                                #

                                Note that from this point forward you must specifically allow

                                particular features to be enabled - so if something's not working as

                                you might expect, make sure that you have specifically enabled it

                                below.

                                #

                                #

                                This should be changed to whatever you set DocumentRoot to.

                                #
                                <Directory "C:/htdocs/">

                                Apache is running OK but when I add 'LoadModule php5_module c:/php5/php5apache.dll' it wont start.
                                I don't want to add to the confusion but it seems like a similar problem to Awestruck's.
                                Any help would be greatful and I am trying to fix it myself right now.

                                  Do you have apache 1, apache 2, apache 2.2?

                                  There a 3 dlls. One for each type.

                                  php5apache2.dll is for apache 2.

                                  The apache2.2 thing can also catch people out as unless things have changed needs another one.

                                  Have a look in event log in control panel under administrative tools as it is a bit more helpful for errors.

                                  Also try with no extensions to start with as they can cause issues with paths sometimes.

                                    I have Apache 2.2.4. The error Apache is showing is that it cannot locate php5apache2.dll in C:/php5/. It is there and I haven't done a typo as I have even tried copying and pasteing the title name just to be sure. I have just done another check and it is now showing that it cannot locate php5apache.dll in C:/php5/ and that is there as well!

                                    I have now put a # in front of '#LoadModule php5_module c:/php5/php5apache.dll and Apache is working OK but when I remove the # so the line is read it won't work. I am going to sleep on this on look at it on Sunday after a hard days MTB riding tomorrow!

                                      The error Apache is showing is that it cannot locate php5apache2.dll in C:/php5/.

                                      Ah, but for Apache 2.2.4 the correct dll is: php5apache2_2.dll

                                        You are a star!! It now works! Problem solved!

                                        Well, there are no problems at the moment and Apache is showing all service are running OK so it looks good. I saw php5apache2_2.dll and just thought it was an extra due to the underscore instead of a period... dohhh!

                                        Maybe this will help Awestruck with his problem as I can let him have my httpd.conf file if he wants to check it.

                                        I only joined this forum about 4 hours ago. It has took me all week to sort this problem out until I came here!

                                        Thanks again!

                                        Kevin Mawdsley