Backup first
mv/data/server/php/data/server/php.5.2mv/etc/init.d/php-fpm/etc/init.d/php-fpm.5.2
Compiling source code
First execute the./buildconf--force, in order to prevent Cp:cannot stat ' SAPI/CLI/PHP.1 ': No such file or directory
./buildconf--force./configure--prefix=/data/server/php--with-config-file-path=/data/server/php/etc--with-mysql =/data/server/mysql--with-mysqli=/data/server/mysql/bin/mysql_config--with-gd--with-iconv--with-zlib-- Enable-xml--enable-bcmath--enable-shmop--enable-sysvsem--enable-inline-optimization--with-curlwrappers-- Enable-mbregex--enable-fpm--enable-mbstring--enable-ftp--enable-gd-native-ttf--with-openssl--enable-pcntl-- Enable-sockets--with-xmlrpc--enable-zip--enable-soap--without-pear--with-gettext--enable-session--with-mcrypt- -with-curlmakemake Install
If an error occurs with the installation
Make: * * * [sapi/cli/php] Error 1
Workaround:
Make zend_extra_libs= '-liconv ' ln-s/usr/local/lib/libiconv.so.2/usr/lib64/
Configuration file
CP Php.ini-production/data/server/php/etc/php.inirm-rf/etc/php.iniln-s/data/server/php/etc/php.ini/etc/php.inic P/data/server/php/etc/php-fpm.conf.default/data/server/php/etc/php-fpm.conf
Vi/data/server/php/etc/php-fpm.conf
user = Wwwgroup = Wwwpid = Run/php-fpm.pidlisten =/tmp/php-cgi.socklisten.owner = Wwwlisten.group = www
Set PHP-FPM boot up
CP Sapi/fpm/init.d.php-fpm/etc/rc.d/init.d/php-fpmchmod +x/etc/rc.d/init.d/php-fpmchkconfig PHP-FPM on
Vi/etc/php.ini
Found it:;date.timezone =
Modified to: date.timezone = PRC
#设置时区
Found it:expose_php = On
Modified to: expose_php = OFF
#禁止显示php版本的信息
Found it:short_open_tag = Off
Modified to: short_open_tag = ON
#支持php短标签
Found it:disable_functions =
Modified to:
Disable_functions = Passthru,exec,system,chroot,scandir,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_ Alter,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server,escapeshell, Cmd,dll,popen,disk_free_space,checkdnsrr,checkdnsrr,getservbyname,getservbyport,disk_total_space,posix_ctermid , POSIX_GET_LAST_ERROR,POSIX_GETCWD, Posix_getegid,posix_geteuid,posix_getgid, Posix_getgrgid,posix_getgrnam, Posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid, Posix_getppid,posix_getpwnam,posix_ Getpwuid, Posix_getrlimit, Posix_getsid,posix_getuid,posix_isatty, Posix_kill,posix_mkfifo,posix_setegid,posix_ Seteuid,posix_setgid, Posix_setpgid,posix_setsid,posix_setuid,posix_strerror,posix_times,posix_ttyname,posix_ Uname
Restart the PHP-FPM service after configuration is complete!
Compile and upgrade the PHP to 5.4 release record in the CentOS environment