入住 CI 中国社区 登录
CodeIgniter 中国开发者社区 返回首页

新心的个人空间 https://codeigniter.org.cn/forums/?16524 [收藏] [复制] [分享] [RSS]

日志

Centos5.5+apache+php+postgresql环境搭建

已有 2181 次阅读2012-7-6 10:15 |个人分类:学习笔记| 环境配置

1.       安装Centos

2.       安装所需要的字体包如中文、日文、韩文等

yum install fonts-chinese #中文

yum install fonts-japanese #日文

yum install fonts-korean #韩文

3.       安装apache

yum install httpd

service httpd start          #启动apache服务器

4.       安装php

yum install php

测试一下:在/var/www/html下建一个test.php文件,里面写入:<?php phpinfo();?>,保存。在浏览器中输入127.0.0.1/test.php,若出现php配置页面则说明配置成功,若没有出现,可能是由于如下原因:

(1)       权限问题

chmod 755 /var/www –R    #改变/var/www目录下的权限   

(2)       SELinux的问题

关闭SELinuxgedit /etc/selinux/config

找到SELINUX=enforcing enforing改成disabled,重启系统。

       并在/etc/php.ini中把display_errors改为On

5.  安装json

       1.   若没有则安装php-devel

              yum install php-devel

    2.  wget http://pecl.php.net/get/json -O json-1.2.1.tgz               tar -xf json-1.2.1.tgz               cd json-1.2.1               phpize               ./configure               make               make install

echo "extension=json.so" >> /etc/php.ini    # 这一句根据自己的环境执行

若安装成功则会在phpinfo中显示相关信息:

json

 

json support

enabled

json version

1.2.1

 

6 安装postgresql

http://www.enterprisedb.com/products-services-training/pgdownload中下载Version 8.3.18  linux32位版本,添加可执行权限即可直接双击安装,安装完包含pgadmin3

7 安装php-psql

yum install php-pgsql

重启apachepostgresql

service httpd restart

postgresql直接在菜单中点PostgreSQL8.3->Restart server

8 配置vnc以便远程访问

a)         Centos5.5默认安装了vnc,如果没有安装运行yum install vnc vnc-server进行安装。

b)        gedit /etc/sysconfig/vncservers

在文件中添加下面两行命令

VNCSERVERS="1:root"           --指定远程用户

VNCSERVERARGS[1]="-geometry 1024x768"      --指定远程桌面分辨率

c)        设置密码

vncpasswd

d)        关闭防火墙

service iptables –F

service iptables save

e)         gedit ~/.vnc/xstartuptwm&一行注释掉,添加一行gnome –session&,取消unsetexec两行的注释,若没有此文件先启动一次vnc

/sbin/service vncserver start

f)         重新启动vnc服务

/sbin/service vncserver restart


路过

雷人

握手

鲜花

鸡蛋

评论 (0 个评论)

facelist doodle 涂鸦板

您需要登录后才可以评论 登录 | 入住 CI 中国社区