在centos上使用phpstudy配置完环境之后,httpd出现了重复安装的情况,
1.查看是否安装httpd:
find / -name httpd
2.更新
yum -y update
3.安装apache
yum install httpd httpd-devel
chkconfig mysqld on 设为开启启动
/etc/init.d/httpd start 启动apache
chkconfig httpd on 设为开机启动
4.安装mysql
yum install mysql mysql-server mysql-devel
/etc/init.d/mysqld start 启动mysql
5.登录mysql修改密码
mysql>; USE mysql;
mysql>; UPDATE user SET Password=PASSWORD('newpassword') WHERE user='root';
mysql>; FLUSH PRIVILEGES;
6.允许远程登录
mysql -u root -p
Enter Password: <your new password>
mysql>GRANT ALL PRIVILEGES ON *.* TO '用户名'@'%' IDENTIFIED BY '密码' WITH GRANT OPTION;
chkconfig mysqld on 设为开机启动项
7.安装PHP
yum install php php-mysql php-common php-gd php-mbstring php-mcrypt php-devel php-xml
/etc/init.d/httpd restart
8.测试
在/var/www/html/新建个test.PHP文件,将以下内容写入,然后保存。
<?
phpinfo();
?>
9.在客户端浏览器里打开http://serverip/test.php,若能成功显示,则表示安装成功。
10.ls cd 进入rpm存放目录,执行rmp安装Oracle
rpm -ivh oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64.rpm
rpm -ivh oracle-instantclient12.1-jdbc-12.1.0.2.0-1.x86_64.rpm
rpm -ivh oracle-instantclient12.1-odbc-12.1.0.2.0-1.x86_64.rpm
rpm -ivh oracle-instantclient12.1-devel-12.1.0.2.0-1.x86_64.rpm
rpm -ivh oracle-instantclient12.1-sqlplus-12.1.0.2.0-1.x86_64.rpm
rpm -ivh oracle-instantclient12.1-tools-12.1.0.2.0-1.x86_64.rpm
11.查找存在oracle名字的路径,判断oracle客户端是否安装成功
find / -name oracle
如果出现三条记录就是安装成功
/usr/include/oracle
/usr/share/oracle
/usr/lib/oracle
12.安装C和C++的编译环境
安装gcc:
yum install gcc
安装g++:
yum install gcc-c++
13.解压php-oci 扩展
tar -zxvf oci8-2.0.12.tgz(http://pecl.php.net/package/oci8)
下载地址:http://pecl.php.net/get/oci8-2.0.12.tgz
14.解压结束后,cd 进入oci8-2.0.12目录
cd oci8-2.0.12
15.编译安装oci8扩展
phpize
./configure
make
make install
16.在/etc/php.d里面编辑oci8.ini,直接粘贴复制下面的代码,保存即可
; Enable oci8 extension module
extension=/usr/lib64/php/modules/oci8.so
17.安装完成后,重启httpd
service httpd restart
18.查看test.php中是否有oci8,如果有表示安装oci8成功。