如何在Linux系统中安装Apache+Php+Mysql

网址简介:未填写

更新时间:4个月前

访问次数:57

详细介绍

如何在系统中安装Apache+Php+Mysql?相信对于按照Apache+Php+Mysql很多人都不知道其具体方法,那么我们现在就跟爱站小编一起去看看Linux系统中安装Apache+Php+Mysql的详细教程。
 

一.linux下安装mysql

小弟最近搞mysql源码安装,安装过程如下:

安装步骤:

1.groupadd mysql

2.useradd -g mysql mysql

3.tar zxvf myql-5.0.18.tar.gz

4.cd mysql-5.0.18.tar.gz

5../configure= prefix=/usr/local/mysql

6.make

7.make install

8.cp support-files/my-medium.cnf /etc/my.cnf

9.cd /usr/local/mysql

10.bin/mysql_install_db --user=mysql

11.chown -R root .

12.chown -R mysql var

13.chgrp -R mysql .

14.bin/mysqld-safe --user=mysql &

 

检查日志:more var/localhost.err:

070129 15:05:58 mysqld started

070129 15:05:58 InnoDB: Started; log sequence number 0 43655

070129 15:05:58 [Note] /usr/local/mysql/libexec/mysqld: ready for connections.

Version: '5.0.18-log' socket: '/tmp/mysql.sock' port: 3306 Source distribution

如何在Linux系统中安装Apache+Php+Mysql-第1张图片

查看进程:ps -aux

root 17286 0.0 0.4 5144 1096 pts/2 S 15:05 0:00 /bin/sh bin/mysqld_safe --user=mysql

mysql 17310 0.0 6.0 125272 15104 pts/2 Sl 15:05 0:00 /usr/local/myql/libexec/mysqld --basedir=/usr/local/myql --datadir=/u

root 17546 0.0 0.8 9280 2200 ? SNs 15:20 0:00 cupsd

root 17612 0.0 0.3 3876 748 pts/2 R+ 15:21 0:00 ps -aux

 

关闭mysql:

bin/mysqladmin shutdown

STOPPING server from pid file /usr/local/myql/var/localhost.pid

070129 15:22:28 mysqld ended

[1]+ Done bin/mysqld_safe --user=mysql

[root@localhost myql]# mysql

Welcome to the monitor. Commands end with ; or \g.

Your MySQL connection id is 2 to server version: 5.0.18-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

 

如果不行的话killall mysqld,在重新启动就OK了

如何在Linux系统中安装Apache+Php+Mysql-第2张图片

二.linux下安装.html" target="_blank">apache

 

1.tar -zxvf httpd-2.2.4.tar.gz

 

2.cd httpd-2.2.4

 

3. ./configure –prefix=/www --enable-so

 

4.make clean

 

5.make

 

6.make install

 

三.linux下安装.html" target="_blank">php

 

1.tar -zxvf php-5.2.1.tar.gz

 

2.cd php-5.2.1

 

3. ./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-apxs2=/www/bin/apxs

 

4.make clean

 

5.make

 

6.make install

 

apache中加载php模块

 

7 Setup your php.ini

 

cp php.ini-dist /usr/local/lib/php.ini

 

8.. Edit your httpd.conf to load the PHP module.

 

For PHP 4:

 

LoadModule php4_module modules/libphp4.so

 

For PHP 5:

 

LoadModule php5_module modules/libphp5.so

 

9. Tell Apache to parse certain extensions as PHP.

 

AddType application/x-httpd-php .php .phtml

 

AddType application/x-httpd-php-source .phps

      以上就是如何在Linux系统中安装Apache+Php+Mysql的内容,本文内容对学习Linux有一定的参考价值,感兴趣的小伙伴们可以参考一下。

请发表您的评论