1. 云栖社区>
  2. PHP教程>
  3. 正文

Ubuntu 12.04 x64 编译安装lamp

作者:用户 来源:互联网 时间:2017-12-01 20:24:10

安装lamp

Ubuntu 12.04 x64 编译安装lamp - 摘要: 本文讲的是Ubuntu 12.04 x64 编译安装lamp, 编译安装apache 2.4.2 sudo echo 'start'echo 常见错误:echo configure: error: APR not found.  Please read the documentation.echo 解

编译安装apache 2.4.2

sudo echo 'start'
echo 常见错误:
echo configure: error: APR not found.  Please read the documentation.
echo 解决办法:
wget http://labs.renren.com/apache-mirror/apr/apr-1.4.6.tar.bz2
tar -jxvf apr-1.4.6.tar.bz2
cd apr-1.4.6
./configure --prefix=/usr/local/apr
make
sudo make install
cd ..
echo 常见错误:
echo AH00526: Syntax error on line 490 of /usr/local/apache2/conf/httpd.conf:
echo Unknown filter provider DEFLATE
echo httpd: Syntax error on line 101 of /usr/local/apache2/conf/httpd.conf: Cannot load /usr/local/apache2/modules/mod_deflate.so into server: /usr/local/apache2/modules/mod_deflate.so: undefined symbol: inflate
echo 解决办法:
sudo sed -i "s/LDFLAGS=/"/"/LDFLAGS=/"-lz/"/g" '/usr/local/apr/bin/apr-1-config'
wget http://labs.renren.com/apache-mirror/apr/apr-util-1.4.1.tar.bz2
tar -jxvf apr-util-1.4.1.tar.bz2
cd apr-util-1.4.1
./configure --prefix=/usr/local/apr-util -with-apr=/usr/local/apr/bin/apr-1-config
make
sudo make install
cd ..

echo 常见错误:
echo configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/
echo 解决办法:
sudo echo start
wget http://downloads.sourceforge.net/project/pcre/pcre/8.30/pcre-8.30.zip
unzip pcre-8.30.zip
cd pcre-8.30
./configure --prefix=/usr/local/pcre
sudo make
sudo make install
cd ..

echo 常见错误:
echo checking whether to enable mod_deflate... configure: error: mod_deflate has been requested but can not be built due to prerequisite failures
echo 解决办法:
sudo apt-get install -y zlib1g-dev

echo 开始安装:
wget http://labs.renren.com/apache-mirror/httpd/httpd-2.4.2.tar.bz2
tar -jxvf httpd-2.4.2.tar.bz2
cd httpd-2.4.2
./configure --prefix=/usr/local/apache2 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util/ --with-pcre=/usr/local/pcre --enable-so --enable-rewrite --enable-deflate --with-module=metadata:expires
make
sudo make install
echo 'ExpiresActive On' | sudo tee -a /usr/local/apache2/conf/httpd.conf
echo 'FileEtag none' | sudo tee -a /usr/local/apache2/conf/httpd.conf
echo 'SetOutputFilter DEFLATE' | sudo tee -a /usr/local/apache2/conf/httpd.conf
sudo sed -i "s/#LoadModule deflate_module modules//mod_deflate.so/LoadModule deflate_module modules//mod_deflate.so/g" '/usr/local/apache2/conf/httpd.conf'
sudo /usr/local/apache2/bin/apachectl start
cd ..

编译安装mysql 5.5.25a

http://www.cnblogs.com/sink_cup/archive/2011/10/28/ubuntu_x64_mysql.html

编译安装php 5.4.4

sudo apt-get install -y curl libxml2 libxml2-dev libssl-dev sendmail libcurl4-openssl-dev libjpeg-dev libpng-dev libmcrypt-devwget -O php-5.4.4.tar.bz2 http://cn.php.net/get/php-5.4.4.tar.bz2/from/this/mirrortar -jxvf php-5.4.4.tar.bz2cd php-5.4.4./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-curl --with-mcrypt --enable-mbstring --enable-pdo --with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd --with-openssl --with-imap-ssl --with-gd --with-jpeg-dir=/usr/lib/ --with-png-dir=/usr/lib/ --enable-exif --enable-zipmakesudo make installsudo cp php.ini-development /usr/local/php/lib/php.inisudo rm /usr/bin/phpsudo ln -s /usr/local/php/bin/php /usr/bin/phpecho 'AddHandler application/x-httpd-php .php' | sudo tee -a /usr/local/apache2/conf/httpd.confsudo sed -i "s/;include_path = /".://php//includes/"/include_path = /"//usr//local//php//lib//php/"/g" '/usr/local/php/lib/php.ini'sudo /usr/local/apache2/bin/apachectl restart

以上是云栖社区小编为您精心准备的的内容,在云栖社区的博客、问答、公众号、人物、课程等栏目也有的相关内容,欢迎继续使用右上角搜索按钮进行搜索安装 lamp ,以便于您获取更多的相关知识。

弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率

40+云计算产品,6个月免费体验

稳定可靠、可弹性伸缩的在线数据库服务,全球最受欢迎的开源数据库之一

云服务器9.9元/月,大学必备