Author |
|
pnllan
Joined: 05 Dec 2005 Posts: 221
|
Posted: Mon 17 Jul '06 18:35 Post subject: Apache and PHP - A Fast, Reliable, and Proven Setup |
|
|
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
|
|
Back to top |
|
pnllan
Joined: 05 Dec 2005 Posts: 221
|
Posted: Sat 28 Oct '06 22:55 Post subject: |
|
|
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
|
Posted: Mon 06 Nov '06 19:29 Post subject: php 5.2 with apachi 2.2.x |
|
|
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
|
Posted: Wed 08 Nov '06 10:01 Post subject: |
|
|
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
|
Posted: Wed 10 Jan '07 5:55 Post subject: |
|
|
thank you for the instructions thy worked firs time php worked first time |
|
Back to top |
|
mansinarula
Joined: 26 Jan 2007 Posts: 1
|
Posted: Fri 26 Jan '07 3:03 Post subject: |
|
|
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
|
Posted: Sat 27 Jan '07 17:57 Post subject: |
|
|
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
|
Posted: Sun 04 Feb '07 8:14 Post subject: |
|
|
(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
|
Posted: Thu 08 Feb '07 3:01 Post subject: |
|
|
"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
|
Posted: Wed 28 Feb '07 10:43 Post subject: Re: php 5.2 with apachi 2.2.x |
|
|
►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
|
Posted: Thu 27 Dec '07 13:53 Post subject: Re: php 5.2 with apachi 2.2.x |
|
|
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
|
Posted: Thu 03 Jan '08 9:17 Post subject: |
|
|
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
|
Posted: Mon 04 Feb '08 1:55 Post subject: |
|
|
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.
Thank you all. |
|
Back to top |
|