Click to See Complete Forum and Search --> : PHP install on APACHE a failure


webcurry2
07-10-2006, 04:32 AM
I've been trying all day to configure PHP with Apache and it's been a nightmare I've tried every suggestion that is out there, including PHP's official manuals, and it's been nothing, but a failure. Hoping someone can help here:

-Running Win2k SP4
-Installed and ran Apache HTTP Server both versions 2.058 & 2.2.2 seprately, they run fine
-Installed PHP 5.1.4 and the fun begins here

I understand PHP 5.1.4 doesn't work with Apache 2.2.2, so I used it with 2.058, same problem.

As per manual by php.net, I added the following to httpd config file:

ScriptAlias /php/ "c:/php/"
AddType application/x-httpd-php .php
Action application/x-httpd-php "/php/php.exe"
Action application/x-httpd-php "/php/php-cgi.exe"


Restared the server, created a file, test.php in htdocs directory where the server is installed, Internet Explorer tells me which program should open the test.php file. Other times I get "page can't be displayed". I have the same problem with both Apache 2.2.2 and 2.058.

I've tried installing PHP both manually and using windows installer, there is something terrible wrong and I can't figure it.

So all in one: Is there any way that PHP 5.1.4 works with Apache? Now, I am forcd to install XAMPP just for testing (which is not secure by the way).

Thanks for your help.

And just now, I got a message from XAMPP told me that mqssl.php couldn't be written as it was installing.

there must be a ghost on my system!

tsinka
07-12-2006, 04:08 PM
Hi,

you mixed up the php directives. Here are the basic steps that should do it.
These steps don't require to copy anything to system32 or to the windows directory. If you already copied some dlls or php.ini to system32 or the windows directory then (re)move them.

Assuming that you installed php to C:\php:

1. Install apache (you already did that)
2. download and extract the php zip package to e.g. C:\php (you already did that)
3. Copy the following files from C:\php to the apache\bin directory:
fdftk.dll,fribidi.dll,gds32.dll,libeay32.dll,libmcrypt.dll,libmhash.dll,
libmysql.dll, msql.dll,ntwdblib.dll,php5ts.dll
4. copy php.ini to the apache\bin directory
5. edit php.ini and change the extension_dir setting to C:\php\ext
6. edit httpd.conf and remove all lines you added to enable php
7. edit httpd.conf and at the end of the LoadModule block add the following line:
LoadModule php5_module "C:\php\php5apache2.dll"
8. add the following line to httpd.conf:
AddType application/x-httpd-php .php
9. restart apache
10. create a file named info.php in the htdocs directory that contains the lines:


<?PHP
phpinfo();
?>


Open the URL http://localhost/info.php in your browser.

To enable the extensions you need (mysql, mysqli ....) just remove the ; in front of the corresponding extension= line in php.ini or add a new extension= line if no such line exists for a given extension. Then restart apache.
Some extensions (like the oracle extension) need additional dlls that don't come with php. I case of e.g. oracle you need to install the oracle client on your server.

If you want to install some pecl extensions then download the pecl collection zip package and extract it to the C:\php\ext directory. Then enable the extensions you need in php.ini.

An alternative is to download and install xampp (http://www.xampp.org).

Thomas