码迷,mamicode.com
首页 > Web开发 > 详细

php环境

时间:2015-08-02 23:07:36      阅读:169      评论:0      收藏:0      [点我收藏+]

标签:

安装nginx

./configure --prefix=/data/nginx --with-http_ssl_module
make && sudo make install
sudo chown root /data/nginx/sbin/nginx
sudo chmod u+s /data/nginx/sbin/nginx

修改/data/nginx/conf/nginx.conf

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;
}
location ~* ^.+\.(jpg|jpeg|gif|css|png|js|ico|html|txt)$ {
            root           html/www.example.com;
            access_log        off;
            expires           30d;
}

启动nginx

sudo /data/nginx/sbin/nginx

安装php

./configure  --prefix=/data/php --enable-fpm --with-mysql --with-mysqli --with-pdo-mysql --enable-mysqlnd --with-openssl --with-gd --enable-gd-native-ttf
make && sudo make install
cp php.ini-production /data/php/etc/php.ini
cp /data/php/etc/php-fpm.conf.default /data/php/etc/php-fpm.conf

修改php.ini增加

pid = run/php-fpm.pid
安装redis扩展
https://github.com/phpredis/phpredis#installation
phpize
./configure
make && make install
修改php.ini增加
extension=/data/php/lib/php/extensions/no-debug-non-zts-20131226/redis.so

启动php

sudo /data/php/sbin/php-fpm -D -c /data/php/etc/php.ini

php环境

标签:

原文地址:http://www.cnblogs.com/hsjq/p/4696875.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!