Home  >  Article  >  Backend Development  >  PHP server environment construction and Oracle support

PHP server environment construction and Oracle support

WBOY
WBOYOriginal
2016-07-25 08:54:011248browse
  1. rpm -ivh http://nginx.org/packages/centos/6/noarch/rpms/nginx-release-centos-6-0.el6.ngx.noarch.rpm
Copy code

Install epel source:

  1. (64-bit system) rpm -ivh http://download.fedora.redhat.com/pub/epel/6/x86_64/epel-release-6-5.noarch.rpm
  2. (32-bit system ) rpm -ivh http://download.fedora.redhat.com/pub/epel/6/i386/epel-release-6-5.noarch.rpm
Copy code

Install remi source:

  1. rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
Copy the code

Enable remi, edit source settings vim /etc/yum.repos.d/remi.repo Modify enable=1 Install base packages:

  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 ncur ses- 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
Copy code

Install php+ mysql, complete the configuration of the php server, and build the php environment: 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

Modify the user and group of /etc/php-fpm.conf to nginx (apache-->nginx) Modify /var/lib/php/session (so that php can save the session), and the web user group is nginx

  1. chown -r nginx:nginx /var/lib/php/session (if it does not exist, you need to create it)
  2. chown -r nginx:nginx /home/htdocs/(web directory)
  3. chmod -r 775 /home /htdocs/ (The same group can modify permissions to facilitate ftp configuration. ftp should be added to the nginx group. If higher security settings are required, the read-only directory should not be given to nginx. The php group can write permissions)
Copy Code

Set up auto-start

  1. chkconfig nginx on
  2. chkconfig php-fpm on
  3. chkconfig mysqld on
Copy code

Install oci8 support Download oracle-instantclient-basic, oracle-instantclient-devel

Installation: rpm -ivh oracle-instantclient11.2-basic

Download oci8 class library:

  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
Copy the code

After compilation is completed vim /etc/php.d/oci8.ini Add extension=oci8.so

php configuration Total configuration: /etc/php.ini Startup configuration: /etc/php.d/ (directory), /etc/php-zts.d/ (directory)

nginx configuration Total configuration: /etc/nginx/nginx.conf Sub-configuration: /etc/nginx/conf.d/ (directory)

php-fpm configuration Total configuration: /etc/php-fpm.conf Sub-configuration: /etc/php-fpm.d/ (directory) php server environment setup and configuration (apache and iis two methods) How to build a php server environment Configuring php server environment under ubuntu php and mysql server configuration instructions php class to get server information An alternative way to obtain server-side information using php php code to get server information



Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn