查看PHP手冊,readfile函式
對於採用gzip壓縮模式傳輸時可能會造成問題,建議採用以下方式解決:
1. 在程式加上:
@apache_setenv('no-gzip', 1);
@ini_set('zlib.output_compression', 0); 2. 在php.ini設定:
zlib.output_compression = 0
參考文獻
PHP readfile
PHP zlib.configuration
對於採用gzip壓縮模式傳輸時可能會造成問題,建議採用以下方式解決:
1. 在程式加上:
@apache_setenv('no-gzip', 1);
@ini_set('zlib.output_compression', 0);
+--------------------------+----------------------------------------+
| Variable_name | Value |
+--------------------------+----------------------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | /usr/local/mysql/share/mysql/charsets/ |
+--------------------------+----------------------------------------+
*************************** 1. row ***************************
Field: p_custom1
Type: varchar(32)
Collation: latin1_swedish_ci
Null: YES
Key:
Default: NULL
Extra:
Privileges: select,insert,update,references
Comment:
1 rows in set (0.00 sec)
Installed packages, channel pear.php.net:
=========================================
Package Version State
Archive_Tar 1.3.1 stable
Console_Getopt 1.2 stable
Net_Ping 2.4.5 stable
PEAR 1.4.9 stable
XML_RPC 1.5.0 stable
$fh = fopen('/proc/meminfo', 'r');
if($fh) {
$i=0;
while( !feof($fh) ) {
$buffer = fgets($fh);
list($key[$i], $value[$i]) = explode(':', $buffer);
$i++;
}
}
print_r($value);$fh = fopen('/proc/meminfo', 'r');
if($fh) {
$i=0;
while( !feof($fh) ) {
$buffer = fgets($fh);
if( strpos($buffer, ':') ) {
$buffer = preg_replace( array('/\s+/', '/\n/', '/(kB)$/'), '', $buffer);
list($key[$i], $value[$i]) = explode(':', $buffer);
$i++;
}
}
fclose($fh);
}
print_r($value);
C:\php>php -i|find "php.ini"
Configuration File (php.ini) Path => C:\WINDOWS
Loaded Configuration File => C:\WINDOWS\php.ini <-- 看到這行表示php以確實找到囉
extension_dir = "c:\php\ext"
若你還有需要其他的模組,也請將模組前方的分號拿掉
extension=php_gd2.dll
extension=php_mbstring.dll
extension=php_mcrypt.dll
extension=php_mysql.dll
extension=php_mysqli.dll
extension=php_openssl.dll
extension=php_zip.dll
fastcgi.impersonate = 1
fastcgi.logging = 0
cgi.fix_pathinfo=1
cgi.force_redirect = 0
C:\>cscript %windir%\system32\inetsrv\fcgiconfig.js -add -section:"PHP" ^
-extension:php -path:"C:\PHP\php-cgi.exe"
cscript %windir%\system32\inetsrv\fcgiconfig.js -set -section:"PHP" ^
-InstanceMaxRequests:10000
cscript %windir%\system32\inetsrv\fcgiconfig.js -set -section:"PHP" ^
-EnvironmentVars:PHP_FCGI_MAX_REQUESTS:10000


