安装nginx源:
复制代码 代码示例:
rpm -ivh http://nginx.org/packages/
centos/6/noarch/rpms/nginx-release-centos-6-0.el6.ngx.noarch.rpm
安装epel源:
复制代码 代码示例:
(
64位系统) rpm -ivh http://download.fedora.
redhat.com/pub/epel/6/x86_64/epel-release-6-5.noarch.rpm
(
32位系统) rpm -ivh http://download.fedora.redhat.com/pub/epel/6/i386/epel-release-6-5.noarch.rpm
安装remi源:
复制代码 代码示例:
rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
开启remi,编辑源设置
vim /etc/yum.repos.d/remi.repo
修改 enable=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
复制代码 代码示例:
chown -r nginx:nginx /var/lib/php/session(不存在则需要创建)
chown -r nginx:nginx /home/htdocs/(web目录)
chmod -r 775 /home/htdocs/ (同组可修改权限,方便配置ftp,ftp应该加入到nginx组,如果需要更高的安全设置,则不应当将只读的目录赋予nginx,php组可写权限)
设置自启动
复制代码 代码示例:
chkconfig nginx on
chkconfig php-fpm on
chkconfig mysqld on
安装oci8支持
下载oracle-instantclient-basic,oracle-instantclient-devel
安装:
rpm -ivh oracle-instantclient11.2-basic
下载oci8类库:
复制代码 代码示例:
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
编译完成后
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获取服务器信息的一段代码