How To Install Php 5.4 With Apache 2.2

Posted By admin On 10.01.20
Mar 17, 2012

LAMP (Linux, Apache, MySQL and PHP ) Stack is the most popular environment in PHP website development and hosting. Linux is the operating system, Apache is the popular web server developed by Apache Foundation.

How install Apache 2.4 PHP 5.4 and MySQL 5.5.21 on Windows 7

  1. Installing Apache 2.4 with PHP 5.4 on CentOS 6.5 June 4, 2014 September 13, 2016 Andrew Letson Uncategorized Recently, we were looking into how to install Apache 2.4 and PHP 5.4 with PHP-FPM on our CentOS boxes, as PHP 5.3 with Apache 2.2 was feeling a bit outdated.
  2. How to install php 5.5 with Apache 2.4 on windows April 9, 2015 September 6, 2015 Rajendra Choudhary 1 Comment in this post i will explain you how to install php 5.5 with Apache 2.4 on windows.
  3. Note: those planning to install PHP 4 on Apache 1.x should read my article How to Install and Configure PHP4 to Run with Apache on Windows instead. Steps to Setting Up PHP 5. If you want to be sure the procedure below will work, just get the latest of the 5.2 series. Install PHP 5.
  4. Step by step tutorial to get PHP 5.3 running with the Apache web server on Windows. The reason why we are download Apache from apachelounge not apache site is because the original Apache binaries.

Recently decided to install a working Apache 2.4 / PHP 5.4.9 and MySQL 5.5 running locally on my Windows 7 laptop for web design, not using XAMPP or WAMP installation methods. Which are great but this round I wanted to match my Linux server.

Apache 2.4 Install

First download Apache 2.4 from http://www.apachelounge.com/download/ (httpd-2.4.1-win32.zip) Apache 2.4.1
with IPv6 apr-1.4.6 apr-util-1.4.1 apr-iconv-1.2.1 pcre-8.21 lua-5.1 libxml2-2.7.8 openssl-1.0.0g zlib-1.2.6. This release is supported by the PHP 5.4 install from windows.php.net for Apache 2.4.

Extract the zip and copy it to the root of C:. This will be C:Apache24 when it is all done.

Update 01-17-2013: The version of the php5apache2_4.dll must match the version of PHP you are installing. The link that was reference before has been changed and moved to http://www.apachelounge.com/download/additional/ for versions 5.4.9 and earlier. As of PHP 5.4.10 the module is now included in the Windows build.

PHP 5.4.9 and Earlier

