安裝依賴
apt-get install gcc libpcre3 libpcre3-dev libxml2 libxml2-dev build-essential openssl libssl-dev libcurl4-gnutls-dev libjpeg-dev libpng-dev libmcrypt-dev libreadline6 libreadline6-dev libgd-dev libxslt-dev autoconf
mysql資料庫(1,2,3可忽略)
1 wget http://repo.mysql.com//mysql-apt-config_0.7.3-1_all.deb
2 dpkg -i mysql-apt-config_0.7.3-1_all.deb
3 apt-get update
4 apt-get install mysql-server
5 service mysql status
6 service mysql start / stop /restart
note:修改配置
my.cnf bind-address
修改密碼
mysqladmin -u root -p password hufeng
查詢使用者
SELECT DISTINCT CONCAT(`User: ```,user,```@```,host,```;`) AS query FROM mysql.user;
新增使用者
CREATE USER `username` IDENTIFIED BY `password`;
遠端訪問
GRANT ALL PRIVILEGES ON *.* TO `root`@`%` WITH GRANT OPTION;
FLUSH PRIVILEGES;
nginx
1 wget http://nginx.org/download/nginx-1.11.1.tar.gz
2 ./configure --prefix=/usr/local/nginx --conf-path=/etc/nginx/nginx.conf --with-http_ssl_module
3 make && make install
4 cp /usr/local/nginx/sbin/nginx /usr/local/bin/
5 nginx , nginx -s reload / stop
php
1 wget http://php.net/distributions/php-7.0.7.tar.gz
2 tar -zxvf php-7.0.7.tar.gz
3 ./configure --prefix=/usr/local/php7 --with-config-file-path=/usr/local/php7/etc --with-pear --with-pdo-mysql --with-mysqli --enable-libxml --enable-soap --enable-zip --enable-shmop --enable-mbstring --enable-sockets --with-mcrypt --with-gd --with-jpeg-dir --with-png-dir --enable-fpm --with-curl --with-freetype-dir --with-openssl --enable-pcntl --with-zlib --enable-bcmath
4 make && make install
5 cp php.ini-development /usr/local/php7/etc/php.ini
6 cp /usr/local/php7/etc/php-fpm.conf.default php-fpm.conf
7 cp /usr/local/php7/sbin/php-fpm /usr/local/bin/ ; cp /usr/local/php7/bin/php /usr/local/bin/; cp /usr/local/php7/bin/php-config /usr/local/bin/; cp /usr/local/php7/bin/phpize /usr/local/bin/
8 開啟 php.ini: 定位到 cgi.fix_pathinfo= 並將其修改為:cgi.fix_pathinfo=0
9 修改 php-fpm.conf 配置檔案,確保 php-fpm 模組使用 www-data 使用者和 www-data 使用者組的身份執行
vim /usr/local/etc/php-fpm.conf
user = www-data
group = www-data
常用命令 php --ini,php -m,php-fpm,kill -USR2 xxxx(重啟php-fpm)