After roughly four plus hours of searching, I find there's a difference between module and CGI. From what I've read, module is the way to go, it's how most hosting servers do things and there are big enough differences that if you're doing any work for clients (which I am/will be) it makes sense to go with the standard.
Until it came together that there's two different ways to install PHP, I was struggling with instructions from both. I downloaded the .msi thing, but I'm guessing that the CGI? At first I thought, sweet, easy to install so hopefully mildly idiot proof.
Finally I downloaded the tar.gz file and unpacked it, moving the contents to my c drive. I tried following the manual instructions at us.php.net, mainly editing the php.ini file (by renaming php.ini-recommended). Apache was simple to install at least, I got the index html page, the one that comes with the software to work, but can't get the test.php to work.
- Code: Select all
LoadModule php5_module "c:/PHP/php5apache2_2.dll"
AddType application/x-httpd-php .php
I've put the above lines in my httpd.conf file from Apache in several different sections. At first I put them at the very end of the file at the instruction of a book I have, but the book runs CGI. I've read in numerous places, people following the instructions of books and having the same issues while those they call on for help sometimes get snarky about asking why they're using CGI versus module. It's fairly prolific too, if the standard is module, why are so many books written with CGI in mind? But I digress.
Following the instructions at another place, I put the lines right after all of the load module lines in php.ini. - still no luck. I read somewhere that the load modules can get picky, in the order in which they need to be put so I tried at the top of the list to no luck. I also run into the issue that when I put in those lines of code I can't start or stop Apache properly. "The requested operation has failed!" dialog window pops up. When I comment them out, Apache runs just fine.
The code below also gets confusing. I've seen examples that "follow" (kind of using that word loosely) the block directly below, but in the head Directory tag has a file path that either needs to be changed... or doesn't. Both blocks of code are present within the httpd.conf file. As the second block already has a file path, I'm guessing that's the one that needs to be modified... if it does at all. Instructions differ from website to website. I get the strong feeling that what it needs is where you keep your php files? Either you're keeping them in the htdocs in Apache, which is reminiscent of the hosting servers I've dealt with or in the PHP directory. If it isn't apparent by this point, I haven't any experience with servers other than happily connecting via FTP.
Other places I've read suggest changing the file path to the PHP directory. As to not further confuse, on my computer it is PHP, not php, so the all caps is correct on my computer. I have tried changing the file path to my PHP directory to no avail. I also added the C:\PHP;C:\PHP\ext; to the Path environment variable.
At this point, I feel like I'm cycling through the tumblers on a lock and I might be getting things right, just not in the right order or at the same time.
Deny from all
<Directory "C:/Program Files/Apache Software
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch
# Note that "MultiViews" must be named *explicitly* ---
# doesn't give it to you.
# The Options directive is both complicated and important.
# for more information.
Options Indexes FollowSymLinks
# AllowOverride controls what directives may be placed in
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
# Controls who can get stuff from this server.
Allow from all
For a while I was getting the 403 error. I think it was a 403 error, about how it was forbidden, no permission from something in the PHP directory. Now all I get is:
<? phpinfo(); ?>
when I go to localhost/test.php. Clearly it's not being processed.
Oh, right, php5apache2_2.dll also wasn't with the compressed file of 5.3.6. Following instructions, I downloaded the v6 zip file, which is PHP 5.2? I took the file from there and artificially, essentially, placed it in the main PHP directory.
I wish online documentation was as up to date as the software. I didn't expect it to be a walk in the park, but I haven't even found two set of instructions yet that are the same.
If any of you might be able to help me sift through the mess above I'd be eternally grateful.