2022年centos下源码编译方式安装lamp手记 .pdf
《2022年centos下源码编译方式安装lamp手记 .pdf》由会员分享,可在线阅读,更多相关《2022年centos下源码编译方式安装lamp手记 .pdf(9页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、centos下源码编译方式安装lamp 手记Author: Date:2012/4/6 前提:安装gcc 等可以编译c 源码的工具sudo-s LANG=C yum-y install gcc gcc-c+autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl cur
2、l-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers 首先到各自官方下载好源码:一、MySQL 的安装tar zxvf mysql-5.1.62.tar.gz cd mysql-5.1.62./configure-with-mysqld-user=mysql-prefix=/usr/local/mysql5-with-extra-ch
3、arset=all-without-isam-with-plugins=innobase-exec-prefix=/usr/local/mysql5 出现以下提示后就可以编译安装了Thank you for choosing MySQL!Remember to check the platform specific part of the reference manual for hints about installing MySQL on your platform.Also have a look at the files in the Docs directory.make&make
4、install groupadd mysql useradd-g mysql mysql scripts/mysql_install_db cp/usr/local/mysql5/share/mysql/my-f/usr/local/mysql5/var/f cp/usr/local/mysql5/share/mysql/mysql.server/etc/init.d/mysqld chkconfig-add mysqld 名师资料总结-精品资料欢迎下载-名师精心整理-第 1 页,共 9 页 -chkconfig-level 2345 mysqld on chown mysql:mysql-R
5、/usr/local/mysql5/service mysqld start ln-s/usr/local/mysql5/bin/mysql/sbin/mysql ln-s/usr/local/mysql5/bin/mysqladmin/sbin/mysqladmin 设定 mysql 密码mysqladmin-uroot password 123456 测试:netstat-nplt|grep mysql ps aux|grep mysql 二、Apache 的安装tar zxvf httpd-2.2.22.tar.gz cd httpd-2.2.22./configure-prefix=/
6、usr/local/apache2-enable-so-enable-rewrite make&make install /usr/local/apache2/bin/apachectl configtest /usr/local/apache2/bin/apachectl start /usr/local/apache2/bin/apachectl stop 修改默认启动页vi/usr/local/apache2/conf/httpd.conf DirectoryIndex index.html 改为DirectoryIndex index.html index.htm default.ht
7、m default.html index.phpdefault.php 三、安装 PHP模块在编译 php 的时候,出现如下错误php 安装出错:configure:error:mcrypt.h not found.Please reinstall libmcrypt.,意思是,没有查找到mcrytp.h,需要安装libcrytp,在下面的地址下载名师资料总结-精品资料欢迎下载-名师精心整理-第 2 页,共 9 页 -libmarypt:wget ftp:/mcrypt.hellug.gr/pub/crypto/mcrypt/attic/libmcrypt/libmcrypt-2.5.7.ta
8、r.gz 安装:tar-zxvf libmcrypt-2.5.7.tar.gz67 cd libmcrypt-2.5.768 mkdir-p/usr/local/libmcrytp ./configure prefix=/usr/local/libmcrytp/Make make install 然后再安装PHP tar zxvf php-5.3.10.tar.gz cd php-5.3.10 注意:-with-mcrypt=/usr/local/libmcrypt/,要不然会报错提示reinstall libmcrypt./configure-prefix=/usr/local/php5-w
9、ith-mysql=/usr/local/mysql5-with-mysqli=/usr/local/mysql5/bin/mysql_config-with-pdo_mysql=/usr/local/mysql5-with-apxs2=/usr/local/apache2/bin/apxs-with-iconv-dir-with-freetype-dir-with-jpeg-dir-with-png-dir-with-zlib-with-libxml-dir-enable-xml-disable-rpath-enable-bcmath-enable-shmop-enable-sysvsem-
10、enable-inline-optimization-with-curl-with-curlwrappers -enable-mbstring-with-mcrypt=/usr/local/libmcrypt/-with-gd-enable-gd-native-ttf-with-openssl-with-mhash-enable-pcntl-enable-sockets-with-ldap-with-ldap-sasl-with-xmlrpc-enable-zip-enable-soap 以下安装方式【】内可以跳过,此方法基本没有安装任何扩展,只是说明后续缺哪个模块的时候再怎样安装。【未安装任
11、何扩展方式,需要手动安装扩展./configure-prefix=/usr/local/php5-with-mysql=/usr/local/mysql5-with-apxs2=/usr/local/apache2/bin/apxs-with-gd-enable-ftp-enable-sockets cd/ext cd mysqli/usr/local/php5/bin/phpize./configure-prefix=/usr/local/mysqli-with-php-config=/usr/local/php5/bin/php-config-with-mysqli=/usr/local/
12、mysql5/bin/mysql_config make&make install 名师资料总结-精品资料欢迎下载-名师精心整理-第 3 页,共 9 页 -cd curl/usr/local/php5/bin/phpize./configure-with-php-config=/usr/local/php5/bin/php-config-enable-curl make&make install cd mbstring/usr/local/php5/bin/phpize./configure-with-php-con cd pdo_mysql/usr/local/php5/bin/phpize
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 2022年centos下源码编译方式安装lamp手记 2022 centos 源码 编译 方式 安装 lamp 手记
限制150内