You must say:"Yes" or "All right"! 注册 | 登陆
浏览模式: 标准 | 列表Tag:php

PHP CURL模拟GET及POST函数

PHP代码
  1. <?php   
  2. function vcurl($url$post = ''$cookie = ''$cookiejar = ''$referer = ''){   
  3.     $tmpInfo = '';   
  4.     $cookiepath = getcwd().'./'.$cookiejar;   
  5.     $curl = curl_init();   
  6.     curl_setopt($curl, CURLOPT_URL, $url);   
  7.     curl_setopt($curl, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);   
  8.     if($referer) {   
  9.     curl_setopt($curl, CURLOPT_REFERER, $referer);   
  10.     } else {   
  11.     curl_setopt($curl, CURLOPT_AUTOREFERER, 1);    
  12.     }   
  13.     if($post) {   
  14.     curl_setopt($curl, CURLOPT_POST, 1);    
  15.     curl_setopt($curl, CURLOPT_POSTFIELDS, $post);   
  16.     }   
  17.     if($cookie) {   
  18.     curl_setopt($curl, CURLOPT_COOKIE, $cookie);   
  19.     }   
  20.     if($cookiejar) {   
  21.     curl_setopt($curl, CURLOPT_COOKIEJAR, $cookiepath);   
  22.     curl_setopt($curl, CURLOPT_COOKIEFILE, $cookiepath);   
  23.     }   
  24.     //curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);   
  25.     curl_setopt($curl, CURLOPT_TIMEOUT, 100);   
  26.     curl_setopt($curl, CURLOPT_HEADER, 0);   
  27.     curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);   
  28.     $tmpInfo = curl_exec($curl);   
  29.     if (curl_errno($curl)) {   
  30.        echo '<pre><b>错误:</b><br />'.curl_error($curl);   
  31.     }   
  32.     curl_close($curl);   
  33.     return $tmpInfo;   
  34. }   
  35. ?>  

新版函数,更加简洁了,HOHO!

Tags: php, curl

出自DISCUZ的PHP MYSQL操作类

