Compile and assemble php

Source: Internet
Author: User
Compile and install php1. install libxmldevel? Yuminstalllibxml2-devel.x86_642. Download php source code 3. install apache2 before and -- enable-so,. configure -- prefixusrlocalphp5 -- with-apxs2usrlocalapache2binap compile install php

1. install libxml devel? Yum install libxml2-devel.x86_64

2. Download php source code

3. install apache2 first, and -- enable-so ,. /configure -- prefix =/usr/local/php5 -- with-apxs2 =/usr/local/apache2/bin/apxs -- with-config-file-path =/usr/local/php5/ conf -- with-mysql

?

Edit the apache configuration file conf/httpd. conf.

Add

LoadModule php5_module modules/libphp5.so

?


??? SetHandler application/x-httpd-php

?

Dynamic php plug-in support

Find the corresponding plug-in the ext directory under the php source code directory and go to the directory for execution.

?

? /Usr/local/php5/bin/phpize?

Then configure

./Configure -- with-php-config =/usr/local/php5/bin/php-config

Then make & make install

?

The compiled so file will be generated in the modules folder under the plug-in source code directory,

Cp to the extensions in the php installation directory,/usr/local/php5/lib/php/extensions

?

? Cp/root/download/php-5.5.4/ext/zlib/modules/zlib. so/usr/local/php5/lib/php/extensions

?

Edit php. ini. If no php. ini is generated by default during php compilation, create a new configfilepath

? -- With-config-file-path =/usr/local/php5/conf? ? ? Create php. ini in this directory

?

Join

Extension_dir = "/usr/local/php5/lib/php/extensions"

Extension = zlib. so

?

Restart apache

?

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.