Download PHP 5.4.9 VC9 x86 Thread Safe from http://windows.php.net/download/releases/archives/php-5.4.9-Win32-VC9-x86.zip . Extract and rename folder to php and move to C:
Also, download php5apache2_4.dll-php-5.4-win32.zip (http://www.apachelounge.com/download/win32/modules-2.4/php5apache2_4.dll-php-5.4-win32.zip)
Runs with PHP 5.4 Thread Safe (TS), and only with Apache 2.4 Win32 VC9 or VC10.

PHP 5.4.10 and higher

Download PHP 5.4 VC9 x86 Thread Safe from http://windows.php.net/download/ . Extract and rename folder to php and move to C:.

Update 01-17-2013: This next edit seems to cause issues with php5apache2_4.dll not found errors, so I have added two options for PHP 5.4.9 and earlier and PHP 5.4.10 and above. I want to thank all those who have brought this to my attention and I hope this helps out. Also, due to the addition of the php5apache2_4.dll being included in PHP 5.4.10 and above builds you no longer need to download the module separately.

PHP 5.4.9 and earlier Option 1

Extract php5apache2_4.dll-php-5.4-win32.zip and copy php5apache2_4.dll to the c:php directory. This is needed to allow Apache to use PHP. Edit Apache’s config file, c:Apache24confhttpd.conf and add the following lines to the bottom of the file.

2
AddHandler application/x-httpd-php.php
2
PHPIniDir'C:/php'

While we are at it we can add index.php to Apache’s list just incase we want to have a starting page as php.

Find Directory index and add index.php

Next we need to input a value for ServerName variable. You will have to un-comment it. Save the changes to the config file. Next move to the Register Apache Service step.

PHP 5.4.9 and earlier Option 2

Extract php5apache2_4.dll-php-5.4-win32.zip and copy php5apache2_4.dll to the c:phpext directory. This is needed to allow Apache to use PHP. Edit Apache’s config file, c:Apache24confhttpd.conf and add the following lines to the bottom of the file.

2
LoadModule php5_module'c:/php/ext/php5apache2_4.dll'

How To Install Php 5.4

2
PHPIniDir'C:/php'

While we are at it we can add index.php to Apache’s list just incase we want to have a starting page as php.

Find Directory index and add index.php

Next we need to input a value for ServerName variable. You will have to un-comment it. Save the changes to the config file. Next move to the Register Apache Service step.

How To Install Php 5.4 On Centos

PHP 5.4.10 and newer

Edit Apache’s config file, c:Apache24confhttpd.conf and add the following lines to the bottom of the file.

2
AddHandler application/x-httpd-php.php
2
PHPIniDir'C:/php'

While we are at it we can add index.php to Apache’s list just incase we want to have a starting page as php.

Find Directory index and add index.php

Next we need to input a value for ServerName variable. You will have to un-comment it. Save the changes to the config file. Next move to the Register Apache Service step.

Register Apache Service

Now let’s register Apache as a service. Open a command prompt and type.

If do not want Apache starting automatically at start-up/reboot:

GUI Way

  • START RUN
  • Type in services.msc, hit Enter or click OK
  • Locate Apache2 service and double-click (or right-click for Properties)
  • Find the caption Startup type: (in the middle of the dialog box), use the pull-down and select Manual
  • Click OK

Command line

Add

to PATH in Environment variables. PATH ENVIRONMENT (System Properties Advanced Environment Variables System variables Path).
Example:
;c:php;c:apache24;c:apache24bin;

Now lets check Apache settings by issuing the command, c:Apache24binhttpd -S

PHP Edits

Now we have to do a few edits to the php.ini file to tell it to load support for mysql and the location for the extensions. Since there is not a already set php.ini file we need to rename one of the two examples to php.ini.

Rename c:phpphp.ini-development to php.ini

Now let’s edit php.ini
Uncomment extension directory.

2
4
6
8
;Directory inwhich the loadable extensions(modules)reside.
;extension_dir='./'
extension_dir='ext'
Uncomment mysql modules
extension=php_mysqli.dll

Save the changes and open a command prompt. Check to make sure it shows loaded modules.

So now we have Apache running and configured to use php. Lets create a file called info.php, save it and see if Apache parses the info correctly to display the results.

Open Notepad or your favorite Windows editor and type and save the following.

2
phpinfo();

Open your browser and type, localhost/info.php for the location and you should receive alot of information about PHP.

MySQL
Download and install mysql-5.5.21-win64.msi. Change installation directory to C:MySQLMySQL Server 5.5 instead of Program files as there could be permissions issues. Once the installation is completed you can let the configuration wizard run and setup the database server. The defaults will work just fine, but remember what you set the password to for root.

PHPMyAdmin
PHPMyAdmin is a very nice tool to use for administering your MySQL installation.
Download and install phpmyadmin-3.4.10.1-english.zip.
Extract the file and move to c:apache24htdocs. Rename directory to phpmyadmin.
Create a config directory under phpmyadmin. Open a browser and type localhost/phpmyadmin/setup/index.php to complete the installation.

At this point you should have a working Apache / PHP / MySQL installation running and ready for you to start developing !!!

Related Posts

  1. You misstated, php5apache2_4.dll should be extracted to c:php

    • Why do you think I’m wrong? Just because it has fliead on your system doesn’t make me wrong. I test things carefully before putting them on my website or in my books, and I have been running PHP 5.2.0 with Apache 2.2.3 successfully for several months.I have no idea what you have done wrong, but suggest that you start again and use the . Before using it, you need to clean up your system by uninstalling Apache and removing the conf folder before reinstalling. Also remove PHP from the Windows path, and make sure that you don’t have a copy of php.ini in the WINDOWS folder.

  2. I can’t find the archive with php5apache2_4.dll as it isn’t available at the link you provided.

    I’m gonna leave out the parts with that .dll and see if that works…

    • php5apache2_4.dll is right there on the download page. You’ll need it
      http://www.apachelounge.com/download/

      • Thank u David, I’ve been solved the lbropem. I have to use the Windows Installer for PHP 5.2.0, I just leave the Apache 2.2.3 and reinstall PHP. But I don’t understand, ’cause I had (previously) Apache 1.5.x or 2.2.0 (i can’t remember well!) and PHP 5.2.0 and I don’t use the Windows Installer for PHP, just extract the files of PHP and configure my Apache and it’s done, but now not, anyway, thank u so much for the help, and I sorry (dumb, I don’t check it the Windows Installer, anyway!!)

      • Having a hellish time with Apache 2.2.3 and PHP 5.2I can load ertnyehivg on my machine, have tried with both the info from Dreamweaver 8 and PHP making the changes to the dll file for apache2_2. I have taken ertnyehivg off and put them on several times but can not get the PHP file to read from the localhost. ( when I call the PHP info file it loads up into dreamweaver instead of opening HELP!)

    • Yes, the Windows version of PHP 5.2.0 has srppout for all three series of Apache: 1.3, 2.0, and 2.2. The difference lies in the DLL file used by PHP to communicate with Apache.Apache 1.3 uses php5apache.dll.Apache 2.0 uses php5apache2.dll.Apache 2.2 uses php5apache2_2.dll. I mean, I have Apache 2.2.3 & PHP 5.2.0 and i’ve configured Apache and changed the line LoadModule php5module C:/PHP_HOME/php5apache2_2.dll, and still have nothing, just the message (in the Apache Monitor) The requested operation has failed! . I don’t know what I’m doing wrong, someone can help me please??? Leave here my e-mail:

    • David-I have cleaned both Apache2.23 and PHP5.2 off my ssetym several times. I have reloaded everthing using the new windows installer. Checked and double checked every line of code that I have put into my conf file APACHE starts on the machine, but when I try my test.php file ( the one that is supposted to give me back the PHP page) all’s I get is it oading up in Dreamweaver and not opening. I don’t have any idea where to go to problemsolve this issue .and want to work with your book.thanks .

    • Heck of a job there, it abostulely helps me out.

    • This has made my day. I wish all psotings were this good.

    • I thought it was not there either. The link in the article goes to the PHP download site, not the apache lounge download site.

  3. Dzyu, the file can also be found on Apache Lounge’s download page;
    http://www.apachelounge.com/download/

    • If you read my original taricle and reply carefully, you will see that I always refer to the Windows version of PHP 5.2.0. php-5.2.0.tar.bz2 contains the uncompiled PHP source code. If you are installing PHP on Windows, you need to download the Windows binaries for PHP 5.2.0. There are two versions: a zip file, and the Windows installer. Instructions for using the zip file are in my books. Instructions for using the Windows installer are in .

  4. Thanks for the article. Although I installed Apache+PHP+MySQL a couple of times and although I’ve written a similar tutorial like this, I got stuck the last time I tried installing the latest versions.

  5. I pasted the php5apache2_4.dll file into the specified directory.

    The last few lines of my httpd.conf file looks like this

    SSLRandomSeed startup builtin
    SSLRandomSeed connect builtin

    LoadModule php5_module “c:/php/ext/php5apache2_4.dll”
    AddHandler application/x-httpd-php .php

    # configure the path to php.ini
    PHPIniDir “C:/php”

    after I install the apache service and I enter the command httpd -k install the following message is displayed

    “The Apache2.4 service is successfully installed.
    Testing httpd.conf….
    Errors reported here must be corrected before the service can be started.
    httpd: Syntax error on line 515 of C:/Apache24/conf/httpd.conf: Cannot load C:/php/ext/php5apache2_4.dll into server: The specified module could not be found.”

    Can you tell me how to resolve this error. Thanks!

  6. imho LAMPP > XAMPP > WAMPPand you can just drag and drop static files (that don’t need to be icpmoled up front) into eclipse (or an eclipse project to create symbolic links etc) from the http folder instead of useless tying your http folder (the web server root) to your workspace location (which could often be changed from time to timebest wishes,Jochen

  7. I still got Server Error 500 After activating domule mod_rewrite and change AllowOverride to became All, But after changing AllowOverride AuthConfig to All on file httpd-xampp.conf in directory extra, everything is ok!. tq

  8. Thanks for the article. Although I installed Apache+PHP+MySQL a couple of times and I have followed steps as you told.thanks for share this info with us. Great post!!

  9. This may be a dumb question, but where do I save the info.php file so it runs as a page in localhost? I am not sure if it should go directly in the c: directory or in the c:apache24 folder, or somewhere else. Please help. Thanks.

  10. Thank you for saving my life. i forgot to do these steps

    LoadModule php5_module “c:/php/ext/php5apache2_4.dll”
    AddHandler application/x-httpd-php .php

    # configure the path to php.ini
    PHPIniDir “C:/php”

    thank God for your post. its really helpfull!

  11. I recive this error when i try to get phpinfo() from the browser.

    With that information, setting up the G8 sounded like an easy job: provision it via the existing automation mechanism and be done. Problem At first, everything went smoothly: the server booted from the network, loaded the install files and ran the first phase of the ESXi setup. Esxi 4.1 hp.

    403 Forbbiden. You don’t have permission to access /phpinfo.php on this server.

    I’ve changed the Servername to localhost:80

  12. hello I have a question, when I put in the address bar localhost / info.php to see the php information does not come out this information but I get the code i wrote in the text editor like this:

    What will be the problem?

  13. In the sentence …

    “Also, download php5apache2_4.dll-php-5.4-win32.zip”

    … the embedded link is wrong. Try it yourself and you will see.
    Thank you for posting this information. Helped me a great deal. 🙂

  14. … and the file in my first post is password protected!

    FAIL

  15. I’m getting the error “Could not determine the server’s fully qualified domain name. What should I do? I’m using Windows 7 Professional

  16. I am getting this error:

    C:Apache24 bin>httpd.exe
    httpd.exe: Syntax error on line 179 of C:/Apache24/conf/httpd.conf: Cannot load
    C:/php/ext/php5apache2_4.dll into server: %1 is not a valid Win32 application.

    Any ideas?

  17. Solved!
    In my case it was 64 bit version of Apache with 32 bit version of PHP. Downloaded PHP 64 (http://www.mediafire.com/file/onpvka3h1gymwa6/php-5.4.3-Win32-VC9-x64.zip), now it works like a charm. Btw, php5apache2_4.dll was included in php zip archive. As for the rest, I was just following this article.

    Thanks!

  18. extension_dir = “ext” – don’t work

    extension_dir = “C:/php/ext” – OK

  19. i am having these error on command prompt after i input “C:> php -m”. It says that, c is not recognized as an internal or external command . . . How can i fix this? please help

  20. Thank you so much. now i get it. How bout this localhost/info.php, i cant access to browser? why? im still a beginner here. thanks for the help

  21. Thanks!
    How about this instruction:
    “Open your browser and type, localhost/info.php for the location and you should receive alot of information about PHP”

    what browser does it mean? thanks once again

  22. when i input c:Apache24binhttpd -S in command prompt, it will tell me “the specified module could not be found”. how can i fix this? please help

    • i already done php -m and it displays a lot of modules, yet the php5.dll still could not be found.

  23. i’ve already copied the php5apache2_4.dll to c:phpext directory.
    here the whole code in httpd.conf file.:

    #
    # This is the main Apache HTTP server configuration file. It contains the
    # configuration directives that give the server its instructions.
    # See for detailed information.
    # In particular, see
    #
    # for a discussion of each configuration directive.
    #
    # Do NOT simply read the instructions in here without understanding
    # what they do. They’re here only as hints or reminders. If you are unsure
    # consult the online docs. You have been warned.
    #
    # Configuration and logfile names: If the filenames you specify for many
    # of the server’s control files begin with “/” (or “drive:/” for Win32), the
    # server will use that explicit path. If the filenames do *not* begin
    # with “/”, the value of ServerRoot is prepended — so “logs/access_log”
    # with ServerRoot set to “/usr/local/apache2” will be interpreted by the
    # server as “/usr/local/apache2/logs/access_log”, whereas “/logs/access_log”
    # will be interpreted as ‘/logs/access_log’.
    #
    # NOTE: Where filenames are specified, you must use forward slashes
    # instead of backslashes (e.g., “c:/apache” instead of “c:apache”).
    # If a drive letter is omitted, the drive on which httpd.exe is located
    # will be used by default. It is recommended that you always supply
    # an explicit drive letter in absolute paths to avoid confusion.

    #
    # ServerRoot: The top of the directory tree under which the server’s
    # configuration, error, and log files are kept.
    #
    # Do not add a slash at the end of the directory path. If you point
    # ServerRoot at a non-local disk, be sure to specify a local disk on the
    # Mutex directive, if file-based mutexes are used. If you wish to share the
    # same ServerRoot for multiple httpd daemons, you will need to change at
    # least PidFile.
    #
    ServerRoot “c:/Apache24”

    #
    # Mutex: Allows you to set the mutex mechanism and mutex file directory
    # for individual mutexes, or change the global defaults
    #
    # Uncomment and change the directory if mutexes are file-based and the default
    # mutex file directory is not on a local disk or is not appropriate for some
    # other reason.
    #
    # Mutex default:logs

    #
    # Listen: Allows you to bind Apache to specific IP addresses and/or
    # ports, instead of the default. See also the
    # directive.
    #
    # Change this to Listen on specific IP addresses as shown below to
    # prevent Apache from glomming onto all bound IP addresses.
    #
    #Listen 12.34.56.78:80
    Listen 80

    #
    # Dynamic Shared Object (DSO) Support
    #
    # To be able to use the functionality of a module which was built as a DSO you
    # have to place corresponding LoadModule' lines at this location so the
    # directives contained in it are actually available _before_ they are used.
    # Statically compiled modules (those listed by
    httpd -l’) do not need
    # to be loaded here.
    #
    # Example:
    # LoadModule foo_module modules/mod_foo.so
    #
    LoadModule access_compat_module modules/mod_access_compat.so
    LoadModule actions_module modules/mod_actions.so
    LoadModule alias_module modules/mod_alias.so
    LoadModule allowmethods_module modules/mod_allowmethods.so
    LoadModule asis_module modules/mod_asis.so
    LoadModule auth_basic_module modules/mod_auth_basic.so
    #LoadModule auth_digest_module modules/mod_auth_digest.so
    #LoadModule authn_anon_module modules/mod_authn_anon.so
    LoadModule authn_core_module modules/mod_authn_core.so
    #LoadModule authn_dbd_module modules/mod_authn_dbd.so
    #LoadModule authn_dbm_module modules/mod_authn_dbm.so
    LoadModule authn_file_module modules/mod_authn_file.so
    #LoadModule authn_socache_module modules/mod_authn_socache.so
    #LoadModule authnz_ldap_module modules/mod_authnz_ldap.so
    LoadModule authz_core_module modules/mod_authz_core.so
    #LoadModule authz_dbd_module modules/mod_authz_dbd.so
    #LoadModule authz_dbm_module modules/mod_authz_dbm.so
    LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
    LoadModule authz_host_module modules/mod_authz_host.so
    #LoadModule authz_owner_module modules/mod_authz_owner.so
    LoadModule authz_user_module modules/mod_authz_user.so
    LoadModule autoindex_module modules/mod_autoindex.so
    #LoadModule buffer_module modules/mod_buffer.so
    #LoadModule cache_module modules/mod_cache.so
    #LoadModule cache_disk_module modules/mod_cache_disk.so
    #LoadModule cern_meta_module modules/mod_cern_meta.so
    LoadModule cgi_module modules/mod_cgi.so
    #LoadModule charset_lite_module modules/mod_charset_lite.so
    #LoadModule data_module modules/mod_data.so
    #LoadModule dav_module modules/mod_dav.so
    #LoadModule dav_fs_module modules/mod_dav_fs.so
    #LoadModule dav_lock_module modules/mod_dav_lock.so
    #LoadModule dbd_module modules/mod_dbd.so
    #LoadModule deflate_module modules/mod_deflate.so
    LoadModule dir_module modules/mod_dir.so
    #LoadModule dumpio_module modules/mod_dumpio.so
    LoadModule env_module modules/mod_env.so
    #LoadModule expires_module modules/mod_expires.so
    #LoadModule ext_filter_module modules/mod_ext_filter.so
    #LoadModule file_cache_module modules/mod_file_cache.so
    #LoadModule filter_module modules/mod_filter.so
    #LoadModule headers_module modules/mod_headers.so
    #LoadModule heartbeat_module modules/mod_heartbeat.so
    #LoadModule heartmonitor_module modules/mod_heartmonitor.so
    #LoadModule ident_module modules/mod_ident.so
    #LoadModule imagemap_module modules/mod_imagemap.so
    LoadModule include_module modules/mod_include.so
    #LoadModule info_module modules/mod_info.so
    LoadModule isapi_module modules/mod_isapi.so
    #LoadModule lbmethod_bybusyness_module modules/mod_lbmethod_bybusyness.so
    #LoadModule lbmethod_byrequests_module modules/mod_lbmethod_byrequests.so
    #LoadModule lbmethod_bytraffic_module modules/mod_lbmethod_bytraffic.so
    #LoadModule lbmethod_heartbeat_module modules/mod_lbmethod_heartbeat.so
    #LoadModule ldap_module modules/mod_ldap.so
    #LoadModule logio_module modules/mod_logio.so
    LoadModule log_config_module modules/mod_log_config.so
    #LoadModule log_debug_module modules/mod_log_debug.so
    #LoadModule log_forensic_module modules/mod_log_forensic.so
    #LoadModule lua_module modules/mod_lua.so
    LoadModule mime_module modules/mod_mime.so
    #LoadModule mime_magic_module modules/mod_mime_magic.so
    LoadModule negotiation_module modules/mod_negotiation.so
    #LoadModule proxy_module modules/mod_proxy.so
    #LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
    #LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
    #LoadModule proxy_connect_module modules/mod_proxy_connect.so
    #LoadModule proxy_express_module modules/mod_proxy_express.so
    #LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so
    #LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
    #LoadModule proxy_html_module modules/mod_proxy_html.so
    #LoadModule proxy_http_module modules/mod_proxy_http.so
    #LoadModule proxy_scgi_module modules/mod_proxy_scgi.so
    #LoadModule ratelimit_module modules/mod_ratelimit.so
    #LoadModule reflector_module modules/mod_reflector.so
    #LoadModule remoteip_module modules/mod_remoteip.so
    #LoadModule request_module modules/mod_request.so
    #LoadModule reqtimeout_module modules/mod_reqtimeout.so
    #LoadModule rewrite_module modules/mod_rewrite.so
    #LoadModule sed_module modules/mod_sed.so
    #LoadModule session_module modules/mod_session.so
    #LoadModule session_cookie_module modules/mod_session_cookie.so
    #LoadModule session_crypto_module modules/mod_session_crypto.so
    #LoadModule session_dbd_module modules/mod_session_dbd.so
    LoadModule setenvif_module modules/mod_setenvif.so
    #LoadModule slotmem_plain_module modules/mod_slotmem_plain.so
    #LoadModule slotmem_shm_module modules/mod_slotmem_shm.so
    #LoadModule socache_dbm_module modules/mod_socache_dbm.so
    #LoadModule socache_memcache_module modules/mod_socache_memcache.so
    #LoadModule socache_shmcb_module modules/mod_socache_shmcb.so
    #LoadModule speling_module modules/mod_speling.so
    #LoadModule ssl_module modules/mod_ssl.so
    #LoadModule status_module modules/mod_status.so
    #LoadModule substitute_module modules/mod_substitute.so
    #LoadModule unique_id_module modules/mod_unique_id.so
    #LoadModule userdir_module modules/mod_userdir.so
    #LoadModule usertrack_module modules/mod_usertrack.so
    #LoadModule version_module modules/mod_version.so
    #LoadModule vhost_alias_module modules/mod_vhost_alias.so
    #LoadModule watchdog_module modules/mod_watchdog.so
    #LoadModule xml2enc_module modules/mod_xml2enc.so

    #
    # If you wish httpd to run as a different user or group, you must run
    # httpd as root initially and it will switch.
    #
    # User/Group: The name (or #number) of the user/group to run httpd as.
    # It is usually good practice to create a dedicated user and group for
    # running httpd, as with most system services.
    #
    User daemon
    Group daemon

    # ‘Main’ server configuration
    #
    # The directives in this section set up the values used by the ‘main’
    # server, which responds to any requests that aren’t handled by a
    # definition. These values also provide defaults for
    # any containers you may define later in the file.
    #
    # All of these directives may appear inside containers,
    # in which case these default settings will be overridden for the
    # virtual host being defined.
    #

    #
    # ServerAdmin: Your address, where problems with the server should be
    # e-mailed. This address appears on some server-generated pages, such
    # as error documents. e.g. admin@your-domain.com
    #
    ServerAdmin admin@example.com

    #
    # ServerName gives the name and port that the server uses to identify itself.
    # This can often be determined automatically, but we recommend you specify
    # it explicitly to prevent problems during startup.
    #
    # If your host doesn’t have a registered DNS name, enter its IP address here.
    #
    ServerName http://www.example.com:80

    #
    # Deny access to the entirety of your server’s filesystem. You must
    # explicitly permit access to web content directories in other
    # blocks below.
    #

    AllowOverride none
    Require all denied

    #
    # Note that from this point forward you must specifically allow
    # particular features to be enabled – so if something’s not working as
    # you might expect, make sure that you have specifically enabled it
    # below.
    #

    #
    # DocumentRoot: The directory out of which you will serve your
    # documents. By default, all requests are taken from this directory, but
    # symbolic links and aliases may be used to point to other locations.
    #
    DocumentRoot “c:/Apache24/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.4/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.
    #
    Require all granted

    #
    # DirectoryIndex: sets the file that Apache will serve if a directory
    # is requested.
    #

    DirectoryIndex index.html index.php

    #
    # The following lines prevent .htaccess and .htpasswd files from being
    # viewed by Web clients.
    #

    Require all denied

    #
    # ErrorLog: The location of the error log file.
    # If you do not specify an ErrorLog directive within a
    # container, error messages relating to that virtual host will be
    # logged here. If you *do* define an error logfile for a
    # container, that host’s errors will be logged there and not here.
    #
    ErrorLog “logs/error.log”

    #
    # LogLevel: Control the number of messages logged to the error_log.
    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    #
    LogLevel warn

    #
    # The following directives define some format nicknames for use with
    # a CustomLog directive (see below).
    #
    LogFormat “%h %l %u %t ”%r” %>s %b ”%{Referer}i” ”%{User-Agent}i”” combined
    LogFormat “%h %l %u %t ”%r” %>s %b” common

    # You need to enable mod_logio.c to use %I and %O
    LogFormat “%h %l %u %t ”%r” %>s %b ”%{Referer}i” ”%{User-Agent}i” %I %O” combinedio

    #
    # The location and format of the access logfile (Common Logfile Format).
    # If you do not define any access logfiles within a
    # container, they will be logged here. Contrariwise, if you *do*
    # define per- access logfiles, transactions will be
    # logged therein and *not* in this file.
    #
    CustomLog “logs/access.log” common

    #
    # If you prefer a logfile with access, agent, and referer information
    # (Combined Logfile Format) you can use the following directive.
    #
    #CustomLog “logs/access.log” combined

    #
    # Redirect: Allows you to tell clients about documents that used to
    # exist in your server’s namespace, but do not anymore. The client
    # will make a new request for the document at its new location.
    # Example:
    # Redirect permanent /foo http://www.example.com/bar

    #
    # Alias: Maps web paths into filesystem paths and is used to
    # access content that does not live under the DocumentRoot.
    # Example:
    # Alias /webpath /full/filesystem/path
    #
    # If you include a trailing / on /webpath then the server will
    # require it to be present in the URL. You will also likely
    # need to provide a section to allow access to
    # the filesystem path.

    #
    # ScriptAlias: This controls which directories contain server scripts.
    # ScriptAliases are essentially the same as Aliases, except that
    # documents in the target directory are treated as applications and
    # run by the server when requested rather than as documents sent to the
    # client. The same rules about trailing “/” apply to ScriptAlias
    # directives as to Alias.
    #
    ScriptAlias /cgi-bin/ “c:/Apache24/cgi-bin/”

    #
    # ScriptSock: On threaded servers, designate the path to the UNIX
    # socket used to communicate with the CGI daemon of mod_cgid.
    #
    #Scriptsock cgisock

    #
    # “c:/Apache24/cgi-bin” should be changed to whatever your ScriptAliased
    # CGI directory exists, if you have that configured.
    #

    AllowOverride None
    Options None
    Require all granted

    #
    # TypesConfig points to the file containing the list of mappings from
    # filename extension to MIME-type.
    #
    TypesConfig conf/mime.types

    #
    # AddType allows you to add to or override the MIME configuration
    # file specified in TypesConfig for specific file types.
    #
    #AddType application/x-gzip .tgz
    #
    # AddEncoding allows you to have certain browsers uncompress
    # information on the fly. Note: Not all browsers support this.
    #
    #AddEncoding x-compress .Z
    #AddEncoding x-gzip .gz .tgz
    #
    # If the AddEncoding directives above are commented-out, then you
    # probably should define those extensions to indicate media types:
    #
    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz

    #
    # AddHandler allows you to map certain file extensions to “handlers”:
    # actions unrelated to filetype. These can be either built into the server
    # or added with the Action directive (see below)
    #
    # To use CGI scripts outside of ScriptAliased directories:
    # (You will also need to add “ExecCGI” to the “Options” directive.)
    #
    #AddHandler cgi-script .cgi

    # For type maps (negotiated resources):
    #AddHandler type-map var

    #
    # Filters allow you to process content before it is sent to the client.
    #
    # To parse .shtml files for server-side includes (SSI):
    # (You will also need to add “Includes” to the “Options” directive.)
    #
    #AddType text/html .shtml
    #AddOutputFilter INCLUDES .shtml

    #
    # The mod_mime_magic module allows the server to use various hints from the
    # contents of the file itself to determine its type. The MIMEMagicFile
    # directive tells the module where the hint definitions are located.
    #
    #MIMEMagicFile conf/magic

    #
    # Customizable error responses come in three flavors:
    # 1) plain text 2) local redirects 3) external redirects
    #
    # Some examples:
    #ErrorDocument 500 “The server made a boo boo.”
    #ErrorDocument 404 /missing.html
    #ErrorDocument 404 “/cgi-bin/missing_handler.pl”
    #ErrorDocument 402 http://www.example.com/subscription_info.html
    #

    #
    # MaxRanges: Maximum number of Ranges in a request before
    # returning the entire resource, or one of the special
    # values ‘default’, ‘none’ or ‘unlimited’.
    # Default setting is to accept 200 Ranges.
    #MaxRanges unlimited

    #
    # EnableMMAP and EnableSendfile: On systems that support it,
    # memory-mapping or the sendfile syscall may be used to deliver
    # files. This usually improves server performance, but must
    # be turned off when serving from networked-mounted
    # filesystems or if support for these functions is otherwise
    # broken on your system.
    # Defaults: EnableMMAP On, EnableSendfile Off
    #
    #EnableMMAP off
    #EnableSendfile on

    # Supplemental configuration
    #
    # The configuration files in the conf/extra/ directory can be
    # included to add extra features or to modify the default configuration of
    # the server, or you may simply copy their contents here and change as
    # necessary.

    # Server-pool management (MPM specific)
    #Include conf/extra/httpd-mpm.conf

    # Multi-language error messages
    #Include conf/extra/httpd-multilang-errordoc.conf

    # Fancy directory listings
    #Include conf/extra/httpd-autoindex.conf

    # Language settings
    #Include conf/extra/httpd-languages.conf

    # User home directories
    #Include conf/extra/httpd-userdir.conf

    # Real-time info on requests and configuration
    #Include conf/extra/httpd-info.conf

    # Virtual hosts
    #Include conf/extra/httpd-vhosts.conf

    # Local access to the Apache HTTP Server Manual
    #Include conf/extra/httpd-manual.conf

    # Distributed authoring and versioning (WebDAV)
    #Include conf/extra/httpd-dav.conf

    # Various default settings
    #Include conf/extra/httpd-default.conf

    # Configure mod_proxy_html to understand HTML4/XHTML1

    Include conf/extra/proxy-html.conf

    # Secure (SSL/TLS) connections
    #Include conf/extra/httpd-ssl.conf
    #
    # Note: The following must must be present to support
    # starting without SSL on platforms with no /dev/random equivalent
    # but a statically compiled-in mod_ssl.
    #

    SSLRandomSeed startup builtin
    SSLRandomSeed connect builtin

    # Deal with user agents that deliberately violate open standards
    #

    BrowserMatch “MSIE 10.0;” bad_DNT

    RequestHeader unset DNT env=bad_DNT

    LoadModule php5_module “c:/php/ext/php5apache2_4.dll”
    AddHandler application/x-httpd-php .php

    # configure the path to php.ini
    PHPIniDir “C:/php”

  24. Hi there. I have followed your brilliant instructions 100% to the letter, I know I have but I constantly get this error:

    httpd: Syntax error on line 172 of C:/apache24/conf/httpd.conf: Cannot load C:/P
    HP/php5apache2_2.dll into server: The specified procedure could not be found.

    C:apache24bin>httpd -S
    httpd: Syntax error on line 172 of C:/apache24/conf/httpd.conf: Cannot load C:/P
    HP/php5apache2_4.dll into server: The specified procedure could not be found.

    C:apache24bin>httpd -k start
    httpd: Syntax error on line 172 of C:/apache24/conf/httpd.conf: Cannot load C:/P
    HP/php5apache2_4.dll into server: The specified procedure could not be found.

    C:apache24bin>httpd -S
    httpd: Syntax error on line 172 of C:/apache24/conf/httpd.conf: Cannot load C:/P
    HP/ext/php5apache2_4.dll into server: The specified procedure could not be found
    .

    C:apache24bin>httpd -S
    httpd: Syntax error on line 172 of C:/apache24/conf/httpd.conf: Cannot load C:/P
    HP/ext/php5apache2_4.dll into server: The specified procedure could not be found
    .

    C:apache24bin>httpd -k start
    httpd: Syntax error on line 172 of C:/apache24/conf/httpd.conf: Cannot load C:/P
    HP/ext/php5apache2_4.dll into server: The specified procedure could not be found
    .

    C:apache24bin>httpd -S
    httpd: Syntax error on line 172 of C:/apache24/conf/httpd.conf: Cannot load C:/p
    hp/ext/php5apache2_4.dll into server: The specified procedure could not be found
    .

    C:apache24bin>httpd -S
    httpd: Syntax error on line 172 of C:/apache24/conf/httpd.conf: Cannot load C:/p
    hp/ext/php5apache2_4.dll into server: The specified procedure could not be found
    .

    I just can’t get it to work.

    Windows Vista 32

  25. Not sure whether this will ever help anyone, I had to go back to Apache 2.2 eventually not going to bother with 2.4 at the moment.

    To get Apache working without errors (PHP too) I had to stop the MSSQL reporting service on the server I’m using for testing.

    Once I had done that, apache stopped bitching, I re-installed PHP and everything works.

    Thanks for all your help. I will try your great article again soon with 2_4.

    • I had the same problem. Looks like there is a problem with php dll, because if you read the error message more carefully it tells that “the specified module could not be found” (not the file but *module*), which is php5_module. I installed earlier version of php 2.4.0 with php5apache2_4.dll for that version and it solved the problem.

      Also, there is an error in the test php file. It should look like:

      Not with ‘$’ on the last line.

  26. think you

  27. Thanks man, your article was helpful.

    • The Apache service named reported the following error:
      >>> httpd.exe: Syntax error on line 526 of C:/Apache24/conf/httpd.conf: Cannot load c:/php/ext/php5apache2_2.dll into server: The specified module could not be found. any help would be appreciated

      • or The Apache service named reported the following error:
        >>> httpd.exe: Syntax error on line 526 of C:/Apache24/conf/httpd.conf: Cannot load c:/php/ext/php5apache2_4.dll into server: The specified procedure could not be found.

  28. Thanks, worked very well for me.

  29. Thanks for your valuable suggestions. I am trying to doing the same for windows 7 64 bit. Will this procedure work for 64 bit version also?
    thanks in advance

  30. Thank you.tried it and its working thanks a lot.

  31. reported the following error

    C:UsersLARM>c:Apache24binhttpd -S
    httpd: Syntax error on line 525 of C:/Apache24/conf/httpd.conf: Cannot load c:/php/php5apache2_4.dll into server: No se puede encontrar el mxf3dulo especificado.

  32. i am not able to load the mysql .libmysql.dll is not there.how to find it and install it

  33. Wondering if anyone can help me with the same problem reported here 1000 times. I’ve read all the comments, but I’m still stuck, somehow. It starts with the error, on Windows 7:

    [C:Apache24bin]httpd -k start
    httpd: Syntax error on line 525 of C:/Apache24/conf/httpd.conf: Cannot load c:/php/php5apache2_4.dll into server: The specified procedure could not be found.

    The files I’ve downloaded are:
    php-5.4.9-Win32-VC9-x86.zip
    httpd-2.4.3-win32.zip
    php5apache2_4.dll-php-5.2-win32.zip

    I have VC10 redist installed.

    PHP installed fine, and lives in c:php. In the c:php folder I have:
    12/10/2012 10:51 26,624 php5apache2_2.dll
    12/10/2012 10:51 26,112 php5apache2_3.dll
    12/10/2012 11:18 25,600 php5apache2_4.dll

    And my addition to the httpd.conf file reads as follows:

    LoadModule php5_module “c:/php/php5apache2_4.dll”
    AddHandler application/x-httpd-php .php
    PHPIniDir “C:/php”

    What have I missed?

    Thanks in advance,
    Dave

  34. I’m wondering … is it significant that some people report the error as “the specified module” and some (like me) as “the specified procedure?” Perhaps there are really two issues that have a very similar error message? I would expect a path problem to produce an error about a “module” and a component version problem to produce an error about a “procedure.” Maybe?

  35. Hello Sir.
    there is a problem while im testing the info.php.My browser showing a blank page.pliz help me sir.
    thank u

  36. thanx sir.i hv done it.:)
    Sir wht is the difference b/w PHP 5.4 VC9 x86 Thread Safe and PHP 5.4 VC9 x86 Thread un Safe.

  37. I’m getting this error when i run it:

    Errors reported here must be corrected before the service can be started.
    httpd: Syntax error on line 525 of C:/Apache24/conf/httpd.conf: Cannot load c:/php/ext/php5apache2_4.dll into server: The specified module could not be found.

    But I know for sure c:/php/ext/php5apache2_4.dll is there:
    C:phpext>dir php5*
    Volume in drive C has no label.
    Volume Serial Number is 4258-A68C

    Directory of C:phpext

    11/29/2012 05:16 AM 25,088 php5apache2_4.dll

    What do I need to do to fix this. Please help.

  38. “Open a command prompt and type.
    c:apache24binhttpd -k install”

    Sorry, you are missing exe. So it should be “c:apache24binhttpd.exe -k install”.

    This is very crucial for beginners.

  39. When i execute php -m i still get nothing. Confused and lost.

  40. Good article, I always looks for quick guides when installing Apache/PHP as there’s always a little part I’ll forget. Just one thing though:

    I found that sticking the ‘php5apache2_4.dll’ in the ext directory didn’t work. However placing it in the root PHP folder did. Not sure whether it’s just a localised case or whether you want to consider updating the original article.

  41. This guide helped me so much! I have been trying to get phpMyAdmin, Apache, PHP and MySQL installed on my laptop for so long but there were so many guides that didnt tell me how to. First time I find this…and it works! Thankyou so much!

  42. i m using the same config but when i run php code and use ‘n’ newline char then in the browser its result is not shown. how to correct this.which php setting has to be change. magic or what and how?

  43. if i type php -m in the command prompt the mysql and mysqli extensions are listed but i get an error message when trying to use them in my scripts

  44. they are as you have written

  45. this is the mysql_connect.php code

    can’t access phpmyadmin as well. it’s saying the mysqli extension is missing

  46. problem solved. had to change extension_dir = “ext” to extension_dir = “C:/php/ext”

  47. I’ve installed everything as mention here.

    PHP is working, but includes not…

    I’ve the following line on index.php on root:

    include (“/includes/all_includes.inc.php”);

    Inside that PHP have:

    $includes_path= “”;

    echo(“Base_Path: ” . $includes_path);

    include ($includes_path . “settings.inc.php”);
    include ($includes_path . “database.inc.php”);

    However, keep having the error that the class is not available.

    Have this tested and working on Apache 2.2.3 on CentOS Linux and it is working properly…

    Path is already configured on System Variables…

  48. I’ve installed everything as mention here.

    PHP is working, but includes not…

    I’ve the following line on index.php on root:

    include (“/includes/all_includes.inc.php”);

    Inside that PHP have:

    $includes_path= “”;

    echo(“Base_Path: ” . $includes_path);

    include ($includes_path . “settings.inc.php”);
    include ($includes_path . “database.inc.php”);

    However, keep having the error that the class is not available.

    Have this tested and working on Apache 2.2.3 on CentOS Linux and it is working properly…

    Path is already configured on System Variables…

  49. Manage to solve it…

    It happens that I forgot to change this:

    short_open_tag = Off

    to this:

    short_open_tag = On

    Felling a little bit dumb now…

  50. I followed your instructions and it worked flawlessly.
    Thank you for your contribution. This is a well written article.

  51. thanks, this tutorial is very helpful…

    one question:
    can’t seem to be able to enable vhost on apache2.4.3, anyone know how?

  52. Hey, there is a little error in your guide:
    You mention that php5apache2_4.dll is included in php5.4.10 and higher, but atleast in the currently available version 5.4.14 this is not the case. There is only a php5.dll and it doesn’t work with it, i get this error when trying to install:
    httpd: Syntax error on line 526 of C:/Apache24/conf/httpd.conf: Can’t locate API module structure `php5_module’ in file C:/Apache24/php/php5.dll: No error
    (I moved the php folder inside the Apache24 folder to have it one place, but that shouldn’t be a problem)

  53. I tried to test php -m and got the error ‘php’ is not recognized as an internal or external command. Any ideas why?
    Thanks

  54. do you know how to use MariaDB for php5? thank you

  55. How do I do an upgrade of PHP or apache without changing the config file everytime?

  56. What is the password of the file php5apache2_4.dll-php-5.4-win32.zip? I can’t put the file in PHP folder because this.

  57. Can you tell how to configure Apache Tomcat on Windows? Right now, I’m relying on NetBeans but I want to know how to use it standalone

  58. Hi I followed along but when I did httpd -S I get “Syntax error on line 528……%1 is not a valid Win32 application”

    I went back through and checked everything against each instruction and it all looks the same.

    Any ideas or insight you could provide would be very much appreciated.

  59. newlife007 This is from line 525 to the end of the file, wasn’t sure if a previous line had an error or not:

    #RequestHeader unset DNT env=bad_DNT
    #

    LoadModule php5_module “c:/opt/local/php/php5apache2_4.dll”
    AddHandler application/x-httpd-php .php
    PHPIniDir “C:/opt/local/php”

    I changed the environment variable as noted in your post also. So I’m kind of at a loss of what the culprit could be.

  60. Will re-download each piece and be aware of those minute details, it’s those little things that always getcha. Thanks again newlife007!

  61. Yup did a complete uninstall of everything and redownloaded fresh copies of each file and now works smoothly.

    Thank you again for your help!

  62. Hi, I followed all the steps and they work except the last one. I downloaded and saved the phpmyadmin folder as you have directed. but what changes do I need to make in config directory? when I try to access phpmyadmin it gives me internal server error. What should I do to get it working?

    • I had to uncomment extension=php_mbstring.dll in the php.ini file and then restart the apache server. Once I did this I could access the phpMyAdmin page from http://localhost/phpmyadmin/index.php.

      • I having the same issue with phpmyadmin. When I type in the url http://localhost/phpmyadmin/index.php it gives me an error saying the mbstring extension is missing. Please check your php configuration.

        I tried all the above fixes. Uncommented extension_dir = “ext” and the other comments mentioned above as well. Also, added the paths to the environmental variables, but still having issues.

    • Yes I had.
      I ‘m running into a new issue. I’m trying to setup all on a VDI. so I had to make apache listen to 8080 instead of 80. so when I typle localhost:8080 i get to the page ‘It works!’ but when I try localhost:8080/info.php I get a 404 error. “The requested URL /info.php was not found on this server.”
      and getting the same error for phpmyadmin. (irrespective of absolute or relative path for ‘ext’.)

  63. So would you do it again? Or would you stick with installing wamp/xampp?

  64. I found the same file but not including the password at keygenpen.

  65. Thank you!! Your instructions were excellent and saved me hours of confusion. Thanks again.

  66. When I start httpd.exe command as per the instructions written in Read me file. I encountered following error. Could you please point out why i did receive such error. I Means what more work to be do now.

    httpd.exe: Syntax error on line 72 of C:/Apache24/conf/httpd.conf: Cannot load modules/mod_access_compat.so into server: The specified module could not be found.

  67. Excellent article, many thanks 🙂

  68. Hi Sir, I have a question because I followed the steps above but when I tried to register the Apache Service in the command line it shows this error “The program can’t start because MSCVR110.dll is missing in your computer. Try reinstalling the program to fix the problem”

    Please help. Thank you. More power.

    • That is part of Microsoft’s Visual C++ 2012 Redist. Make sure you have that installed first. http://www.microsoft.com/en-us/download/details.aspx?id=30679

  69. What are the instructions to install these on a VDI? I am trying to install one and I have to make the server listen to 8080. Also info.php can’t be found on localhost:8080/info.php.

  70. I was looking for options without WAMP and stumbled upon this. Worked great for me… thanks much

  71. Hi I have installed Apache 2.4.6 , PHP 5.5.3 and MYSQL Server 5.6 on a Windows7 machine.
    I’m running into a new issue , I can’t upload any files on the site. I can’t run cron. And also I can’t reference any child nodes while creating a page.

    Can you tell me what could be an issue?

  72. Thanks much!

  73. Thanks. Let me try it and update you.

  74. it works! thank you dude!

    i wrote this into my blog!

  75. first of all thanx for this easiest tutorial.
    i hv installed php 5.4.9 with apache 2.4. everything is working but when i enter in cmd prompt

    C:>apache24binhttpd -k start

    it shows

    only one usage of each socket address is normally permitted. : AH00072: make_sock: could not bind to address [::]:80
    only one usage of each socket address is normally permitted. : AH00072: make_sock: could not bind to address 0.0.0.0:80
    AH00451: no listening sockets available, shutting down
    AH00015: unable to open log.

    this is what i am not getting.

    plz suggest some solution….

    thanx

  76. Excellent article! We are linking to this particularly great content
    on our website. Keep up the great writing.

  77. You have a nice site, lot of work, so am a little reticent to ask this but….

    Could you put a page somewhere where you listed the OS and the current apps & links

    ie… Check if php suexec installed.

    Windows 7 32 bit
    Apache xxxxx http
    PHP xxxxx http
    Mysql xxxx http

    any special instructions ….

    Windows 7 64 bit .

  78. I’ve followed these instructions on a new windows 8.1 machine. I’ve downloaded the current VC11 versions of php and apache and whilst apache runs successfully as soon as I try to link in php I get the error message “The requested operation has failed”. I’ve tried commenting everything else out just leaving the

    ‘LoadModule php5_module “c:/php/php5apache2_4.dll”‘

    line in with the same result.

    Any ideas?

  79. Thanks NewLife007,

    No I didn’t have the single quotes around the line in question but had omitted to add c:php to the path variable. That added I’m afraid that I’m still getting the same message.

    • I read that this error is possibly due to an interaction with an old anti-virus software package that had been uninstalled but fragment left behind. I had uninstalled Norton Internet Security and installed the free version of AVG so I went back to my fresh install with Norton but I’m still getting the same message – sadly a waste of time

  80. Question, I have read your post and it is very descriptive so thanks for putting in all the work. My question is once it is all up and running how hard is it to do the installation of udpates to all 3 modules? Since Apache, PHP, and MySQL don’t necessarily synch there security patches or updates would you just need to keep a test environment to see if anything breaks?

  81. Hello, this looks like exactly what I was looking for. But this was written in 2012, but it looks like through the comments it h as been updated for 2014. So I am wondering do your instructions apply for 2014?

    I want to install Apache, PHP and MYSQL Server. I know I could just install WAMP or XAMP, but I am wanting to install them individulay so I can starting learning how all of this works together for programming and database administration.

    BTW, thanks for this posting.

  82. I’ve win8.1 64bit. I’ve followed the instructions and downloaded the latest 64bit apache 2.4.9-win64-VC11. Having edited the conf file and opened a cmd window with administrator rights I’ve tried to install the service. The service installed but failed to run with the error

    Cannot load c:/php/php5apache2_4.dll into server: %1 is not a valid Win32 application

    The PHP installation is php-5.5.13-Win32-VC11-x86

    the php dll referenced is present.
    Any ideas please?

  83. path had already been updated since I’ve been round the loop already … path reads:

    Microsoft Windows [Version 6.3.9600]
    (c) 2013 Microsoft Corporation. All rights reserved.

    C:Usersuser>path
    PATH=C:Program Files (x86)AMD APPbinx86_64;C:Program Files (x86)AMD APPbi
    nx86;C:Program Files (x86)PC Connectivity Solution;C:WINDOWSsystem32;C:WI
    NDOWS;C:WINDOWSSystem32Wbem;C:WINDOWSSystem32WindowsPowerShellv1.0;C:Pr
    ogram Files (x86)ATI TechnologiesATI.ACECore-Static;C:Program Files (x86)Sa
    msungSamsung PC Studio 3;c:Program Files (x86)QuickTimeQTSystem;C:Program
    Files (x86)Calibre2;c:php;c:apache24;c:apache24bin;

    – mixing 64bit and 32bit shouldn’t be a problem should it? 64bit Apache and 32bit PHP.

  84. When I run c:Apache24binhttpd -S command,
    it throws a syntax erro.
    c:/Apache24/conf/heepd.conf:Cannot find c:/php/ext/php5apache2_4.dll into server:%1 is not a valid Win32 application.

  85. I’m getting an error when I try to start the apache 2.4 service:

    “Windows could not start the Apache 2.4 on local computer. For more information, review the system event log. If this is a non-Microsoft service, contact the service vendor, and refer to server specific error code 1.”

    PHP -m Displayed the modules just fine.

    And I’m not sure how related this is, but I more or less skipped the following for lack of understand the technical explanation.

    “C:> sc config Apache2.4 start= demand – //GOT TO THIS LINE
    Add
    c:Apache24; c:Apache24bin
    to PATH in Environment variables. PATH ENVIRONMENT (System Properties Advanced Environment Variables System variables Path).
    Example:
    ;c:php;c:apache24;c:apache24bin;”

    The result from what I did manage to get into CMD:

    “C:> sc config Apache2.4 start= demand
    [SC] ChangeServiceConfig SUCCESS”

    Edit: Just before posting:

    “C:> sc config apache2.4 start= demand binPath= ;cphpv5.5;c:apache24;c:apache24bin
    [SC] ChangeServiceConfig SUCCESS”

    But now when I try to start the service I get an error saying:

    “Windows could not start the Apache2.4 service on Local Computer. Error 2: The system cannot find the file specified.”

    Any help or clarification would be greatly appreciated.

  86. Hi,

    I’ve been trying for months to get an instance of Apache 2.4 to run on a port 80…

    I can make it run without problems what so ever on any other, but I need it on 80 for running a project that requires it.

    When I try to install it (the instance of the server), setting the httpd.config so it would ‘hook’ on port 80, i get this error (my server is installed on d: and I don’t have any app listening to the port or I’m not aware I do):

    ‘D:Apache24bin>httpd -k install
    Installing the Apache2.4 service
    The Apache2.4 service is successfully installed.
    Testing httpd.conf….
    Errors reported here must be corrected before the service can be started.
    (OS 10013)An attempt was made to access a socket in a way forbidden by its acces
    s permissions. : AH00072: make_sock: could not bind to address [::]:80
    (OS 10013)An attempt was made to access a socket in a way forbidden by its acces
    s permissions. : AH00072: make_sock: could not bind to address 0.0.0.0:80
    AH00451: no listening sockets available, shutting down
    AH00015: Unable to open logs’

    Thank You in advance…

    • I got the same issue.

      Errors reported here must be corrected before the service can be started.
      (OS 10013)An attempt was made to access a socket in a way forbidden by its acces
      s permissions. : AH00072: make_sock: could not bind to address [::]:80
      (OS 10013)An attempt was made to access a socket in a way forbidden by its acces
      s permissions. : AH00072: make_sock: could not bind to address 0.0.0.0:80
      AH00451: no listening sockets available, shutting down
      AH00015: Unable to open logs’

      How to resolve it? I have even used msi set up for apache. It’s still not working. Please help.

  87. hi

    thanx for a good working tutorial
    being new to this type of instillation i cannot start apache. the only step i am having a problem with is

    Add

    c:Apache24; c:Apache24binto PATH in Environment variables. PATH ENVIRONMENT (System Properties Advanced Environment Variables System variables Path).
    Example:
    ;c:php;c:apache24;c:apache24bin;

    i am adding

    P:>;p:devprogramsphp;p:devprogramsapache24;p:devprogramsapache24bin
    ‘p:devprogramsphp’ is not recognized as an internal or external command,
    operable program or batch file.

    could anyone tell me what im doing wrong

    thanks klein

  88. I got this website from my buddy who told me about this web page and at the moment
    this time I am browsing this website and reading
    very informative articles or reviews at this place.

  89. When I type the given in the command prompt “c:apache24binhttpd -k install”…I get an error message stating that the procedure entry point ucrtbase.terminate could not be located in the dynamic link library api-ms-win-crt-runtime- 1-1-0.dll….
    Please provide a solution !

How to install php 5.4

Trackbacks/Pingbacks

  1. How to configure enable php_pdo_mysql on php5.5.12 and Apache 2.4 • PHP Help Coding Programming - […] I followed the instructions on this this “How install Apache 2.4 and PHP“ […]

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Configuring Apache 2.2.8
  • Now that you have successfully installed both Apache Webserver and php scripting language your next most important task is to configure them so that they can recognize each other.
  • Go to your apache installation path, and then open httpd.conf which is located under the conf directory “C:Program Filesapacheconf” double click on httpd.conf file. Find (ctrl+F) 'loadmodule'. After the last line of the loadmodule section type: LoadModule php5_module C:/Program Files/php/php5apache2_2.dll
  • After you have done look for <IfModule mime_module> and then add the following lines
    • AddType application/x-httpd-php .php
    • AddType application/x-httpd-php-source .phps
  • Before the closing statement </IfModule> for mime_module
  • After that on the same page find <IfModule dir_module> and then add DirectoryIndex index.html and index.php before </IfModule> if it already does not exists.
  • Add the following line “PHPIniDir “C:/Program Files/php” to the bottom of the file.
  • After you have done that save the file and close it.