PHP代码
  1. <?php   
  2.     
  3. //include("config.php");   
  4. define('db_host','localhost'); //数据库服务器   
  5. define('db_user','root');      //数据库用户名   
  6. define('dbpw','');    //数据库密码   
  7. define('dbname','test');  //数据库名   
  8. define('dbcharset','utf8');    //数据库编码,不建议修改   
  9.     
  10. //$db = new mysql($dbhost='', $dbuser='', $dbpw='', $dbname = 'test222', $pconnect = 0);   
  11.     
  12. /**  
  13. include("inc/mysql.class.php");  
  14.    
  15. $db = new mysql();  
  16.    
  17. $query = $db->query("select * from test order by ID DESC");  
  18.    
  19. //取一条记录  
  20. $res = $db->fetch_row($query);  
  21.    
  22. //取所有记录  
  23. $res = $db->fetch_all($query);  
  24.    
  25. //插入  
  26. $db->query("insert into test values (3,'测试222222222','test','fffff')");  
  27.    
  28.    
  29. //mysql_result 只取一个时  
  30. $query = $db->query("select title from test order by ID DESC");  
  31. $rs = $db->result($query,0);  
  32. print_r($rs);  
  33.    
  34. //查询  
  35. $query = $db->query("select * from test order by ID DESC");  
  36. while($rw = $db->fetch_array($query))  
  37. {  
  38.     print_r($rw);  
  39. }  
  40.    
  41.    
  42. **/  
  43.     
  44.     
  45.     
  46. /**  
  47.  * mysql查询类  
  48.  * 改造自discuz的mysql查询类  
  49.  */  
  50. class mysql {   
  51.     /**  
  52.      * 查询总次数  
  53.      *  
  54.      * @var int  
  55.      */  
  56.     var $querynum = 0;   
  57.     /**  
  58.      * 连接句柄  
  59.      *  
  60.      * @var object  
  61.      */  
  62.     var $link;   
  63.     
  64.     /**  
  65.      * 定义一些默认的变量  
  66.      */  
  67.     private $dbhost = db_host;   
  68.     private $dbname = dbname;   
  69.     private $dbuser = db_user;   
  70.     private $dbpw = dbpw;   
  71.     private $dbcharset = dbcharset;   
  72.     
  73.     /**  
  74.      * 构造函数  
  75.      *  
  76.      * @param string $dbhost 主机名  
  77.      * @param string $dbuser 用户  
  78.      * @param string $dbpw   密码  
  79.      * @param string $dbname 数据库名  
  80.      * @param int $pconnect 是否持续连接  
  81.      */  
  82.     function mysql($dbhost=''$dbuser=''$dbpw=''$dbname = ''$pconnect = 0) {   
  83.     
  84.         $dbhost==''?$dbhost=$this->dbhost:$dbhost;   
  85.         $dbuser==''?$dbuser=$this->dbuser:$dbuser;   
  86.         $dbpw==''?$dbpw=$this->dbpw:$dbpw;   
  87.         $dbname==''?$dbname=$this->dbname:$dbname;   
  88.     
  89.         if($pconnect) {   
  90.             if(!$this->link = @mysql_pconnect($dbhost$dbuser$dbpw)) {   
  91.                 $this->halt('Can not connect to MySQL server');   
  92.             }   
  93.         } else {   
  94.             if(!$this->link = @mysql_connect($dbhost$dbuser$dbpw)) {   
  95.                 $this->halt('Can not connect to MySQL server');   
  96.             }   
  97.         }   
  98.         if($this->version() > '4.1') {   
  99.             if($this->dbcharset) {   
  100.                 mysql_query("SET character_set_connection=$this->dbcharset, character_set_results=$this->dbcharset, character_set_client=binary"$this->link);   
  101.             }   
  102.     
  103.             if($this->version() > '5.0.1') {   
  104.                 mysql_query("SET sql_mode=''"$this->link);   
  105.             }   
  106.         }   
  107.     
  108.         if($dbname) {   
  109.             mysql_select_db($dbname$this->link);   
  110.         }   
  111.     
  112.     }   
  113.     /**  
  114.      * 选择数据库  
  115.      *  
  116.      * @param string $dbname  
  117.      * @return  
  118.      */  
  119.     function select_db($dbname) {   
  120.         return mysql_select_db($dbname$this->link);   
  121.     }   
  122.     /**  
  123.      * 取出结果集中一条记录  
  124.      *  
  125.      * @param object $query  
  126.      * @param int $result_type  
  127.      * @return array  
  128.      */  
  129.     function fetch_array($query$result_type = MYSQL_ASSOC) {   
  130.         return mysql_fetch_array($query$result_type);   
  131.     }   
  132.     
  133.     /**  
  134.      * 取出所有结果  
  135.      *  
  136.      * @param object $query  
  137.      * @param int $result_type  
  138.      * @return array  
  139.      */  
  140.     function fetch_all($query$result_type = MYSQL_ASSOC) {   
  141.         $result = array();   
  142.         $num = 0;   
  143.     
  144.         while($ret = mysql_fetch_array($query$result_type))   
  145.         {   
  146.             $result[$num++] = $ret;   
  147.         }   
  148.         return $result;   
  149.     
  150.     }   
  151.     
  152.     /**  
  153.      * 从结果集中取得一行作为枚举数组  
  154.      *  
  155.      * @param object $query  
  156.      * @return array  
  157.      */  
  158.     function fetch_row($query) {   
  159.         $query = mysql_fetch_row($query);   
  160.         return $query;   
  161.     }   
  162.     
  163.     /**  
  164.      * 返回查询结果  
  165.      *  
  166.      * @param object $query  
  167.      * @param string $row  
  168.      * @return mixed  
  169.      */  
  170.     function result($query$row) {   
  171.         $query = @mysql_result($query$row);   
  172.         return $query;   
  173.     }   
  174.     
  175.     
  176.     /**  
  177.      * 查询SQL  
  178.      *  
  179.      * @param string $sql  
  180.      * @param string $type  
  181.      * @return object  
  182.      */  
  183.     function query($sql$type = '') {   
  184.     
  185.         $func = $type == 'UNBUFFERED' && @function_exists('mysql_unbuffered_query') ?   
  186.             'mysql_unbuffered_query' : 'mysql_query';   
  187.         if(!($query = $func($sql$this->link)) && $type != 'SILENT') {   
  188.             $this->halt('MySQL Query Error: '$sql);   
  189.         }   
  190.     
  191.         $this->querynum++;   
  192.         return $query;   
  193.     }   
  194.     /**  
  195.      * 取影响条数  
  196.      *  
  197.      * @return int  
  198.      */  
  199.     function affected_rows() {   
  200.         return mysql_affected_rows($this->link);   
  201.     }   
  202.     /**  
  203.      * 返回错误信息  
  204.      *  
  205.      * @return array  
  206.      */  
  207.     function error() {   
  208.         return (($this->link) ? mysql_error($this->link) : mysql_error());   
  209.     }   
  210.     /**  
  211.      * 返回错误代码  
  212.      *  
  213.      * @return int  
  214.      */  
  215.     function errno() {   
  216.         return intval(($this->link) ? mysql_errno($this->link) : mysql_errno());   
  217.     }   
  218.     
  219.     /**  
  220.      * 结果条数  
  221.      *  
  222.      * @param object $query  
  223.      * @return int  
  224.      */  
  225.     function num_rows($query) {   
  226.         $query = mysql_num_rows($query);   
  227.         return $query;   
  228.     }   
  229.     /**  
  230.      * 取字段总数  
  231.      *  
  232.      * @param object $query  
  233.      * @return int  
  234.      */  
  235.     function num_fields($query) {   
  236.         return mysql_num_fields($query);   
  237.     }   
  238.     /**  
  239.      * 释放结果集  
  240.      *  
  241.      * @param object $query  
  242.      * @return bool  
  243.      */  
  244.     function free_result($query) {   
  245.         return mysql_free_result($query);   
  246.     }   
  247.     /**  
  248.      * 返回自增ID  
  249.      *  
  250.      * @return int  
  251.      */  
  252.     function insert_id() {   
  253.         return ($id = mysql_insert_id($this->link)) >= 0 ? $id : $this->result($this->query("SELECT last_insert_id()"), 0);   
  254.     }   
  255.     
  256.     /**  
  257.      * 从结果集中取得列信息并作为对象返回  
  258.      *  
  259.      * @param object $query  
  260.      * @return object  
  261.      */  
  262.     function fetch_fields($query) {   
  263.         return mysql_fetch_field($query);   
  264.     }   
  265.     /**  
  266.      * 返回mysql版本  
  267.      *  
  268.      * @return string  
  269.      */  
  270.     function version() {   
  271.         return mysql_get_server_info($this->link);   
  272.     }   
  273.     /**  
  274.      * 关闭连接  
  275.      *  
  276.      * @return bool  
  277.      */  
  278.     function close() {   
  279.         return mysql_close($this->link);   
  280.     }   
  281.     /**  
  282.      * 输出错误信息  
  283.      *  
  284.      * @param string $message  
  285.      * @param string $sql  
  286.      */  
  287.     function halt($message = ''$sql = '') {   
  288.         echo $message . ' ' . $sql;   
  289.         exit;   
  290.     
  291.     }   
  292. }   
  293. ?>  

