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="" />



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章