ubuntu13.10 源码安装apache2,php5,mysql 遇到的困难和解决方法

 首先,为什么要源码安装?因为源码的自定义程度大,软件新,虽然有点麻烦,但对完美主义者来说,这不是问题。

1,按照细说php的软件列表下载

其中gd和zend不必下载,新版本包含或不支持了。

安装libxml2时,./configure前要加上CFLAGS=-U_FORTIFY_SOURCE,不然open函数有错误,ubuntu众多bug中的一个。

安装zlib时,三步曲后要加上:

export LDFLAGS="-L/usr/local/zlib/lib" 
export CPPFLAGS="-I/usr/local/zlib/include"

其他的小包没什么,按细说php中的步骤就行。

到安装apache2时,要先下载apr,apr-until,pcre,并三部曲安装,然后在./configure中with包含安装处的文件。

./configure --prefix=/usr/local/apache2 --sysconfdir=/etc/httpd --with-z=/usr/local/zlib/ --disable-userdir --enable-so --enable-deflate=shared --enable-expires=shared --enable-rewrite=shared --enable-static-support --with-apr=/usr/local/apr/ --with-apr-util=/usr/local/apr-util/ --with-pcre=/usr/local/pcre/

接着make && make install

然后时mysql ,下载时不是源码,是二进制的安装文件,所以安装是:

mv -R mysql-advanced-5.6.16-linux-glibc2.5-x86_64/ mysql-5.6.16
mv  mysql-advanced-5.6.16-linux-glibc2.5-x86_64/ mysql-5.6.16
ls
cd mysql-5.6.16/
chown -R mysql .
chgrp -R mysql .
scripts/mysql_install_db --user=mysql
ls
ls share/
file scripts/mysql_install_db 
apt-get install libaio-dev
scripts/mysql_install_db --user=mysql
cp share/english/errmsg.sys /usr/share/mysql/errmsg.sys
mkdir /usr/share/mysql
cp share/english/errmsg.sys /usr/share/mysql/errmsg.sys
scripts/mysql_install_db --user=mysql
rm /etc/my.cnf
scripts/mysql_install_db --user=mysql
rm -R /etc/mysql/
scripts/mysql_install_db --user=mysql
find / -name my.cnf
mv my.cnf my.old.cnf
scripts/mysql_install_db --user=mysql
chown -R root .
chown -R mysql data
bin/mysqld_safe --user=mysql &
cp support-files/mysql.server /etc/init.d/mysqld
vi my.cnf 
cp my.cnf /etc/my.cnf
netstat -tnl|grep 3306
bin/mysqladmin version
bin/mysql -u root
chkconfig
apt-get install chkconfig
cd /etc/apt/
cp sources.list sources.list_backup
gedit sources.list
apt-get update
cd -
apt-get install chkconfig
chkconfig --add mysqld
insserv

ln -s /usr/lib/insserv/insserv /sbin/insserv
chkconfig --add mysqld
chkconfig --level6 mysqld
chkconfig --level 6 mysqld
要吃饭了,懒得修改。
然后是php:
<pre code_snippet_id="243112" snippet_file_name="blog_20140318_5_6944791" name="code" class="html">./configure --prefix /usr/local/php --with-mysqli=/usr/local/src/mysql-5.6.16/bin/mysql_config --with-mysql=/usr/local/src/mysql-5.6.16/ --with-apxs2=/usr/local/apache2/bin/apxs --with-jpeg-dir=/usr/local/jpeg9 --with-zlib-dir=/usr/local/zlib/ --with-gd --with-config-file-path=/usr/local/php/etc --with-libxml-dir=/usr/local/libxml2/ --with-png-dir=/usr/local/png/ --with-mcrypt=/usr/local/libmcrypt/ --with-freetype-dir=/usr/local/freetype/ --enable-soap --enable-mbstring=all --enable-sockets
make && make install

最后可以安装phpmyadmin数据库网页管理东东。
 

 
最后的最后:<img src="https://img-blog.csdn.net/20140318184259328?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvRmVsY3g=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="" />



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值