centos 6.3 64位安裝php5.5及配置tengine

來源:互聯網
上載者:User

標籤:style   blog   color   os   io   檔案   ar   art   


PHP 用到的工具包: 

yum install gd-devel libjpeg-devel libpng-devel freetype-devel libxml2-devel curl-devel openssl-devel libicu-devel libmcrypt-devel 

PHP configure參數

./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-mysql-sock=/tmp/mysql.sock --with-pdo-mysql=/usr/local/mysql --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-curl --with-jpeg-dir=/usr/lib64 --with-freetype-dir=/usr/lib64 --with-png-dir=/usr/lib64 --disable-debug
make #編譯make install #安裝cp php.ini-production /usr/local/php5/etc/php.ini #複製php設定檔到安裝目錄rm -rf /etc/php.ini #刪除系統內建設定檔ln -s /usr/local/php5/etc/php.ini /etc/php.ini #添加軟連結cp /usr/local/php5/etc/php-fpm.conf.default /usr/local/php5/etc/php-fpm.conf #拷貝模板檔案為php-fpm設定檔vi /usr/local/php5/etc/php-fpm.conf #編輯user = www #設定php-fpm運行帳號為wwwgroup = www #設定php-fpm運行組為wwwpid = run/php-fpm.pid #取消前面的分號設定 php-fpm開機啟動cp /usr/local/src/php-5.4.5/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 #設定開機啟動vi /usr/local/php5/etc/php.ini #編輯設定檔找到:disable_functions = 修改為: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 = 修改為:date.timezone = PRC#設定時區 找到:expose_php = On 修改為:expose_php = OFF#禁止顯示php版本的資訊 找到:short_open_tag = Off 修改為:short_open_tag = ON #支援php短標籤

最後service php-fpm start #啟動php-fpm

tengine 整合php

在nginx.conf中的server段中加入

location ~ \.php$ {            root           /usr/local/tengine/html;            fastcgi_pass   127.0.0.1:9000;            fastcgi_index  index.php;            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;            include        fastcgi_params;        }

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.