RHEL5下Mysql-5.0.87+apache-2.2.14+php-5.2.11的安装笔记
但只是把mysql apache php的 版本升级为最新,尝试安装,
并不是在已有的基础上分别进行软件包的升级,而是全新的安装,
差别就是现在的版本较高
我的安装顺序还是 先安装mysql 在安装apache 在安装php 最后进行简单的测试
关于mysql 5.0.87的安装
参考
在此不再详细说明了
clip_image002
以上是 操作系统的相关情况
[root@localhost ~]# cd /usr/local/src
下载apache
clip_image004
clip_image006
下面开始安装apache
[root@localhost src]# tar -zxvf httpd-2.2.14.tar.gz
clip_image008
[root@localhost src]# cd httpd-2.2.14
[root@localhost httpd-2.2.14]# ./configure --prefix=/usr/local/apache --enable-module=so
clip_image010
clip_image012
执行命令 make && make install
clip_image014
[root@localhost httpd-2.2.14]# /usr/local/apache/bin/apachectl start
启动apache
[root@localhost httpd-2.2.14]# netstat -tnl
查看端口,看看80起来没
clip_image016
clip_image018
解压php
clip_image020
clip_image022
进入安装目录
[root@localhost php-5.2.11]# ./configure \
> --prefix=/usr/local/php \
> --with-mysql=/usr/local/mysql \
> --with-apxs2=/usr/local/apache/bin/apxs
这里只是做个最基本的安装而已
指定一下路径
clip_image024
clip_image026
执行命令,make && make install
clip_image028
clip_image030
clip_image032
虽然装完了,但是貌似有一大堆的错误
我们暂且拷贝一下配置文件,然后写个简单的测试页,看行不行
[root@localhost php-5.2.11]# cp php.ini-dist /usr/local/lib/php.ini
复制配置文件
修改apache配置文件 使其能够识别.PHP结尾的网页文件
[root@localhost php-5.2.11]# vi /usr/local/apache/conf/httpd.conf
AddType application/x-httpd-php .php
clip_image034
clip_image036
[root@localhost ~]# /usr/local/mysql/bin/mysqladmin -u root password 123
[root@localhost ~]# /usr/local/mysql/bin/mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.0.87-log Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123' WITH GRANT OPTION;
Query OK, 0 rows affected (0.02 sec)
mysql>
赋予root用户登录数据库密码,并赋予远程密码
写一个测试脚本
[root@localhost php-5.2.11]# vi /usr/local/apache/htdocs/index.php
clip_image038
clip_image040
很奇怪的是虽然有错误,但还是可以正常运行
改一下测试页试试
[root@localhost php-5.2.11]# vi /usr/local/apache/htdocs/index.php
clip_image042
<?
echo "hello world !!";
mysql_connect ("192.168.1.14","root","123");
mysql_query ("create database test1;");
?>
clip_image044
clip_image046
登录数据库,看看是不是有test1 数据库
Ok,到此为止,php可以正常运行 并且可以连接数据库
关于
Warning: Cannot use a scalar value as an array in phar://install-pear-nozlib.phar/PEAR/ChannelFile.php on line 1391
Warning: Cannot use a scalar value as an array in phar://install-pear-nozlib.phar/PEAR/ChannelFile.php on line 1396错误
网上说这是一个
 
 
Bug #49682
Pear broken in php 5.2.11
http://bugs.php.net/bug.php?id=49682
 
   
解决方法
 
clip_image048
[root@localhost php-5.2.11]# rm -rf /usr/local/php/lib/php/.channels
[root@localhost php-5.2.11]# /usr/local/php/bin/pecl update-channels