groupadd mysql
useradd -g mysql mysql
tar -zxvf Mysql-5.0.32.tar.gz
./configure --prefix=/usr/local/mysql
make
make install
cp support-files/my-medium.cnf /etc/my.cnf
cd /usr/local/mysql
bin/mysql_install_db --user=mysql
chown -R root .
chown -R mysql var
chgrp -R mysql .
bin/mysqld_safe --user=mysql &
-------------------
加入系统服务
cp /usr/local/mysql/share/mysql/mysql.server /etc/init.d/mysql
chkconfig --add mysql
service mysql start
mysqladmin -u root password "123456" #123456是密码
---------------------------
#如果你修改数据库密码是碰到了socket '/tmp/mysql.sock' 错误 ,则你需要执行
#下面这个命令,mysql安装后的mysql.sock默认路径是/var/lib/mysql/mysql.sock
ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock
-----------------------------
apache
tar -zxvf httpd-2.2.8.tar.gz
cd httpd-2.2.8
./configure --prefix=/usr/local/apache --enable-so
make
make install
/usr/local/apache/bin/apachectl start #启动服务
echo "/usr/local/apache/bin/apachectl start" >> /etc/rc.d/rc.local #开机启动
------------------
php
tar -zxvf php-5.2.6.tar.gz
./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-xml --with-mysql=/usr/local/mysql --with-zlib
make
make install
cp php.ini-dist /usr/local/php/lib/php.ini
vi /usr/local/apache/conf/httpd.conf
在AddType application/x-gzip .gz .tgz行下加入下面2行
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
/usr/local/apache/bin/apachectl restart重启apache生效
测试
测试也很简单,在/usr/local/apache/htdocs/下面建立一个phpinfo.php文件,里面写
phpinfo();
?>
然后呢,在浏览器里面输入“”,如果页面上出现了PHP的版权信息及系统配置情况,说明你的PHP已经可以使用了
阅读(802) | 评论(0) | 转发(0) |