LAMP 环境搭建

 2023-09-15 阅读 17 评论 0

摘要:2019独角兽企业重金招聘Python工程师标准>>> mysql 编译安装 版本mysql-5.0.41 ./configure '--prefix=/usr/local/mysql' '--without-debug' '--with-charset=utf8' '--with-extra-charsets=all' '--enable-assem

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

mysql 编译安装 版本mysql-5.0.41

./configure  '--prefix=/usr/local/mysql' '--without-debug' '--with-charset=utf8' '--with-extra-charsets=all' '--enable-assembler' '--with-pthread' '--enable-thread-safe-client' '--with-mysqld-ldflags=-all-static' '--with-client-ldflags=-all-static' '--with-big-tables' '--with-readline' '--with-ssl' '--with-embedde'

缺少ncurses

yum install ncurses ncurses-devel 安装

linux开发环境的搭建,make

make install

cp my-medium.cnf /etc/my.cnf


添加系统mysql组和mysql用户:

执行命令:groupadd mysql和useradd -r -g mysql mysql

lamp平台,入安装mysql软件目录:执行命令 cd /usr/local/mysql

修改当前目录拥有者为mysql用户:执行命令 chown -R mysql:mysql ./

安装数据库:执行命令 ./scripts/mysql_install_db --user=mysql

修改当前目录拥有者为root用户:执行命令 chown -R root:root ./

修改当前data目录拥有者为mysql用户:执行命令 chown -R mysql:mysql data


lamp服务器?./mysql.server start 启动


apache 编译安装

版本 httpd-2.2.20 不需要安装apr

今日编译apache时出错:

#./configure --prefix……检查编辑环境时出现:

lamp一键安装包。checking for APR... no
configure: error: APR not found .  Please read the documentation

解决办法:

1.下载所需软件包:

wget http://archive.apache.org/dist/apr/apr-1.4.5.tar.gz  wget http://archive.apache.org/dist/apr/apr-util-1.3.12.tar.gz  wget http://jaist.dl.sourceforge.net/project/pcre/pcre/8.10/pcre-8.10.zip

2.编译安装:

yum remove apr-util-devel apr apr-util-mysql apr-docs apr-devel apr-util apr-util-docs

具体步骤如下:

  a:解决apr not found问题>>>>>>

[root@xt test]# tar -zxf apr-1.4.5.tar.gz  [root@xt test]# cd  apr-1.4.5  [root@xt apr-1.4.5]# ./configure --prefix=/usr/local/apr  [root@xt apr-1.4.5]# make && make install

lamp软件,  b:解决APR-util not found问题>>>>

[root@xt test]# tar -zxf apr-util-1.3.12.tar.gz  [root@xt test]# cd apr-util-1.3.12  [root@xt apr-util-1.3.12]# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/bin/apr-1-config  [root@xt apr-util-1.3.12]# make && make install


  c:解决pcre问题>>>>>>>>>

[root@xt test]#unzip -o pcre-8.10.zip  [root@xt test]#cd pcre-8.10  [root@xt pcre-8.10]#./configure --prefix=/usr/local/pcre  [root@xt pcre-8.10]#make && make install

4.最后编译Apache时加上:

--with-apr=/usr/local/apr

--with-apr-util=/usr/local/apr-util

--with-pcre=/usr/local/pcre

大数据开发环境搭建、

./configure --prefix=/usr/local/apache2  --enable-cache --enable-disk-cache -enable-mem-cache --enable-file-cache --with-ssl --enable-ssl --enable-so --enable-mime-magic --enable-mods-shared=most --with-mpm=worker --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-pcre=/usr/local/pcre

缺少opensll-devel

yum install openssl-devel 安装

make

make install
./apachectl start  启动

搭建php环境、


php 编译安装

版本php-5.2.6

./configure --prefix=/usr/local/php  --with-apxs2=/usr/local/apache2/bin/apxs --with-mysqli=/usr/local/mysql/bin/mysql_config --with-mysql=/usr/local/mysql

缺少xlmlib

搭建、yum install libxml2-devel 安装

make

make install


cp php.ini-development /usr/local/php5/lib/php.ini

vi /usr/local/apache2/conf/httpd.conf 添加php支持

测试环境搭建、AddType application/x-httpd-php .php

编译安装的apache 网页存放路径跟rpm包安装的不一样。编译安装的路径在/usr/local/apache2/htdocs/
可添加以下内容info.php到/usr/local/apache2/htdocs/下,测试php模块是否加载.

复制代码 代码如下:

# vi  /usr/local/apache2/htdocs/info.php
---------------
<?php
echo phpinfo();
?>


转载于:https://my.oschina.net/u/1445488/blog/354129

版权声明:本站所有资料均为网友推荐收集整理而来,仅供学习和研究交流使用。

原文链接:https://hbdhgg.com/1/55923.html

发表评论:

本站为非赢利网站,部分文章来源或改编自互联网及其他公众平台,主要目的在于分享信息,版权归原作者所有,内容仅供读者参考,如有侵权请联系我们删除!

Copyright © 2022 匯編語言學習筆記 Inc. 保留所有权利。

底部版权信息