第一部分:安装mysql

官方下载 mysql5.6.19 64位的rpm格式文件

0、rpm 四个mysql5.6.19

卸载默认的mysql

yum -y remove mysql-libs-*

yum -y remove mysql-libs-5.1.52*

1、su命令
2、/etc/init.d/mysql start 开启mysql
3、mysql -uroot -p

出现错误:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

------------------------------------
解决方案:
在这个目录下找密码/root/.mysql_secret
cd /root
ls -la
cat .mysql_secret 复制密码
4、查看mysql启动状态/etc/rc.d/init.d/mysql status

登陆进去重新设置密码
set password=password('admin');

第二部分:安装apache

1、

# tar zxvf httpd-2.2.11.tar.gz

# ./configure --prefix=/usr/local/apache2 --enable-dav --enable-modules=so

./configure  --prefix=/usr/local/apache  --enable-so【这个也行】

make

make install

一般出现这个-bash: make: command not found提示,是因为安装系统的时候使用的是最小化mini安装,系统没有安装make、vim等常用命令,直接yum安装下即可。

-------------------------------------------------------

解决方案:

yum -y install gcc automake autoconf libtool make
 
直接ssh运行即可,安装make。
 

启动Apache服务:

# /usr/local/apache2/bin/apachectl start

出现错误:

httpd: apr_sockaddr_info_get() failed for VM_74_204_centos
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName

-------------------------------

解决方案:

在Apache的安装目录下的conf文件修改如下
   (1) ServerName localhost:80

或者在 /etc/hosts 中填入自己的主机名称 bogon,如下:
   (2)127.0.0.1 bogon
---------------------------------------------

/usr/local/apache2/modules/libphp5.so: cannot open shared object file: No such file or directory

-------------------------------------------------

解决方案:Apache 安装目录http。conf文件增加这一行

LoadModule php5_module       /usr/local/apache2/modules/libphp5.so

还是/usr/local/apache2/modules/libphp5.so: cannot open shared object file: No such file or directory 错误,那就先装php吧

第三部分:安装php

安装libxml2

1 tar zxvf libxml2-2.6.32.tar.gz
2 cd libxml2-2.6.32
3 ./configure --prefix=/usr/local/libxml2
4 make
5 make install

安装php

1、tar zvxf php-5.3.8.tar.gz
2、cd php-5.3.8
3、./configure --prefix=/usr/local/php --with-mysqli=/usr/bin/mysql_config --with-apxs2=/usr/local/apache2/bin/apxs --with-libxml-dir=/usr/local/libxml2

出现错误

configure: error: xml2-config not found. Please check your libxml2 installation.

------------------------------------

解决方案:http://www.cnblogs.com/happyhotty/articles/2539864.html

【检查是否安装了libxm包

[root@XKWB3403 php-5.3.8]# rpm -qa |grep  libxml2
libxml2-2.6.26-2.1.12
libxml2-python-2.6.26-2.1.12

重新安装libxml2和libxml2-devel包

yum install libxml2

yum install libxml2-devel -y

安装完之后查找xml2-config文件是否存在

[root@XKWB3403 php-5.3.8]# find / -name "xml2-config"

/usr/bin/xml2-config

然后再重新 config

+--------------------------------------------------------------------+
| License:                                                           |
| This software is subject to the PHP License, available in this     |
| distribution in the file LICENSE.  By continuing this installation |
| process, you are bound by the terms of this license agreement.     |
| If you do not agree with the terms of this license, you must abort |
| the installation process at this point.                            |
+--------------------------------------------------------------------+

Thank you for using PHP.

出现这个,成功安装php

然后再

make  make install

出现这个

[PEAR] Console_Getopt - installed: 1.3.1
warning: pear/PEAR requires package "pear/Structures_Graph" (recommended version 1.0.4)
warning: pear/PEAR requires package "pear/XML_Util" (recommended version 1.2.1)
[PEAR] PEAR           - installed: 1.9.4
Wrote PEAR system config file at: /usr/local/php/etc/pear.conf
You may want to add: /usr/local/php/lib/php to your php.ini include_path
[PEAR] Structures_Graph- installed: 1.0.4
[PEAR] XML_Util       - installed: 1.2.1
/usr/local/php-5.3.28/build/shtool install -c ext/phar/phar.phar /usr/local/php/bin
ln -s -f /usr/local/php/bin/phar.phar /usr/local/php/bin/phar
Installing PDO headers:          /usr/local/php/include/php/ext/pdo/

安装成功了

---------------------------------------------------

最后 php链接php还是不成功。原因解决方案:

cp 一个php.ini 到 /usr/local/php/lib 【cp /usr/local/php-5.3.28/php.ini-production /usr/local/php/lib/php.ini 或者直接操作复制过去那个文件 】

extension=mysql.so

php。ini里面 去掉分号,加上面这个链接。重启Apache即可

./configure --with-php-config=/usr/local/bin/php-config

ln -s /usr/lib64/mysql/libmysqlclient.a /usr/lib/libmysqlclient.a 
ln -s /usr/lib64/mysql/libmysqlclient_r.a /usr/lib/libmysqlclient_r.a
 )
 
