Heim  >  Artikel  >  Backend-Entwicklung  >  php服务器环境搭建与oracle支持

php服务器环境搭建与oracle支持

WBOY
WBOYOriginal
2016-07-25 08:54:011212Durchsuche
  1. rpm -ivh http://nginx.org/packages/centos/6/noarch/rpms/nginx-release-centos-6-0.el6.ngx.noarch.rpm
复制代码

安装epel源:

  1. (64位系统) rpm -ivh http://download.fedora.redhat.com/pub/epel/6/x86_64/epel-release-6-5.noarch.rpm
  2. (32位系统) rpm -ivh http://download.fedora.redhat.com/pub/epel/6/i386/epel-release-6-5.noarch.rpm
复制代码

安装remi源:

  1. rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
复制代码

开启remi,编辑源设置 vim /etc/yum.repos.d/remi.repo 修改 enable=1 安装基础包:

  1. yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libmcrypt libmcrypt-devel pcre-devel
复制代码

安装php+mysql,完成php服务器的配置,php环境搭建: yum -y install nginx mysql-server php-fpm php-cli php-pdo php-mysql php-mcrypt php-mbstring php-gd php-tidy php-xml php-xmlrpc php-pear php-pecl-memcache php-eaccelerator

修改/etc/php-fpm.conf 的用户和组为nginx(apache-->nginx) 修改/var/lib/php/session(使php能保存session),web用户组为nginx

  1. chown -r nginx:nginx /var/lib/php/session(不存在则需要创建)
  2. chown -r nginx:nginx /home/htdocs/(web目录)
  3. chmod -r 775 /home/htdocs/ (同组可修改权限,方便配置ftp,ftp应该加入到nginx组,如果需要更高的安全设置,则不应当将只读的目录赋予nginx,php组可写权限)
复制代码

设置自启动

  1. chkconfig nginx on
  2. chkconfig php-fpm on
  3. chkconfig mysqld on
复制代码

安装oci8支持 下载oracle-instantclient-basic,oracle-instantclient-devel

安装: rpm -ivh oracle-instantclient11.2-basic

下载oci8类库:

  1. pear download pecl/oci8
  2. tar xvzf oci8
  3. cd oci8
  4. ln -s /usr/include/oracle/11.2/client /usr/lib/oracle/11.2/client/lib/include
  5. phpize
  6. ./configure --with-oci8=shared,instantclient,/usr/lib/oracle/11.2/client/lib/
  7. make all install
复制代码

编译完成后 vim /etc/php.d/oci8.ini 加入extension=oci8.so

php的配置 总配置:/etc/php.ini 启动配置:/etc/php.d/(目录),/etc/php-zts.d/(目录)

nginx的配置 总配置:/etc/nginx/nginx.conf 分配置:/etc/nginx/conf.d/(目录)

php-fpm的配置 总配置:/etc/php-fpm.conf 分配置:/etc/php-fpm.d/(目录) php 服务器环境搭建配置(apache与iis两种方法) php服务器环境搭建方法 ubuntu下配置php服务器环境 php与mysql服务器配置说明 php获取服务器信息的类 php获取服务器端信息的另类方法 php获取服务器信息的一段代码



Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn