wsxxz 发表于 2018-9-30 12:47:37

CentOS 6.5编译安装Nginx+MySQL+PHP

# cd /usr/local/src/  
# cp -frp /usr/lib64/libltdl.so* /usr/lib/
  
# cp -frp /usr/lib64/libXpm.so* /usr/lib/
  
# tar zxvf php-5.6.3.tar.gz
  
# export LD_LIBRARY_PATH=/app/libgd/lib/
  
# ./configure --prefix=/app/php --with-config-file-path=/app/php/etc --with-mysql=/app/mysql/ --with-mysqli=/app/mysql/bin/mysql_config --with-mysql-sock=/tmp/mysql.sock --with-pdo-mysql=/app/mysql/ --with-gd --with-png-dir=/app/libpng/ --with-jpeg-dir=/app/jpeg/ --with-freetype-dir=/app/freetype/ --with-xpm-dir=/usr/ --with-vpx-dir=/app/libvpx/ --with-zlib-dir=/app/zlib/ --with-t1lib=/app/t1lib/ -with-iconv --enable-libxml --enable-xml --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --enable-opcache --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-curl --enable-ctype
  
# make && make install
  
# cp php.ini-production /app/php/etc/php.ini#复制php配置文件到安装目录
  
# rm -rf /etc/php.ini   #删除系统自带配置文件
  
# ln -s /app/php/etc/php.ini /etc/php.ini#添加软链接到 /etc目录
  
# cp /app/php/etc/php-fpm.conf.default /app/php/etc/php-fpm.conf#拷贝模板文件为php-fpm配置文件
  
# ln -s /app/php/etc/php-fpm.conf /etc/php-fpm.conf#添加软连接到 /etc目录
  
# vim /app/php/etc/php-fpm.conf
  
user = www
  
group = www
  
pid = run/php-fpm.pid
  
# cp /usr/local/src/php-5.6.3/sapi/fpm/init.d.php-fpm /etc/rc.d/init.d/php-fpm    #拷贝php-fpm到启动目录
  
# chmod +x /etc/rc.d/init.d/php-fpm
  
# chkconfig php-fpm on
  
# vim /app/php/etc/php.ini
  
#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,escapeshellcmd,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    #列出PHP可以禁用的函数,如果某些程序需要用到这个函数,可以删除,取消禁用。
  
date.timezone = PRC   #设置时区
  
expose_php = Off      #禁止显示php版本的信息
  
short_open_tag = ON   #支持php短标签
  
opcache.enable=1      #php支持opcode缓存
  
opcache.enable_cli=1#php支持opcode缓存
  
zend_extension=opcache.so   #文末添加此行,开启opcode缓存功能
  
#


页: [1]
查看完整版本: CentOS 6.5编译安装Nginx+MySQL+PHP