Install php on CentOS
Php dependency
[Plain] view plaincopy
- Yuminstall-ylibxml2-developenssl-devellibcurl-devellibjpeg-devellibpng-devellibicu-developenldap-devel
Download: php-5.5.23.tar.gz
[Plain] view plaincopy
- . /Configure -- prefix =/root/tools/php5.5 -- with-config-file-path =/root/tools/php5.5/etc -- enable-fpm -- enable-xml -- disable-rpath -- enable-bcmath -- enable-shmop -- enable-sysvsem -- enable-inline-optimization -- with-curl -- enable-mbregex -- enable-fpm -- enable-mbstring -- with-gd -- enable -gd-native-ttf -- with-openssl -- with-mhash -- enable-pcntl -- enable-sockets -- with-xmlrpc -- enable-zip -- enable-soap -- enable-opcache -- -pdo-mysql -- enable-maintainer-zts -- disable-fileinfo
Cp/root/tools/php-5.5.23/php. ini-production/root/tools/php5.5/php. ini
Modify the php. ini file register_globals = On
Make: *** [ext/fileinfo/libmagic/apprentice. lo] Error 1
An error occurred while compiling PHP5.5 make.
Make: *** [ext/fileinfo/libmagic/apprentice. lo] Error 1
Solution
This is because the memory is less than 1 GB.
Add the following options to./configure:
-- Disable-fileinfo
Disable fileinfo support Disable fileinfo
######################################## ######################################## ####################
Configure php:
cp php.ini-production /usr/local/php-5.5.0/etc/php.inicp /usr/local/php-5.5.0/etc/php-fpm.conf.default /usr/local/php-5.5.0/etc/php-fpm.conf
/usr/local/php-5.5.0/sbin/php-fpm
Determine whether PHP is enabled through the port
# netstat -lnt | grep 9000tcp 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN