-
- rpm -ivh http://nginx.org/packages/centos/6/noarch/rpms/nginx-release-centos-6-0.el6.ngx.noarch.rpm
Copy code
Install epel source:
-
- (64-bit system) rpm -ivh http://download.fedora.redhat.com/pub/epel/6/x86_64/epel-release-6-5.noarch.rpm
- (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:
-
- 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:
-
- 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
-
- chown -r nginx:nginx /var/lib/php/session (if it does not exist, you need to create it)
- chown -r nginx:nginx /home/htdocs/(web directory)
- 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
-
- chkconfig nginx on
- chkconfig php-fpm on
- 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:
-
- pear download pecl/oci8
- tar xvzf oci8
- cd oci8
- ln -s /usr/include/oracle/11.2/client /usr/lib/oracle/11.2/client/lib/include
- phpize
- . /configure --with-oci8=shared,instantclient,/usr/lib/oracle/11.2/client/lib/
- 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
|