Compiling and installing lamp-3 (PHP)

Source: Internet
Author: User

Installing php*******************

1, Package: php-5.4.26.tar.bz2 xcache-3.0.3.tar.bz2 phpmyadmin-4.0.5-all-languages.zip

Dependent package installation (X software development)

Yum Groupinstall "Desktop Platform development"-Y

2, if you want to compile PHP support MCrypt, also need to install

Yum-y Install libmcrypt-2.5.7.e15.i386.rpm

Yum-y Install libmcrypt-devel-2.5.7-5.e15.i386.rpm

Installing the Epel Yum source

RPM-UVH http://mirrors.ustc.edu.cn/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm

RPM-UVH http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

Yum-y Install Libmcrypt-devel

3, unzip and install PHP

./configure--prefix=/usr/local/php--with-mysql=/usr/local/mysql--with-openssl--with-mysqli=/usr/local/mysql/ Bin/mysql_config--enable-mbstring--with-freetype-dir--with-jpeg-dir--with-png-dir--with-zlib--with-libxml-dir= /usr--enable-xml--enable-sockets--with-apxs2=/usr/local/apache/bin/apxs--with-mcrypt--with-config-file-path=/ etc--WITH-CONFIG-FILE-SCAN-DIR=/ETC/PHP.D--with-bz2--enable-maintainer-zts

If you are supporting two MPM for Works or event for Apache, you need to use--ENABLE-MAINTAINER-ZTS when compiling

If you use more than PHP5.3, you can specify MYSQLND to link to the MySQL database,

This will not require the installation of MySQL or MySQL development package, mysqlnd from php5.3 can be used,

You can bind him at compile time (instead of relying on the specific MySQL client library bindings),

But starting with php5.4, it's the default device.

See Recruit to recruit:

Configure:error:Cannot find OpenSSL ' s <evp.h>

Installing Openssl-devel,bzip2-devel

If PHP and MySQL are not on a single server:

--with-mysql=mysqlnd--with-mysqli=mysqlnd--with-mysqli=mysqlnd

4, configuration

CP Php.ini-production/etc/php.ini

Vi/etc/httpd24/httpd.conf

Check if there'sloadmodule php5_module modules/libphp5.so

AddType application/x-compress. Z

AddType application/x-gzip. gz. tgz

Add two lines later:

AddType application/x-httpd-php. php

AddType Application/x-httpd-php-source. Phps

Modify one line, add index.php

DirectoryIndex index.php index.html#次序很关键

Re-loading httpd

RPM package installation will be generated under/etc/httpd/conf.d/php.conf, compiled words will not be generated, need to write their own

5, verify

<?php

Phpinfo ();

?>


Compiling and installing lamp-3 (PHP)

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.