当前位置首页 > Debian知识

debian7安装php5fpm,nginx笔记

阅读次数:487 次  来源:admin  发布时间:
sudo apt-get install php5-adodb php5-cli php5-common php5-curl php5-dev php5-enchant php5-exactimage php5-fpm php5-gd php5-geoip php5-gmp php5-imagick php5-imap php5-interbase php5-intl php5-lasso php5-ldap php5-librdf php5-mapscript php5-mcrypt php5-memcache php5-memcached php5-pgsql php5-xdebug php5-xmlrpc
sudo apt-get install postgresql nginx

ginx.conf为默认的配置文件,会加载下面两个目录的配置

include /etc/nginx/sites-enabled/*
include /etc/nginx/conf.d/*.conf

ites-enabled里面的配置是sites-available的符号连接

cd /etc/nginx

udo mv ./sites-available/* conf.d/ sudo rm ./sites-enabled/* cd conf.d sudo mv default xxxx.conf

修改conf.d目录下的配置如下

server {
    #打开目录浏览
    autoindex on;
    autoindex_exact_size on;
    autoindex_localtime on;
    
    root /var/www;
    index index.html index.htm index.php;

    server_name localhost;

    location ~ \.php$ {
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;
        fastcgi_param  SCRIPT_FILENAME  $document_root/$fastcgi_script_name;
    }
}

------------------------------------------php源码下载------------------------------------------

如何编译扩展包,比如pcntl,phpredis等

先去php.net下载源码

./configure

apt-get insall php5-dev,不然没有phpize

cd ext/pcntl

hpize;./configure;make

然后去phpinfo的页面看下extension的目录,复制过去,然后在php的动态配置文件路径内添加ini,内容添加extension=pcntl.so

设置权限

sudo chown -R `whoami` /var/www;
sudo chgrp -R www-data /var/www;

重启服务

sudo invoke-rc.d nginx restart
sudo invoke-rc.d php5-fpm restart
上一篇:debian8最小化安装,字符界面的中文配置
下一篇:IIS日志-网站运维的好帮手IIS日志-网站运维的好帮手