简介:这是Ubuntu 11.04编译安装nginx、PHP 5.3、mysql、mongodb、memcached、ssl、smtp的详细页面,介绍了和php,有关的知识、技巧、经验,和一些php源码等。
class='pingjiaF' frameborder='0' src='http://biancheng.dnbcw.info/pingjia.php?id=339660' scrolling='no'>手动编译安装nginx 1.04
nginx下载页面:http://nginx.org/en/download.html
echo 复制下面整段shell到命令行终端中,会自动逐条执行。 sudo apt-get install libpcre3 libpcre3-dev wget http://nginx.org/download/nginx-1.0.4.tar.gz tar -jxvf nginx-1.0.4.tar.gz cd nginx-1.0.4 ./configure --prefix=/usr/local/nginx make sudo make install sudo ln -s /usr/local/nginx/sbin/nginx /etc/init.d/ echo 把nginx加入服务,开机自启动 sudo update-rc.d nginx defaults echo 启动nginx sudo /etc/init.d/nginx echo 访问本机首页,如果正常,则说明nginx已启动 firefox http://localhost/
手动安装mysql
手动安装mysql请看: http://www.cnblogs.com/sink_cup/archive/2011/03/18/ubuntu_x64_software.html#mysql
手动编译安装php 5.3.6
php下载页面:http://php.net/downloads.php
php发送email的2种方式:http://blog.csdn.net/aryang/archive/2007/07/03/1676968.aspx
CGI、fastcgi、php-fpm:https://wangyan.org/blog/install-php-fpm-from-source.html
sudo apt-get install libltdl-dev libssl-dev sendmail echo 根据PHP官方推荐,使用mysqli和pdo_mysql,而不使用mysql。gmail stmp需要openssl。 ./configure --prefix=/usr/local/php --enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data --with-curl --with-mcrypt --enable-mbstring --enable-pdo --with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd --with-mysql=mysqlnd --with-openssl --with-imap-ssl make sudo make install sudo cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf pid = run/php-fpm.pid error_log = log/php-fpm.log log_level = notice pm.start_servers pm.min_spare_servers pm.max_spare_servers sudo cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm sudo chmod 755 /etc/init.d/php-fpm echo 把php-fpm加入服务,开机自启动 sudo update-rc.d php-fpm defaults sudo /usr/local/php/sbin/php-fpm sudo vi /usr/local/nginx/conf/nginx.conf location / { root /usr/www; index index.html index.htm index.php; } location ~ \.php$ { root /usr/www; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name; include fastcgi_params; } sudo killall nginx sudo /etc/init.d/nginx
手动安装php mongo扩展
sudo apt-get install autoconf wget http://pecl.php.net/get/mongo-1.1.4.tgz tar -zxvf mongo-1.1.4.tgz cd mongo-1.1.4 /usr/local/php/bin/phpize ls ./configure --with-php-config=/usr/local/php/bin/php-config make sudo make install sudo vi /usr/local/php/lib/php.ini 在最下面加入一行 extension = mongo.so
手动安装php memcache扩展
sudo /usr/local/php/bin/pecl install memcache sudo vi /usr/local/php/lib/php.ini 在最下面加入一行 extension = memcache.so
自动安装memcached服务器
sudo apt-get install memcached sudo /etc/init.d/memcached start
手动安装mongodb 1.8.2服务器
mongodb服务器下载页面:http://www.mongodb.org/downloads
wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-1.8.2.tgz tar -zxvf mongodb-linux-x86_64-1.8.2.tgz sudo mv mongodb-linux-x86_64-1.8.2 /usr/local/mongodb sudo ln -s /usr/local/mongodb/bin/mongod /etc/init.d/ sudo ln -s /usr/local/mongodb/bin/mongo /usr/bin/ sudo mkdir -P /data/db/ echo 把mongod加入服务,开机自启动 sudo update-rc.d mongod defaults echo 启动mongod服务器 sudo nohup /etc/init.d/mongod &