当前位置: 首页 > news >正文

做网站的意义大不大网站wap版影响权重么

做网站的意义大不大,网站wap版影响权重么,太原搭建网站的公司,音乐网站怎么建设nginx php-fpm安装配置 nginx本身不能处理PHP#xff0c;它只是个web服务器#xff0c;当接收到请求后#xff0c;如果是php请求#xff0c;则发给php解释器处理#xff0c;并把结果返回给客户端。 nginx一般是把请求发fastcgi管理进程处理#xff0c;fascgi管理进程选…nginx php-fpm安装配置 nginx本身不能处理PHP它只是个web服务器当接收到请求后如果是php请求则发给php解释器处理并把结果返回给客户端。 nginx一般是把请求发fastcgi管理进程处理fascgi管理进程选择cgi子进程处理结果并返回被nginx 本文以php-fpm为例介绍如何使nginx支持PHP 一、编译安装php-fpm 什么是PHP-FPM PHP-FPM是一个PHP FastCGI管理器 是只用于PHP的,可以在 http://php-fpm.org/download下载得到. PHP-FPM其实是PHP源代码的一个补丁旨在将FastCGI进程管理整合进PHP包中。必须将它patch到你的PHP源代码中在编译安装PHP后才可以使用。 新版PHP已经集成php-fpm了不再是第三方的包了 推荐使用。PHP-FPM提供了更好的PHP进程管理方式可以有效控制内存和进程、可以平滑重载PHP配置比spawn-fcgi具有更多优点所以被PHP官方收录了。在./configure的时候带 –enable-fpm参数即可开启PHP-FPM其它参数都是配置php的具体选项含义可以查看这里。 安装前准备 centos下执行 yum -y install gcc automake autoconf libtool makeyum -y install gcc gcc-c glibcyum -y install libmcrypt-devel mhash-devel libxslt-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel新版php-fpm安装(推荐安装方式) wget http://cn2.php.net/distributions/php-5.4.7.tar.gz tar zvxf php-5.4.7.tar.gz cd php-5.4.7 ./configure --prefix/usr/local/php --enable-fpm --with-mcrypt --enable-mbstring --disable-pdo --with-curl --disable-debug --disable-rpath --enable-inline-optimization --with-bz2 --with-zlib --enable-sockets --enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex --with-mhash --enable-zip --with-pcre-regex --with-mysql --with-mysqli --with-gd --with-jpeg-dirmake all install旧版手动打补丁php-fpm安装旧版程序已经没有了大家新版的吧这里做个展示 wget http://cn2.php.net/get/php-5.2.17.tar.gz wget http://php-fpm.org/downloads/php-5.2.17-fpm-0.5.14.diff.gz tar zvxf php-5.2.17.tar.gz gzip -cd php-5.2.17-fpm-0.5.14.diff.gz | patch -d php-5.2.17 -p1 cd php-5.2.17 ./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-openssl -enable-fpm -enable-mbstring -with-freetype-dir -with-jpeg-dir -with-png-dir -with-zlib-dir -with-libxml-dir/usr -enable-xml -with-mhash -with-mcrypt -enable-pcntl -enable-sockets -with-bz2 -with-curl -with-curlwrappers -enable-mbregex -with-gd -enable-gd-native-ttf -enable-zip -enable-soap -with-iconv -enable-bcmath -enable-shmop -enable-sysvsem -enable-inline-optimization -with-ldap -with-ldap-sasl -enable-pdo -with-pdo-mysql make all install以上两种方式都可以安装php-fpm安装后内容放在 /usr/local/php 目录下 以上就完成了php-fpm的安装。 对php-fpm运行用户进行设置 下面是对php-fpm运行用户进行设置 cd /usr/local/php cp etc/php-fpm.conf.default etc/php-fpm.conf vi etc/php-fpm.conf修改 user www-data group www-data如果www-data用户不存在那么先添加www-data用户 groupadd www-data useradd -g www-data www-data二、编译安装nginx 然后按照http://blog.redis.com.cn/install 安装nginx 三、修改nginx配置文件以支持php-fpm nginx安装完成后修改nginx配置文件为,nginx.conf 其中server段增加如下配置 root html; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;否则会出现No input file specified.错误 # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # location ~ .php$ { root html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; }四、创建测试php文件 创建php文件 在/usr/local/nginx/html下创建index.php文件输入如下内容 ?phpecho phpinfo(); ?五、启动服务 启动php-fpm和nginx /usr/local/php/sbin/php-fpm #手动打补丁的启动方式/usr/local/php/sbin/php-fpm startsudo /usr/local/nginx/nginxphp-fpm关闭重启见文章结尾 六、浏览器访问 访问http://你的服务器ip/index.php 皆可以见到php信息了。 七、安装php-fpm时可能遇到的错误 1. php configure时出错 configure: error: XML configuration could not be foundapt-get install libxml2 libxml2-dev (ubuntu下) yum -y install libxml2 libxml2-develcentos下)2. Please reinstall the BZip2 distribution wget http://www.bzip.org/1.0.5/bzip2-1.0.5.tar.gz tar -zxvf bzip2-1.0.5.tar.gz cd bzip2-1.0.5 make make install3. php的配置文件中有一行–with-mysql/usr。 安装的时候提示 configure: error: Cannot find MySQL header files under yes. Note that the MySQL client library is not bundled anymore.这是由于安装mysql时没有安装mysql头文件或者是路径指定不正确,php找不到mysql的头文件引起的错误提示。 解决方法。 (1.) 查看你的系统有没有安装mysql header find / -name mysql.h如果有。请指定–with-mysql/跟你的正常路径。 如果没有。请看下一步。 (2.)redhat安装 rpm -ivh MySQL-devel-4.1.12-1.i386.rpm(3.)ubuntu安装 apt-get install libmysqlclient15-dev(4.)最后一步php的配置选项添加–with-mysql/usr即可 4.No input file specified. location ~ .php$ { root 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. 如果php configure时缺库可以先安装库(ubuntu下) sudo apt-get install make bison flex gcc patch autoconf subversion locate sudo apt-get install libxml2-dev libbz2-dev libpcre3-dev libssl-dev zlib1g-dev libmcrypt-dev libmhash-dev libmhash2 libcurl4-openssl-dev libpq-dev libpq5 libsyck0-dev6. mcrypt.h not found. Please reinstall libmcrypt apt-get install libmcrypt-dev或者 cd /usr/local/src wget http://softlayer.dl.sourceforge.net/sourceforge/mcrypt/libmcrypt-2.5.8.tar.gz tar -zxvf libmcrypt-2.5.8.tar.gz cd /usr/local/src/libmcrypt-2.5.8 ./configure --prefix/usr/local make make install7. php-fpm 5.4.7 如何关闭 重启 php 5.4.7 下的php-fpm 不再支持 php-fpm 以前具有的 /usr/local/php/sbin/php-fpm (start|stop|reload)等命令 需要使用信号控制 master进程可以理解以下信号 INT, TERM 立刻终止 QUIT 平滑终止 USR1 重新打开日志文件 USR2 平滑重载所有worker进程并重新载入配置和二进制模块 示例 php-fpm 关闭 kill -INT cat /usr/local/php/var/run/php-fpm.pidphp-fpm 重启 kill -USR2 cat /usr/local/php/var/run/php-fpm.pid查看php-fpm进程数 ps aux | grep -c php-fpm8.命令行下执行php提示找不到命令 -bash: /usr/bin/php: No such file or directoryvi /etc/profile 在文件底部增加一行配置 export PATH/usr/local/php/bin:$PATH保存退出 source /etc/profile
http://www.zqtcl.cn/news/798741/

