centos 安装php5.3,Centos下安装php5.3.10

首先确认己安装apache 2.2.22

安装

先安装 libmcrypt

yum install libmcrypt libmcrypt-devel

安装PHP

./configure \

--prefix=/usr/local/php \

--with-apxs2=/usr/local/apache/bin/apxs \

--with-mysql=/usr/local/mysql \

--with-pdo-mysql=/usr/local/mysql \

--enable-force-cgi-redirect \

--with-gd \

--with-ttf \

--with-openssl \

--enable-gd-native-ttf \

--with-jpeg-dir \

--with-png-dir \

--with-freetype-dir \

--with-zlib \

--with-gettext \

--with-curl \

--with-iconv \

--with-bz2 \

--with-mcrypt \

--enable-soap \

--enable-sockets \

--enable-mbstring=all \

--enable-bcmath \

--enable-ftp \

#> make

#> make install

#> cp php.ini-dist /usr/local/php/lib/php.ini

-------------------------------------------------------------------------------

php.ini中 改:

short_open_tag = On

date.timezone = "Asia/Chongqing"

PHP5.3安装Zend Optimizer,已经被正式改成了“Zend Guard Loader”,

把 ZendGuardLoader.so 拷到 apache/modules下

在php.ini中加入:

zend_extension=/usr/local/apache/modules/ZendGuardLoader.so

zend_loader.enable=1

zend_loader.disable_licensing=0

重启apache

-------------------------------------------------------------------------------

在httpd.conf配置文件中添加::

AddType application/x-httpd-php .php .php3

在DirectoryIndex 一行后添加 index.php

在虚拟主机下加上下一条,控制权限

php_admin_value open_basedir "/tmp/:/usr/local/www/"

测试:编写test.php文件,内容如下:

php

phpinfo();

?>

修改php.ini

屏蔽带来安全隐患的函数

找到disable_functions函数,加入 disable_functions = chmod,exec,system,passthru,shell_exec,escapeshellarg,escapeshellcmd,proc_close,proc_open,ini_alter,dl,popen,curl_exec,popen,pcntl_exec,socket_accept,socket_bind,socket_clear_error,socket_close,socket_connect,socket_create_listen,socket_create_pair,socket_create,socket_get_option,socket_getpeername,socket_getsockname,socket_last_error,socket_listen,socket_read,socket_recv,socket_recvfrom,socket_select,socket_send,socket_sendto,socket_set_block,socket_set_nonblock,socket_set_option,socket_shutdown,socket_strerror,socket_write,stream_socket_client,stream_socket_server,pfsockopen,disk_total_space,disk_free_space,chown,diskfreespace,getrusage,get_current_user,getmyuid,getmypid,dl,leak,listen,chgrp,link,symlink,dlopen,proc_nice,proc_get_stats,proc_terminate,shell_exec,sh2_exec,posix_getpwuid,posix_getgrgid,posix_kill,ini_restore,mkfifo,dbmopen,dbase_open,filepro,filepro_rowcount,posix_mkfifo,putenv,sleep

修改register_globals = on

找到open_basedir

替换成open_basedir = /usr/home

找到upload_tmp_dir

替换成upload_tmp_dir = /usr/home/tmp

找到upload_max_filesize = 2M

替换成upload_max_filesize =30M

post_max_size = 150M

post_max_size 大于upload_max_filesize 为佳

max_execution_time

默认是30秒.改为

max_execution_time = 0

0表示没有限制

phpMyAdmin安装

phpMyAdmin是一个用PHP编写的,可以通过互联网控制和操作MySQL。通过phpMyAdmin可以完全对数据库进行操作,例如建立、复制/删除数据等等。

下载地址 http://www.phpmyadmin.net

将解压出的文件包上传的网站目录下,

找到config.sample.php 和 ./libraties/config.default.php,做以下修改:

# 一般默认

$cfg['Servers'][$i]['host'] = 'localhost';

#  config是不安全的,改成cookie

$cfg['Servers'][$i]['auth_type'] = 'cookie';

#此处随便打几个字符,不超过46个,如果为空,会出现错误

$cfg['blowfish_secret'] = 'abcdefg';

$cfg['DefaultLang'] = 'zh';

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值