logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> How-to's & Documentation & Tips View previous topic :: View next topic
Reply to topic   Topic: Apache and PHP - A Fast, Reliable, and Proven Setup
Author
pnllan



Joined: 05 Dec 2005
Posts: 221

PostPosted: Mon 17 Jul '06 18:35    Post subject: Apache and PHP - A Fast, Reliable, and Proven Setup Reply with quote

The how-to is updated, now go to www.apachelounge.com/viewtopic.php?t=2394 .

Last edited by pnllan on Fri 10 Nov '06 7:12; edited 14 times in total
Back to top
Robert



Joined: 24 Oct 2006
Posts: 1

PostPosted: Tue 24 Oct '06 14:11    Post subject: vcredist_x86.exe Error Reply with quote

Just a hint:

If you try to install vcredist_x86.exe and get an error message:
Error 1723. "A DLL required for this install to complete could not be run."
you need to install a more up-to-date version of Microsoft Installer.
Microsoft forgot to include the required Windows Installer 3.1 in the redistributable.
You can download Windows Installer 3.1 here
http://www.microsoft.com/downloads/details.aspx?familyid=889482FC-5F56-4A38-B838-DE776FD4138C&displaylang=en

Robert
Back to top
pnllan



Joined: 05 Dec 2005
Posts: 221

PostPosted: Sat 28 Oct '06 22:55    Post subject: Reply with quote

For those wanting a MySQL setup tutorial, a question for all of you.

What do you need or want? The installation? The Configuration?

Since the installation is GUI based, you can accept the defaults and have success. Beyond that, the only other issue that is often encountered is that the PHP extensions for MySQL and the improved MySql extension (mysqli) can be problematic due to not being able to find LIBMYSQL.DLL (or not being the correct version). If you have followed what I have written above WITHOUT exception then you can overwrite the LIBMYSQL.DLL in your PHP folder with the one in the MySQL installation folder (default is C:\Program Files\MySQL\MySQL Server 5.0\bin when using MySQL 5.0.x).

I also suggest the following:

►Stay away from any of the Alpha or Beta versions of the MySQL Server since PHP will not integrate with them in most cases.

►Use MySQL GUI Tools which includes Administrator, Query Browser, and Workbench. All three are very handy tools to have around.

►When you encounter problems, Please make notes of what has occurred in the Windows Events Viewer (eventvwr.msc), Apache Logs (Access and Error), and PHP error log (if using one - I suggest you use one, this way you always have it documented rather than relying on your memory). This way when someone like me ask - you can be specific.


Back to top
shnazz



Joined: 22 Sep 2006
Posts: 7

PostPosted: Mon 06 Nov '06 19:29    Post subject: php 5.2 with apachi 2.2.x Reply with quote

I was wondering if someone who has successfully installed php 5.2 and apache 2.2.x could share their experiences and give some pointers. Did the instructions above apply? Were there some issues? ...

I am considering upgrading for a prod level system.

- shnazz
Back to top
pnllan



Joined: 05 Dec 2005
Posts: 221

PostPosted: Wed 08 Nov '06 10:01    Post subject: Reply with quote

shnazz,

In principle - yes the instructions above apply. However, PHP 5.2 now has an Apache module/handler that works with Apache 2.2.x named php5apache2_2.dll included in the PHP distribution. So, you can use it instead in your LoadModule statement for PHP. Example:

LoadModule php5_module "C:/php5/php5apache2_2.dll"

I still suggest using Steffen's Apache distribution. So, other than not having to download the PHP handler from Apache Lounge, and using the LoadModule statement above - it is relatively the same. Just make the appropriate adaptation.

Hope this helps...

Back to top
Bruce



Joined: 28 Nov 2006
Posts: 77
Location: Mars

PostPosted: Wed 10 Jan '07 5:55    Post subject: Reply with quote

thank you for the instructions thy worked firs time php worked first time Very Happy
Back to top
mansinarula



Joined: 26 Jan 2007
Posts: 1

PostPosted: Fri 26 Jan '07 3:03    Post subject: Reply with quote

I tried installing PHP5.2 using the instructions, but the problem is when I overwrite the php5apache2.dll from Steffen, the browser just crashes while opening a simple php script:
<?php
phpinfo();
?>

The reason was because php5apache2.dll from Steffen is for php5.1.x, but the files in ext directory are from php5.2.x

And if I don't overwrite the dll file, then Apache 2.2 doesn't start. So finally I gave up and installed php5.1.6 version and followed the instructions. Now it is working fine.

Thanks
Mansi
Back to top
Flx



Joined: 27 Jan 2007
Posts: 1

