PHP 5.3.6 and Apache 2.2 on XP

Forum for you who has PHP installation issues

Moderators: macek, egami, gesf

Akexis
New php-forum User
New php-forum User
Posts: 4
Joined: Thu Jun 09, 2011 8:11 am

PHP 5.3.6 and Apache 2.2 on XP

Postby Akexis » Thu Jun 09, 2011 9:41 am

I've been working on this for three days. I want to put that out so as it's clear I've put effort in before finally crawling to you guys before my head explodes. I'm also going to layout what I understand (at least think I understand) so I can be corrected if I'm wrong.

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. :oops:

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
PHPIniDir "C:/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.

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

<Directory "C:/Program Files/Apache Software
Foundation/Apache2.2/htdocs"
>
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch

ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* ---

"Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important.

Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks

#
# AllowOverride controls what directives may be placed in

.htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride None

#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all

</Directory>


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.

User avatar
Nullsig
php-forum Fan User
php-forum Fan User
Posts: 981
Joined: Thu Feb 17, 2011 6:52 am
Location: Racine, WI

Re: PHP 5.3.6 and Apache 2.2 on XP

Postby Nullsig » Thu Jun 09, 2011 11:47 am

I am sorry you spent all of that time doing that.... As much as you don't want to hear this I am going to recommend you uninstall everything and then:

1. Go Here: http://www.wampserver.com/en/

2. Follow the instructions (they are super easy)

3. Enjoy PHP 5.3.5 with Apache 2.2, MySQL 5.5.8 and PHPMyAdmin all in one simple to install executable.

4. Regret that you spend 4+ hours trying to "Mans-Game" it

Akexis
New php-forum User
New php-forum User
Posts: 4
Joined: Thu Jun 09, 2011 8:11 am

Re: PHP 5.3.6 and Apache 2.2 on XP

Postby Akexis » Mon Jun 13, 2011 6:23 pm

Holy crap, I'm going to name my first born after you. THANK YOU!!!

User avatar
Nullsig
php-forum Fan User
php-forum Fan User
Posts: 981
Joined: Thu Feb 17, 2011 6:52 am
Location: Racine, WI

Re: PHP 5.3.6 and Apache 2.2 on XP

Postby Nullsig » Tue Jun 14, 2011 6:13 am

/bow. My name is Peter but a kid named Nullsig would be epic.

User avatar
egami
php-forum GURU
php-forum GURU
Posts: 2196
Joined: Wed Oct 06, 2010 11:19 am
Location: Happy Valley, UT

Re: PHP 5.3.6 and Apache 2.2 on XP

Postby egami » Tue Jun 14, 2011 7:21 am

NICE!


Return to “PHP Installation”

Who is online

Users browsing this forum: No registered users and 2 guests