请指教。 我在winxp+apache2+php4.3下运行“取得逻辑磁盘”看不到结果。 错误提示如下: Warning: dl() [function.dl]: Not supported in multithreaded Web servers - use extension statements in your php.ini in C:\Program Files\Apache Group\Apache2\htdocs\Test\Get_the_Type_of_disk.php on line 3Fatal error: Undefined class name 'win32' in C:\Program Files\Apache Group\Apache2\htdocs\Test\Get_the_Type_of_disk.php on line 4
// 取得逻辑磁盘
dl("php_w32api.dll");
Win32::RegisterFunction ("long GetLogicalDrives () from kernel32.dll");$drivers = (string)decbin(Win32::GetLogicalDrives ());
$drivers = strrev($drivers);
for ($i=0; $i<strlen($drivers); $i++) {
if($drivers[$i] == 1) {
$driver = chr($i+65);
} else {
$driver = "";
}
echo $driver;
}
// 取得磁盘类型
dl("php_w32api.dll");
Win32::RegisterFunction ("int GetDriveTypeA (string lpRootPathName) from kernel32.dll");$driver = "c:\\";
echo $driver;
$type = Win32::GetDriveTypeA($driver);
if(isset($type)) {
switch($type) {
case "0" : echo " = DRIVE_UNKNOWN\n";
break;
case "1" : echo " = DRIVE_NO_ROOT\n";
break;
case "2" : echo " = DRIVE_REMOVABLE\n";
break;
case "3" : echo " = DRIVE_FIXED\n";
break;
case "4" : echo " = DRIVE_REMOTE\n";
break;
case "5" : echo " = DRIVE_CDROM\n";
break;
case "6" : echo " = DRIVE_RAMDISK\n";
break;
}
}
?>其实PHP就已经很强大了,只是没人注意而已。
我在winxp+apache2+php4.3下运行“取得逻辑磁盘”看不到结果。
错误提示如下:
Warning: dl() [function.dl]: Not supported in multithreaded Web servers - use extension statements in your php.ini in C:\Program Files\Apache Group\Apache2\htdocs\Test\Get_the_Type_of_disk.php on line 3Fatal error: Undefined class name 'win32' in C:\Program Files\Apache Group\Apache2\htdocs\Test\Get_the_Type_of_disk.php on line 4
在php.ini中加入:
extension = php_w32api.dll
我在win上安装php,从是不能加载dl库,真是痛苦,php.ini中设了,没用