--------------------------------------------------------
具体的说,如下:
是解决php与mysql连接的问题,
步骤大致是:
a、进入php目录下ext下mysql下
b、/usr/local/php/bin/phpize
c、./configure --with-php-config=/usr/local/bin/php-config

tip:若configure不成功,则进行下列操作:

ln -s /usr/lib64/mysql/libmysqlclient.a /usr/lib/libmysqlclient.a 
ln -s /usr/lib64/mysql/libmysqlclient_r.a /usr/lib/libmysqlclient_r.a
 )

d、make
e、make install
f、配置mysql.so

linux 配置 Apache mysql php最新版的更多相关文章

  1. linux 配置apache、mysql、php ——20150807

    2015年8月7日 一部分:mysql mysql 5.5.40安装 第二部分:apache(apache要安装在php前面.apache和mysql可以随意顺序) 1. # tar zxvf htt ...

  2. Mac OS X 配置 Apache+Mysql+PHP 详细教程

    网上的教程已经有很多,这里简洁的记录一下.以 Mac OS X Mavericks 10.9.X 为例. 先附上如何进入指定目录文件夹,按键盘 Command + Shift + G ,然后输入指定目 ...

  3. CentOS 配置Apache+Mysql+PHP (yum)与卸载

    一.安装Apache2 #yum -y install httpd 安装配置完成,启动httpd服务#service httpd start 二.安装Mysql1.安装mysql#yum -y ins ...

  4. linux 配置Apache 、PHP

    1. 安装 Apache 安装apache,首先要使用管理员权限,如果如法获取请联系您的管理员. centos: yum install httpd httpd-devel 2. 安装PHP 同样也需 ...

  5. 最简单的Linux下apache+mysql+php安装

    转载:http://www.jb51.net/article/29843.htm ubuntu下需要先更新系统后 流程笔记: 1.打开终端,输入“sudo apt-get install apache ...

  6. centos6.5上配置apache + mysql + php4.4.9 + eaccelerator-0.9.5 + postgresql-8.3.13 备忘

    1.apache + mysql 直接利用 yum 安装 yum -y install httpd httpd-devel mysql mysql-server httpd-manual mod_pe ...

  7. Linux配置apache等系列

    1.Linux下安装.配置PHP环境 2.ubuntu12.0.4安装apache, php ,mysql 3   CentOs中mysql的安装与配置

  8. centos linux服务器apache+mysql环境访问慢优化方法

    查找软件安装目录:find / -name 软件名称 一.优化apache配置增加MaxClients的值 默认情况下,2.0及以上apache版本MaxClients的值为256,对于中大型应用访问 ...

  9. linux+jre+apache+mysql+tomcat调优

    一.不再为Apache进程淤积.耗尽内存而困扰 0. /etc/my.cnf,在mysqld那一段加上如下一行: log-slow-queries=queries-slow.log 重启MySQL 酌 ...

随机推荐

  1. File List()列出文件目录

    import java.io.File; public class FileTest { public static void main(String[] args) { File myFile = ...

  2. 【HDOJ】1069 Monkey and Banana

    DP问题,我是按照边排序的,排序既要考虑x也要考虑y,同时在每个面中,长宽也要有序.还有注意状态转移,当前高度并不是之前的最大block叠加的高度,而是可叠加最大高度+当前block高度或者是当前bl ...

  3. 转载:简化IT程序员工作生活的4个窍门

    如果可以简化你的生活——少做枯燥的任务,将时间真正地用于完成事情,你愿不愿意去尝试?下面就让我一起来学一下如何让程序员工作生活变得简单的小窍门.如果你敢于倾听自己的心声,你会发现自己一天中的大多数时间 ...

  4. Eclipse设置、问题解决方案

    Eclipse设置: 1.如何把eclipse关闭提示调出来? 可以这样打开这个提示:选择 Windows --Preferences,在左边树上选择“General” --“Startup and ...

  5. poj棋盘分割(记忆化)

    http://poj.org/problem?id=1191 黑书上P116 想了挺久 没想出来 想推出一公式来着 退不出来.. 想偏了  正解:递归 #include <iostream> ...

  6. Linq中SingleOrDefault、FirstOrDefault的用法

    1.SingleOrDefault和FirstOrDefault的区别 SingleOrDefault 只取一个 如果没有数据等于 null, 如果>1  异常 FirstOrDefault   ...

  7. Linux kernel 拒绝服务漏洞

    漏洞名称: Linux kernel 拒绝服务漏洞 CNNVD编号: CNNVD-201311-020 发布时间: 2013-11-05 更新时间: 2013-11-05 危害等级:    漏洞类型: ...

  8. [Bhatia.Matrix Analysis.Solutions to Exercises and Problems]ExI.2.3

    (1). Let $\sed{A_\al}$ be a family of mutually commuting operators. Then, there exists a common Schu ...

  9. linux下安装

    挂载 1.虚拟机里选择ios文件2.挂载光驱命令: cd / mount /mnt/cdrom/ cd /mnt/cdrom/ ls 卸载 cd /umount /mnt/cdrom/ 安装 XXX. ...

  10. [转]ASP.NET MVC 入门8、ModelState与数据验证

    ViewData有一个ModelState的属性,这是一个类型为ModelStateDictionary的ModelState类型的字典集合.在进行数据验证的时候这个属性是比较有用的.在使用Html. ...