i have download php 5.3.27 windows installer from php.net
then i download apache 2.4.4 windows installer from apache site.
now i have successfuly installed apache 2.4.4. to check this i have writehttp://localhost/ on the address bar and the out put is "its work".
now the step to install php 5.3.27
now i restart my pc.

Dani AI

Generated

On Windows, PHP 5.3.x was only built with an Apache 2.2 module (php5apache2_2.dll). There is no php5apache2_4.dll for PHP 5.3, so Apache 2.4 cannot load PHP 5.3 as an in-process module. That is why Apache fails to start when you try to load it, and why .php files download when no PHP handler is actually active. Your workable choices are: downgrade Apache to 2.2 to use PHP 5.3 as a module, upgrade PHP to a version that ships an Apache 2.4 module (5.4+), or keep Apache 2.4 and run PHP 5.3 via FastCGI. See the official guidance in Using PHP on Windows with Apache.

If you must keep PHP 5.3 with Apache 2.4, configure FastCGI (recommended for this mix). Install mod_fcgid and point it at php-cgi.exe (use the Non Thread Safe PHP build for FastCGI). Example minimal config:

LoadModule fcgid_module modules/mod_fcgid.so
FcgidInitialEnv PHPRC "C:/php"
AddHandler fcgid-script .php
FcgidWrapper "C:/php/php-cgi.exe" .php
<Directory "C:/Apache24/htdocs">
  Options +ExecCGI
  Require all granted
</Directory>

Ensure paths are quoted if they contain spaces, and that Apache and PHP bitness match (both 32-bit or both 64-bit). mod_fcgid docs are here: https://httpd.apache.org/mod_fcgid/.

Recommended Answers

All 4 Replies

create a file named info.php
saved it in location :-

"C:\Program Files\Apache Software Foundation\Apache2.4\htdocs\"
now i call this file bye localhost/info.php :-> output is its asking to save/open the file.
to resolve it i have added following lines at the end of httpd.config

LoadModule php5_module "C:/Program Files/php/php5apache2_4.dll"
LoadFile "C:/php/php5ts.dll"

LoadFile "C:/Program Files/php/php5.dll"

AddHandler application/x-httpd-php .php
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
AddType application/x-httpd-php .php3
<FilesMatch .php$>

>      SetHandler application/x-httpd-php

</FilesMatch>

configure the path to php.ini
PHPIniDir "C:/php"

then restart the pc ,but its give same output.
one more thing i want to say that if i open any lines (mantion above) leaded by #. the apache server will not restart. i want help to resolve this problem. kindly some body help me

the close lines are
LoadModule php5_module "C:/Program Files/php/php5apache2_4.dll"
LoadFile "C:/php/php5ts.dll"
configure the path to php.ini
PHPIniDir "C:/php"

i want help to resolve this problem. kindly some body help me

Stay away from all these troubles.. install an XAMPP or equivalent. 5.3.27 php version is pretty old. Use the latest or at least 5.5.1. The current stable release version as of today is 5.5.3

If you will running an application that is not version 5.5.3 capable, stay with the 5.3.27.

regular MySQL queries are no longer supported in 5.5.3 ., If you run an older script in this environment you will end up getting a mysql support has been deprecated.

PHP 5.5.3 allows you to take your application to the latest advancement in PHP including a much better password hasher.

If you don't like XAMPP there is also a BITNAMI WAMP Stack bundled with phpMyAdmin, SQLite, Varnish, ImageMagick, ModSecurity, XDebug, Xcache, OAuth, Memcache, FastCGI, APC, GD, OpenSSL, CURL, openLDAP, PEAR, PECL, AND most importantly, it comes with Zend Framework, CodeIgniter, Symfony, Laravel, smarty and many others. I am currently using Bitnami Python in parallel with the XAMPP..

I like xampp, because it comes with mercury mail and tomcat for my JAVA servelets projects.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.