Tags: php, mysql

DeZend工具

这篇日志被加密了,请输入密码后查看。

PHP使用GD库实现截屏

PHP5.2.2以上版本的GD库实现了两个截屏函数 imagegrabscreen imagegrabwindow ,分别用于截取整个屏幕和截取某个窗口(同ALT+PrintScreen)的屏幕。

1. 截取整个屏幕 Screenshot

PHP代码
  1. <?php   
  2. $im = imagegrabscreen();   
  3. imagepng($im"myscreenshot.png");   
  4. ?>  

2. 截取一个窗口 Capture a window (IE for example)

PHP代码
  1. <?php   
  2. $browser = new COM("InternetExplorer.Application");   
  3. $handle = $browser->HWND;   
  4. $browser->Visible = true;   
  5. $im = imagegrabwindow($handle);   
  6. $browser->Quit();   
  7. imagepng($im"iesnap.png");   
  8. $im = imagegrabscreen();   
  9. ?>  

3. 截取IE内容 Capture a window (IE for example) but with its content!

PHP代码
  1. <?php   
  2. $browser = new COM("InternetExplorer.Application");   
  3. $handle = $browser->HWND;   
  4. $browser->Visible = true;   
  5. $browser->Navigate("http://www.kalvin.cn/");   
  6.     
  7. /* Still working? */  
  8. while ($browser->Busy) {   
  9.     com_message_pump(4000);   
  10. }   
  11. $im = imagegrabwindow($handle, 0);   
  12. $browser->Quit();   
  13. imagepng($im"iesnap.png");   
  14. ?>  