相关文章:

  • 网站主域名建设通怎么样
  • 网站是如何建立的广告设计与制作工作内容
  • 网站优化课程培训公司取名生成器免费
  • 如何设立网站做外国网站买域名
  • 惠州网站建设公司排名聊城专业网站设计公司
  • 网站建设龙岗电子商务有限公司官网
  • 分栏型网站服装设计网站模板
  • 建设网站备案与不备案区别企业网站怎么做排名
  • php mysql的网站开发html网站制作答辩ppt
  • 网站制作有名 乐云践新专家网页制作公司需要什么资质
  • 织梦怎么用框架实现在浏览器的地址栏只显示网站的域名而不显示出文件名电脑网站模板
  • 北京网络营销网站品牌营销增长公司哪家好
  • 网站反链有好处吗稷山网站建设
  • 廊坊网站群发关键词怎么在百度上推广自己的公司信息
  • 网站开发 沈阳免费模板建站
  • 商业性质网站建设步骤wordpress电影网盘
  • 网站的外部推广成都房产网官网
  • 深圳网站建设创想营销北京土巴兔全包装修价格表
  • 怎么发布php网站邯郸建设网站制作
  • 手机网站做多宽的图片wordpress顶部导航栏怎么创建
  • 如何做招聘网站的数据分析安徽黄山旅游攻略
  • 2022建站市场国际新闻直播
  • 茗哥网站建设装饰公司网站规划方案
  • 北京天津网站建设公司做平台网站要多久
  • 做我女朋友的表白句的网站做seo_教你如何选择网站关键词
  • 如何对网站用户分析徐州网站制作如何定位
  • 网站定制生成器龙岗网站设计讯息
  • 镇江市建设工程网站蜘蛛爬取网站
  • 个人备案网站可以做电影站吗微信做的地方门户网站
  • 网站上传根目录美点网络公司网站