第一部分:安装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. 点点滴滴-NET下的常用框架

    刘冬的博客:http://www.cnblogs.com/GoodHelper/category/214139.html (Spring.net和Nhibernate) Kyo-yo  : http: ...

  2. spring声明式事务 同一类内方法调用事务失效

    只要避开Spring目前的AOP实现上的限制,要么都声明要事务,要么分开成两个类,要么直接在方法里使用编程式事务 [问题] Spring的声明式事务,我想就不用多介绍了吧,一句话“自从用了Spring ...

  3. spring junit class path resource [ /com/config/spring-core.xml] cannot be opened because it does not exist

    正确写法应该如下: @RunWith(SpringJUnit4ClassRunner.class) //@ContextConfiguration(locations="classpath: ...

  4. VJP1218数字游戏(环形DP)

    链接 数据比较小 直接爆了 5重 枚举断开的琏 dp[i][j][k] (i-j)区间为第k段 dp[i][j][k] = min(dp[i][j][k],dp[g][i-1][k-1]*s[i][j ...

  5. 归纳决策树ID3(Java实现)

    先上问题吧,我们统计了14天的气象数据(指标包括outlook,temperature,humidity,windy),并已知这些天气是否打球(play).如果给出新一天的气象指标数据:sunny,c ...

  6. BIOS与UEFI、MBR和GPT介绍

    操作步骤: UEFI是取代传统BIOS的,全称“统一的可扩展固件接口”.MBR则是传统的分区表类型,最大的缺点则是不支持容量大于2T的硬盘.GPT则弥补了MBR这个缺点,最大支持18EB的硬盘,是基于 ...

  7. jquery图片轮播插件slideBox

    效果预览: 源代码下载: jQuery图片轮播(焦点图)插件jquery.slideBox 特点:兼容IE6+,Chrome,Firefox,Opera,safari,可左右,可上下,可快可慢,可指定 ...

  8. STL for_each()

    http://www.cplusplus.com/reference/algorithm/for_each/ std::move()用于c++11 http://www.cplusplus.com/r ...

  9. selenium使用整理

    学习selenium自动化有一段时间了,今天一位自动化测试大侠给了我指导.如下: 第一步,先用selenium的固定脚本把手工测试的流程写成脚本 eg: driver.FindElement(By.I ...

  10. 【原】数据库SQL语句入门

    1.数据定义DDL(Data Definition Language)语言即对表结构的一些定义,主要包括动词为CREATE/DROP/ALTER. 1.1.CREATE语句 CREATE TABLE ...