4. 截取IE的全屏模式 IE in fullscreen mode

PHP代码
  1. <?php   
  2. $browser = new COM("InternetExplorer.Application");   
  3. $handle = $browser->HWND;   
  4.     
  5. $browser->Visible = true;   
  6. $browser->FullScreen = true;   
  7. $browser->Navigate("http://www.kalvin.cn/");   
  8.     
  9. /* Is it completely loaded? (be aware of frames!)*/  
  10. while ($browser->Busy) {   
  11.     com_message_pump(4000);   
  12. }   
  13. $im = imagegrabwindow($handle, 0);   
  14. $browser->Quit();   
  15. imagepng($im"iesnap.png");   
  16. ?>  

上面就是说如何使用PHP COM调用IE窗口打开网页进行截屏,但很多朋友得到的结果只是一张纯黑的图片,这是为什么呢?

可能有两种情况,第一种情况就是这个COM组件只适用于WINDOWS服务器,其它系统的服务器是不支持的,因为他没有IE浏览器,第二种情况就是没有打开允许服务与桌面交互!其中第二种情况最为常见,打开的方法就是点击计算机(我的电脑) -> 右键 -> 管理 -> 服务和应用程序 -> 服务 -> Apache(我自己使用apache服务器) -> 右键 -> 属性 -> 登录 -> 登录身份下面既是!

Tags: php, gd

Php ini_set ini_get可操作配置参数列表

为了使自己的程序在不同的平台中拥有更好的兼容性,很多时候我们都要获取当前Php的运行环境参数。比如我们常用到的:获取 magic_quotes_gpc状态,来决定当表单提交时我们是否转义(addslashes)数据;设定max_execution_time来延长 程序的执行时间;设定error_reporting使自己的项目在开发与运营阶段切换;设定memory_limit加大内存等等…

ini_set(string varname, string newvalue ) : 设定环境配置的参数

ini_get(string varname) : 获取环境配置的参数

参数列表如下:

Name Default Changeable
com.allow_dcom "0" PHP_INI_SYSTEM
com.autoregister_typelib "0" PHP_INI_SYSTEM
com.autoregister_verbose "0" PHP_INI_SYSTEM
com.autoregister_casesensitive "1" PHP_INI_SYSTEM
com.typelib_file "" PHP_INI_SYSTEM
crack.default_dictionary NULL PHP_INI_SYSTEM
exif.encode_unicode "ISO-8859-15" PHP_INI_ALL
exif.decode_unicode_motorola "UCS-2BE" PHP_INI_ALL
exif.decode_unicode_intel "UCS-2LE" PHP_INI_ALL
exif.encode_jis "" PHP_INI_ALL
exif.decode_jis_motorola "JIS" PHP_INI_ALL
exif.decode_jis_intel "JIS" PHP_INI_ALL
fbsql.allow_persistent "1" PHP_INI_SYSTEM
fbsql.generate_warnings "0" PHP_INI_SYSTEM
fbsql.autocommit "1" PHP_INI_SYSTEM
fbsql.max_persistent "-1" PHP_INI_SYSTEM
fbsql.max_links "128" PHP_INI_SYSTEM
fbsql.max_connections "128" PHP_INI_SYSTEM
fbsql.max_results "128" PHP_INI_SYSTEM
fbsql.batchSize "1000" PHP_INI_SYSTEM
fbsql.default_host NULL PHP_INI_SYSTEM
fbsql.default_user "_SYSTEM" PHP_INI_SYSTEM
fbsql.default_password "" PHP_INI_SYSTEM
fbsql.default_database "" PHP_INI_SYSTEM
fbsql.default_database_password "" PHP_INI_SYSTEM
hwapi.allow_persistent "0" PHP_INI_SYSTEM
hyperwave.allow_persistent "0" PHP_INI_SYSTEM
hyperwave.default_port "418" PHP_INI_ALL
iconv.input_encoding ICONV_INPUT_ENCODING PHP_INI_ALL
iconv.output_encoding ICONV_OUTPUT_ENCODING PHP_INI_ALL
iconv.internal_encoding ICONV_INTERNAL_ENCODING PHP_INI_ALL
ifx.allow_persistent "1" PHP_INI_SYSTEM
ifx.max_persistent "-1" PHP_INI_SYSTEM
ifx.max_links "-1" PHP_INI_SYSTEM
ifx.default_host NULL PHP_INI_SYSTEM
ifx.default_user NULL PHP_INI_SYSTEM
ifx.default_password NULL PHP_INI_SYSTEM
ifx.blobinfile "1" PHP_INI_ALL
ifx.textasvarchar "0" PHP_INI_ALL
ifx.byteasvarchar "0" PHP_INI_ALL
ifx.charasvarchar "0" PHP_INI_ALL
ifx.nullformat "0" PHP_INI_ALL
ingres.allow_persistent "1" PHP_INI_SYSTEM
ingres.max_persistent "-1" PHP_INI_SYSTEM
ingres.max_links "-1" PHP_INI_SYSTEM
ingres.default_database NULL PHP_INI_ALL
ingres.default_user NULL PHP_INI_ALL
ingres.default_password NULL PHP_INI_ALL
ibase.allow_persistent "1" PHP_INI_SYSTEM
ibase.max_persistent "-1" PHP_INI_SYSTEM
ibase.max_links "-1" PHP_INI_SYSTEM
ibase.default_user NULL PHP_INI_ALL
ibase.default_password NULL PHP_INI_ALL
ibase.timestampformat "%m/%d/%Y%H:%M:%S" PHP_INI_ALL
ibase.dateformat "%m/%d/%Y" PHP_INI_ALL
ibase.timeformat "%H:%M:%S" PHP_INI_ALL
java.class.path NULL PHP_INI_ALL
java.home NULL PHP_INI_ALL
java.library.path NULL PHP_INI_ALL
java.library JAVALIB PHP_INI_ALL
java.library NULL PHP_INI_ALL
ldap.max_links "-1" PHP_INI_SYSTEM
mbstring.detect_order NULL PHP_INI_ALL
mbstring.http_input NULL PHP_INI_ALL
mbstring.http_output NULL PHP_INI_ALL
mbstring.internal_encoding NULL PHP_INI_ALL
mbstring.substitute_character NULL PHP_INI_ALL
mbstring.func_overload "0" PHP_INI_SYSTEM
mcrypt.algorithms_dir NULL PHP_INI_ALL
mcrypt.modes_dir NULL PHP_INI_ALL
mime_magic.magicfile "/usr/share/misc/magic.mime" PHP_INI_SYSTEM
mssql.allow_persistent "1" PHP_INI_SYSTEM
mssql.max_persistent "-1" PHP_INI_SYSTEM
mssql.max_links "-1" PHP_INI_SYSTEM
mssql.max_procs "25" PHP_INI_ALL
mssql.min_error_severity "10" PHP_INI_ALL
mssql.min_message_severity "10" PHP_INI_ALL
mssql.compatability_mode "0" PHP_INI_ALL
mssql.connect_timeout "5" PHP_INI_ALL
mssql.timeout "60" PHP_INI_ALL
mssql.textsize "-1" PHP_INI_ALL
mssql.textlimit "-1" PHP_INI_ALL
mssql.batchsize "0" PHP_INI_ALL
mssql.datetimeconvert "1" PHP_INI_ALL
mssql.secure_connection "0" PHP_INI_SYSTEM
mysql.allow_persistent "1" PHP_INI_SYSTEM
mysql.max_persistent "-1" PHP_INI_SYSTEM
mysql.max_links "-1" PHP_INI_SYSTEM
mysql.default_host NULL PHP_INI_ALL
mysql.default_user NULL PHP_INI_ALL
mysql.default_password NULL PHP_INI_ALL
mysql.default_port NULL PHP_INI_ALL
mysql.default_socket NULL PHP_INI_ALL
ncurses.value "42" PHP_INI_ALL
ncurses.string "foobar" PHP_INI_ALL
odbc.allow_persistent "1" PHP_INI_SYSTEM
odbc.max_persistent "-1" PHP_INI_SYSTEM
odbc.max_links "-1" PHP_INI_SYSTEM
odbc.default_db NULL PHP_INI_ALL
odbc.default_user NULL PHP_INI_ALL
odbc.default_pw NULL PHP_INI_ALL
odbc.defaultlrl "4096" PHP_INI_ALL
odbc.defaultbinmode "1" PHP_INI_ALL
odbc.check_persistent "1" PHP_INI_SYSTEM
pfpro.defaulthost "test.signio.com"  
pfpro.defaulthost "test-payflow.verisign.com"  
pfpro.defaultport "443" PHP_INI_ALL
pfpro.defaulttimeout "30" PHP_INI_ALL
pfpro.proxyaddress "" PHP_INI_ALL
pfpro.proxyport "" PHP_INI_ALL
pfpro.proxylogon "" PHP_INI_ALL
pfpro.proxypassword "" PHP_INI_ALL
pgsql.allow_persistent "1" PHP_INI_SYSTEM
pgsql.max_persistent "-1" PHP_INI_SYSTEM
pgsql.max_links "-1" PHP_INI_SYSTEM
pgsql.auto_reset_persistent "0" PHP_INI_SYSTEM
pgsql.ignore_notice "0" PHP_INI_ALL
pgsql.log_notice "0" PHP_INI_ALL
session.save_path "/tmp" PHP_INI_ALL
session.name "PHPSESSID" PHP_INI_ALL
session.save_handler "files" PHP_INI_ALL
session.auto_start "0" PHP_INI_ALL
session.gc_probability "1" PHP_INI_ALL
session.gc_divisor "100" PHP_INI_ALL
session.gc_maxlifetime "1440" PHP_INI_ALL
session.serialize_handler "php" PHP_INI_ALL
session.cookie_lifetime "0" PHP_INI_ALL
session.cookie_path "/" PHP_INI_ALL
session.cookie_domain "" PHP_INI_ALL
session.cookie_secure "" PHP_INI_ALL
session.use_cookies "1" PHP_INI_ALL
session.use_only_cookies "0" PHP_INI_ALL
session.referer_check "" PHP_INI_ALL
session.entropy_file "" PHP_INI_ALL
session.entropy_length "0" PHP_INI_ALL
session.cache_limiter "nocache" PHP_INI_ALL
session.cache_expire "180" PHP_INI_ALL
session.use_trans_sid "0" PHP_INI_SYSTEM
PHP_INI_PERDIR
session.encode_sources "globals,track" PHP_INI_ALL
assert.active "1" PHP_INI_ALL
assert.bail "0" PHP_INI_ALL
assert.warning "1" PHP_INI_ALL
assert.callback NULL PHP_INI_ALL
assert.quiet_eval "0" PHP_INI_ALL
safe_mode_protected_env_vars SAFE_MODE_PROTECTED_ENV_VARS PHP_INI_SYSTEM
safe_mode_allowed_env_vars SAFE_MODE_ALLOWED_ENV_VARS PHP_INI_SYSTEM
url_rewriter.tags "a=href,area=href,
frame=src,
form=fakeentry"
PHP_INI_ALL
sybct.allow_persistent "1" PHP_INI_SYSTEM
sybct.max_persistent "-1" PHP_INI_SYSTEM
sybct.max_links "-1" PHP_INI_SYSTEM
sybct.min_server_severity "10" PHP_INI_ALL
sybct.min_client_severity "10" PHP_INI_ALL
sybct.hostname NULL PHP_INI_ALL
vpopmail.directory "" PHP_INI_ALL
zlib.output_compression "0" PHP_INI_SYSTEM
PHP_INI_PERDIR
zlib.output_compression_level "-1" PHP_INI_ALL
define_syslog_variables "0" PHP_INI_ALL
highlight.bg HL_BG_COLOR PHP_INI_ALL
highlight.comment HL_COMMENT_COLOR PHP_INI_ALL
highlight.default HL_DEFAULT_COLOR PHP_INI_ALL
highlight.html HL_HTML_COLOR PHP_INI_ALL
highlight.keyword HL_KEYWORD_COLOR PHP_INI_ALL
highlight.string HL_StrING_COLOR PHP_INI_ALL
allow_call_time_pass_reference "1" PHP_INI_SYSTEM
PHP_INI_PERDIR
asp_tags "0" PHP_INI_SYSTEM
PHP_INI_PERDIR
display_errors "1" PHP_INI_ALL
display_startup_errors "0" PHP_INI_ALL
enable_dl "1" PHP_INI_SYSTEM
expose_php "1" PHP_INI_SYSTEM
html_errors "1" PHP_INI_ALL
xmlrpc_errors "0" PHP_INI_SYSTEM
xmlrpc_error_number "0" PHP_INI_ALL
ignore_user_abort "0" PHP_INI_ALL
implicit_flush "0" PHP_INI_ALL
log_errors "0" PHP_INI_ALL
log_errors_max_len "1024" PHP_INI_ALL
ignore_repeated_errors "0" PHP_INI_ALL
ignore_repeated_source "0" PHP_INI_ALL
magic_quotes_gpc "1" PHP_INI_PERDIR
PHP_INI_SYSTEM
magic_quotes_runtime "0" PHP_INI_ALL
magic_quotes_sybase "0" PHP_INI_ALL
output_buffering "0" PHP_INI_PERDIR
PHP_INI_SYSTEM
output_handler NULL PHP_INI_PERDIR
PHP_INI_SYSTEM
register_argc_argv "1" PHP_INI_PERDIR
PHP_INI_SYSTEM
register_globals "0" PHP_INI_PERDIR
PHP_INI_SYSTEM
safe_mode "1" PHP_INI_SYSTEM
safe_mode "0" PHP_INI_SYSTEM
safe_mode_include_dir NULL PHP_INI_SYSTEM
safe_mode_gid "0" PHP_INI_SYSTEM
short_open_tag DEFAULT_SHORT_OPEN_TAG PHP_INI_SYSTEM
PHP_INI_PERDIR
sql.safe_mode "0" PHP_INI_SYSTEM
track_errors "0" PHP_INI_ALL
y2k_compliance "0" PHP_INI_ALL
unserialize_callback_func NULL PHP_INI_ALL
arg_separator.output "&" PHP_INI_ALL
arg_separator.input "&" PHP_INI_SYSTEM
PHP_INI_PERDIR
auto_append_file NULL PHP_INI_SYSTEM
PHP_INI_PERDIR
auto_prepend_file NULL PHP_INI_SYSTEM
PHP_INI_PERDIR
doc_root NULL PHP_INI_SYSTEM
default_charset SAPI_DEFAULT_CHARSET PHP_INI_ALL
default_mimetype SAPI_DEFAULT_MIMETYPE PHP_INI_ALL
error_log NULL PHP_INI_ALL
extension_dir PHP_EXTENSION_DIR PHP_INI_SYSTEM
gpc_order "GPC" PHP_INI_ALL
include_path PHP_INCLUDE_PAth PHP_INI_ALL
max_execution_time "30" PHP_INI_ALL
open_basedir NULL PHP_INI_SYSTEM
safe_mode_exec_dir "1" PHP_INI_SYSTEM
upload_max_filesize "2M" PHP_INI_SYSTEM
PHP_INI_PERDIR
file_uploads "1" PHP_INI_SYSTEM
post_max_size "8M" PHP_INI_SYSTEM
PHP_INI_PERDIR
upload_tmp_dir NULL PHP_INI_SYSTEM
user_dir NULL PHP_INI_SYSTEM
variables_order NULL PHP_INI_ALL
error_append_string NULL PHP_INI_ALL
error_prepend_string NULL PHP_INI_ALL
SMTP "localhost" PHP_INI_ALL
smtp_port 25 PHP_INI_ALL
browscap NULL PHP_INI_SYSTEM
error_reporting NULL PHP_INI_ALL
memory_limit "8M" PHP_INI_ALL
precision "14" PHP_INI_ALL
sendmail_from NULL PHP_INI_ALL
sendmail_path DEFAULT_SENDMAIL_PAth PHP_INI_SYSTEM
disable_classes "" php.ini only
disable_functions "" php.ini only
allow_url_fopen "1" PHP_INI_ALL
always_populate_raw_post_data "0" PHP_INI_SYSTEM
PHP_INI_PERDIR
xbithack "0" PHP_INI_ALL
engine "1" PHP_INI_ALL
last_modified "0" PHP_INI_ALL
child_terminate "0" PHP_INI_ALL
async_send "0" PHP_INI_ALL

可操作范围见下表:

Constant Value Meaning
PHP_INI_USER 1 Entry can be set in user scripts
PHP_INI_PERDIR 2 Entry can be set in php.ini, .htaccess or httpd.conf
PHP_INI_SYSTEM 4 Entry can be set in php.ini or httpd.conf
PHP_INI_ALL 7 Entry can be set anywhere

Tags: php

Records:341234567