MySQLphp mysql apache 配置笔记

    php的安装    56  cd /home/tmp
   58  tar -xzf php-5.3.0.tar.gz
   59  cd php-5.3.0

   68  cp php.ini-development /usr/local/php/lib/php.ini
   69  /usr/local/apache2/bin/apachectl start
   70  /usr/local/apache2/bin/apachectl stop
   71  /usr/local/apache2/bin/apachectl start

    前日特别安排了mysql apache php
,虽然网上广大这方面的例子,可是众多是笔者再回首写的,所以难免有笔误的地点。
而这个事物,正是新手很纳闷的地点。一下是自家的装置笔记,在Centos虚拟机上安装成功。
中文的参阅:http://xieyu.blog.51cto.com/213338/59749
英文的参考 How to Install MySQL 5.0 on
Linux
How
to Install PHP 5 on
Linux
How
to Install Apache 2 on
Linux

pdo_mysql
wget
http://pecl.php.net/get/PDO\_MYSQL-1.0.2.tgz
tar xzvf PDO_MYSQL-1.0.2.tgz
cd PDO_MYSQL-1.0.2
/usr/local/php/bin/phpize
Configuring for:
PHP Api Version: 20041225
Zend Module Api No: 20060613
Zend Extension Api No: 220060519
./configure –with-php-config=/usr/local/php/bin/php-config
经过configure就可以make了
make
make install注意pdo_mysql的全路径,我的是:
/usr/local/php/lib/php/extensions/debug-non-zts-20060613/pdo_mysql.so
然后在/usr/local/lib/php.ini
添加一句:
extension=/usr/local/php/lib/php/extensions/debug-non-zts-20060613/pdo_mysql.so
双重启航apache即可看到曾经加载pdo_mysql成功。

 [client]
 + default-character-set=utf8
 [mysqld]
 + default-character-set=utf8
 [mysql]
 + default-character-set=utf8

AddType application/x-httpd-php .php

   46  ./configure –prefix=/usr/local/apache2 –enable-so
–enable-rewrite –enable-auth-digest=shared –enable-ssl
–enable-deflate

 

   47  make
   48  history
   49  make install
   50  cp /usr/local/apache2/bin/apachectl  /etc/init.d
   51  chmod 755 /etc/init.d/apachectl 
   54  /usr/local/apache2/bin/apachectl start

 

   62  make
   65  make install
   修改apache httpd.conf(apache/conf/httpd.conf)
加上如下一些:
LoadModule php5_module modules/libphp5.so

mysql 的config例子

mysql apache php 安装过程。
将apache ,mysql
,php 的tar.gz 文件复制到/home/tmp目录。接着执行下面的授命
    mysql 安装     1 cd /home/tmp
    2  groupadd mysql
    3  useradd -g mysql mysql
    4  tar -zxvf mysql-5.1.33.tar.gz
    5  cd mysql-5.1.33
    6  ./configure –prefix=/usr/local/mysql
    7  make
    8  make install
   14  cd /usr/local/mysql
   15  chown -R root .
   17  bin/mysql -u root -p
   18  chgrp -R mysql .(注意有个.)
   21  cd /home/tmp
   23  cd mysql-5.1.33
   25  ln -s /usr/local/mysql/ /usr/local/mysql
   26  cp support-files/my-small.cnf /etc/my.cnf 
    修改my.cnf 在[sqld]下边添加user=mysql.
   27  chown root /etc/my.cnf
   28  chgrp root /ect/my.cnf
   30  chmod 644 /etc/my.cnf
   33  /usr/local/mysql/bin/mysqld_safe –user=mysql &
   36  cp support-files/mysql.server /etc/init.d/mysql
   37  chmod 755 /etc/init.d/mysql
   38  chkconfig –add mysql
   39  chkconfig –level 35 mysql on
   41  /usr/local/mysql/bin/mysql_install_db  –user=mysql
   42  /usr/local/mysql/bin/mysql -u root(假使能进来mysql
命令行,表达mysql 配置成功。)

./configure –prefix=/usr/local/php \
–with-apxs2=/usr/local/apache2/bin/apxs \
–with-mysql=/usr/local/mysql \
–with-pdo-mysql \
–with-zlib \
–with-libxml-dir \
–with-xsl \
–enable-mbstring \
–enable-zend-multibyte \
–enable-sockets \
–enable-soap \
–enable-zip

./configure –prefix=/usr/local/mysql-5.1.59 –enable-assembler
–with-charset=utf8 –with-collation=utf8_general_ci
–with-extra-charsets=complex –enable-thread-safe-client
–with-big-tables –with-readline –with-ssl –with-embedded-server
–enable-local-infile –with-plugins=partition,innobase,myisammrg

**附:mysql 允许远程连接

  apache安装,请先进入/home/tmp目录(cd /home/tmp)
   44  tar -zxvf httpd-2.2.13.tar.gz
   45  cd httpd-2.2.13

edit /etc/my.cnf

**/usr/local/mysql/bin/mysql -u root -p  (进入mysql)
use mysql;
SELECT `Host`,`User` FROM user;
UPDATE user SET `Host` = ‘%’ WHERE `User` = ‘root’ LIMIT 1;
flush privileges;
在目的在于mysql 命令行格局下一定要输入”;”.

网站地图xml地图