PostPosted: Sat 27 Jan '07 17:57    Post subject: Reply with quote

Hi Mansi,

I've just done it today,
got same problem.

I was able to start Apache by using PHP in CGI mode instead of module one

#
# Installing PHP as Apache Module
#
# For PHP 5 do something like this:
##LoadModule php5_module "c:/php/php5apache2.dll"
##AddHandler application/x-httpd-php .php
# configure the path to php.ini
##PHPIniDir "c:/php"


#
# Installing PHP as CGI binary
#
ScriptAlias /php/ "c:/php/"
AddType application/x-httpd-php .php
# For PHP 5
Action application/x-httpd-php "/php/php-cgi.exe"

anyway I'll be happy in anyone have an advice to use it as module.

Flx
Back to top
pnllan



Joined: 05 Dec 2005
Posts: 221

PostPosted: Sun 04 Feb '07 8:14    Post subject: Reply with quote

(if using PHP 5.2 this IS NOT necessary anymore - use the php5apache2_2.dll included from PHP.net)

Please READ everything.
Back to top
daviangel



Joined: 08 Feb 2007
Posts: 1

PostPosted: Thu 08 Feb '07 3:01    Post subject: Reply with quote

"Another problem is that people many times use OLD PHP script that uses 'short tags'. That is when the PHP declarative starts with <?. Since at least PHP 4, the default for opening PHP script has been <?php. If you are using script with short tags, then you can do one of two things. Either change ALL of your opening tags to <?php, or edit you PHP.INI file changing short_open_tag to ON."
I guess all my php books are old since most of them use the older syntax and I spent most of the day trying to figure out why my installation wasn't working due to this!
Anyways thanks to this thread I've been saved who knows how much more time trying to get apache2/php5 working on my windows xp system.
I downloaded the latest apache and php installers without problems but as soon as I tried to run phpinfo() in my php file to test out the install I just got a blank screen. No errors or anything so I spent most of the day reinstalling,messing with php.ini file apache config file and doing manual install without a change! Also did a google search and was suprised at how little info was available for apache2/php5 on windows.
Anyways thankfully google did finally send me here and I had a eureka moment when I came across this post since my file was using:
<? phpinfo(); ?>
instead of
<?php phpinfo(); ?>
hence the blank page!
So as soon as I made the change I found out my install had been working fine all along-DOH!

p.s. Another major change I notice with new apache was name change in the exe from apache to httpd when trying a manual install of apache service which was never really necessary anyways for me.
Back to top
kranthi117



Joined: 27 Feb 2007
Posts: 1

PostPosted: Wed 28 Feb '07 10:43    Post subject: Re: php 5.2 with apachi 2.2.x Reply with quote

►When Apache IS NOT processing PHP script, you will usually get a dialog box asking to save the file or which application to use to open. This is usually caused by a missing or inappropriate handler (i.e. - php5apache2.dll).

and if handler is correct all u have to d is open it as "http://localhost/test.php" (i wasted nearly 50 days not knowing this)
Back to top
santos.john



Joined: 27 Dec 2007
Posts: 1

PostPosted: Thu 27 Dec '07 13:53    Post subject: Re: php 5.2 with apachi 2.2.x Reply with quote

shnazz wrote:
I was wondering if someone who has successfully installed php 5.2 and apache 2.2.x could share their experiences and give some pointers. Did the instructions above apply? Were there some issues? ...

I am considering upgrading for a prod level system.

- shnazz


hey shnazz,

Im santos, i have successfully installed php 5.2 and apache 2.2. if u have any other question, plz concact me. i will try my best to help u.

~santos.john
Back to top
rola



Joined: 03 Jan 2008
Posts: 3

PostPosted: Thu 03 Jan '08 9:17    Post subject: Reply with quote

I have setup Apache , but just the first time to use it, I think I have many many expriences to learn from you.
Back to top
omarcolocci



Joined: 04 Feb 2008
Posts: 1

PostPosted: Mon 04 Feb '08 1:55    Post subject: Reply with quote

Hello everyone. Great distro and tutorial.

I just want to add some info for those, like me, who just installed Apache 2.2.8 (Steffen distro) + PHP 5.2.5, and it kept crashing and failing to start right after the first reboot:

Instead of php5apache2.dll, set Apache to load php5apache2_2.dll that comes with PHP 5.2.5.

Worked for me. Very Happy

Thank you all.
Back to top


Reply to topic   Topic: Apache and PHP - A Fast, Reliable, and Proven Setup View previous topic :: View next topic
Post new topic   Forum Index -> How-to's & Documentation & Tips