php配置:
/usr/local/php/bin/php–i |head
这里找到php.ini的路径
这里找到的php.ini文件最靠谱 、/usr/local/php/etc/php.ini
Vi/usr/local/php/etc/php.ini
配置disable_function
disable_functions = eval,assert,popen,passthru,escapeshellarg,escapeshellcmd,passthru,exec,system,chroot,scandir,chgrp,chown,escapeshellcmd,escapeshellarg,shell_exec,proc_get_status,ini_alter,ini_restore,dl,pfsockopen,openlog,syslog,readlink,symlink,leak,popepassthru,stream_socket_server,popen,proc_open,proc_close
这里要重启http,不然会不生效
vi /usr/local/php/etc/php.ini
. 配置error_log
display_errors=off
log_errors=on
error_log=/path/to/logfile
error_reporting = E_ALL | E_STRICT
这些都要打开(前面的; 去掉)
配置open_basedir (安全的)
vi /usr/local/php/etc/php.ini
open_basedir = /data/www/:/tmp
httpd.conf:
不同的host配置不同的open_basedir
php_admin_value open_basedir "/dir1/:/dir2/"
vi /usr/local/apache2/conf/extra/httpd-vhosts.conf
php_admin_value open_basedir "/tmp/"
/usr/local/apache2/bin/apachectl -t
/usr/local/apache2/bin/apachectl restart
PHP扩展模块
memcache在php中编译
# wget http://www.lishiming.net/data/attachment/forum/memcache-2.2.3.tgz
# tar zxvf memcache-2.2.3.tgz
# cd memcache-2.2.3
/usr/local/php/bin/phpize
这条命令生成config文件
# ./configure --with-php-config=/usr/local/php/bin/php-config
# make
# make install
模块自动放到了这个目标下
/usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/
#查看php extension_dir的方法是 /usr/local/php/bin/php -i |grep extension_dir
vi /usr/local/php/etc/php.ini
然后在php.ini 中添加
extension = memcache.so
加最后面
保存后可以利用 /usr/local/php/bin/php -m 检测和查看具体的参数