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
?