ubuntu 12.04LTS環境: php
nginx 配置安裝 mysql
安裝依賴: nginx
libssl-dev libpcre3-dev
編譯配置: sql
wget http://nginx.org/download/nginx-1.5.4.tar.gz
sudo ./configure --prefix=/usr/local/nginx --with-http_ssl_module --with-debug sudo make sudo make install
mysql 安裝 179M(不須要configure) shell
安裝依賴: ubuntu
libaio-dev
sudo useradd --no-create-home --no-log-init --shell=/bin/false mysql cd xxx/mysql/script sudo ./mysql_install_db --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --user=mysql sudo ln -s /usr/local/mysql/bin/mysql /usr/bin/mysql 做連接
若啓動mysqld_safe守護進程時錯誤done掉,查看Log時顯示 /usr/local/mysql/bin/mysqld: Can't create/write to file '/var/run/mysqld/mysqld.pid' (Errcode: 2). 比較快的解決辦法,查看/var/run下有無mysqld文件. 若不存在則新建並賦777權限. vim
php安裝 curl
安裝依賴: socket
libfreetype6-dev libltdl-dev libxml2-dev libpng12-dev libjpeg-dev libmcrypt-dev libcurl4-openssl-dev
配置安裝: php-fpm
sudo ./configure --prefix=/usr/local/php --enable-fpm --enable-mbstring --enable-debug --enable-gd-jis-conv --enable-gd-native-ttf --with-jpeg-dir --with-mcrypt --with-mysqli=/usr/local/mysql/bin/mysql_config --with-mysql=/usr/local/mysql --with-gd --with-png-dir --with-curl --with-freetype-dir --with-iconv-dir --with-openssl --with-pdo-mysql=/usr/local/mysql/bin/mysql_config --with-zlib sudo make sudo make install sudo cp php.ini-development /usr/local/php/etc/php.ini sudo useradd --no-create-home --shell=/sbin/nologin www cd /usr/local/php/etc sudo cp php-fpm.conf.default php-fpm.conf sudo vim php-fpm.conf (修改user=www group=www)
備用php的configure:
sudo ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-config-file-scan-dir=/usr/local/php/lib/php --with-curl --with-gd --with-iconv-dir --with-jpeg-dir --with-mcrypt --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-openssl --with-pcre-dir --with-png-dir --with-zlib --with-xmlrpc --enable-ftp --enable-gd-jis-conv --enable-gd-native-ttf --enable-soap --enable-mbstring --enable-mod-charset --enable-mysqlnd --enable-shmop --enable-sockets --enable-zip --enable-static --with-pdo-mysql=/usr/local/mysql/bin/mysql_config --enable-debug --enable-exif --enable-bcmath --with-freetype-dir --enable-fpm
xdebug:
根據phpinfo()信息獲取安裝對伊你個安裝方法:http://xdebug.org/wizard.php
centOS 6.4
nginx配置安裝
安裝依賴:
pcre-devel.i686 openssl-devel.i686
編譯配置:與上面的ubuntu同樣.
php安裝
安裝依賴:
libjpeg-devel curl-devel libxml2-devel libpng-devel freetype-devel
libmcrypt-devel(源中默認沒有此包,須要 rpm -ivh "http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm")
編譯配置與上面的同樣.