Linux + Apache 2.4.4 + PHP configuration __linux

Source: Internet
Author: User

1. Download httpd2.4.4, storage directory:/home/aaron/httpd-2.4.4.tar.gz, decompression TAR-ZXVF httpd-2.4.4.tar.gz

2. Installation

Into the unpacked/home/aaorn/httpd-2.4.4 directory, execute./configure--PREFIX=/HOME/AARON/HTTPD, Hint:

Checking for APR ... Configure:WARNING:APR version 1.4.0 or later is required, found 1.3.9
configure:WARNING:skipped APR at Apr-1-config, version not acceptable
No
Configure:error:APR not found. Please read the documentation.

To view the Apache installation documentation: Http://httpd.apache.org/docs/2.4/install.html needs a new APR, Follow the wizard to download the apr-1.4.6.tar.gz,apr-util-1.5.1.tar.gz, according to the instructions, respectively, extract to: Httpd2.4.4/srclib/apr and httpd2.4.4/srclib/ Apr-util (absolute path omitted),

TAR-ZXVF apr-1.4.5.tar.gz-c/home/aaron/httpd-2.4.4/srclib/

TAR-ZXVF apr-util-1.5.1.tar.gz-c/home/aaron/httpd-2.4.4/srclib/

Note that after decompression Apr and apr-util directory with version number, the directory is renamed to Apr and Apr-util (without version number) MV apr-1.4.5 Apr, MV apr-util-1.5.1 Apr-util

And then to the httpd-2.4.4 directory./configure--prefix=/home/aaron/httpd--WITH-INCLUDED-APR

Note that this step, there are many people on the internet is the APR and Apr-utils first compiled installation, and then use the parameters--with-apr=/xx/apr--with-apr-util=/xx/apr-util/bin, I did not test, should effect is the same

Make && make install

Executed successfully. HTTPD installation was successful.

3. Download php-5.4.12.tar.gz, extract to/home/aaron/php-5.4.12, into the unpacked directory

./configure--prefix=/home/aaron/php--with-apxs2=/home/aaron/httpd/bin/apxs--with-mysql

After successful: Make && make install

Successful execution, PHP installation successful.

Reference: http://www.php.net/manual/en/install.unix.apache2.php

The CP Php.ini-development/usr/local/lib/php.ini///USR/LOCAL/LIB requires permission, or a directory that specifies the INI file before installation--with-config-file-path=/some /path

4. Modify HTTPD Configuration

Add to:

<filesmatch "\.ph (p[2-6]?| tml) $ ">
SetHandler application/x-httpd-php
</FilesMatch>
<filesmatch "\.phps$" >
SetHandler Application/x-httpd-php-source
</FilesMatch>


Comment out the rewrite_module in LoadModule

Add after <FilesMathc/> above:

Rewriteengine on
Rewriterule (. *\.php) s$ $ [H=application/x-httpd-php-source]

5. Configuration complete, start Httpd:./bin/apachectl start checking for APR ... Configure:WARNING:APR version 1.4.0 or later is required, found 1.3.9
configure:WARNING:skipped APR at Apr-1-config, version not acceptable
No
Configure:error:APR not found. Please read the documentation.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.