首页 > 编程技术 > php

解决无法加载php_oci8.dll的问题:

发布时间:2016-11-25 17:35

后来考虑可能是系统path环境变量设置的问题,于是就参考安装了oracle的Winnt下的path变量值,发现W2K的path变量值中无“%driver%:oracleora81in;”(可能是操作系统不同造成的),且在bin下找到了oci.dll!!
立即在path中手工添加这段字符串,重起server,问题解决!
注:对driver%:oracleora81in,请根据oracle安装路径的不同进行改动
erquan注:请首先确定你的php.ini的配置正确后且已重启了WEB服务,如
extension_dir=%PHP_Path%extensions
extension=php_oci8.dll
计算页面执行时间
在PHP网页的开头加入以下
<?
$time_start = getmicrotime();
function getmicrotime()
{
list($usec, $sec) = explode(" ",microtime());
return ((float)$usec + (float)$sec);
}
?>
然后到最后加入以下代码
<?
$time_end = getmicrotime();
printf ("[页面执行时间: %.2f毫秒] ",($time_end - $time_start)*1000);
?>

        php中的网页重定向
              ——爆米花
    在php中进行网页重定向一共有三种方法:
    1。利用header()重定向
    <?
    header("Location: $url");
    exit;
    ?>
2。用嵌入HTML的<meta>标识重定向
<META HTTP-EQUIV="REFRESH" CONTENT="5; URL=<? echo $url;?>>
3、用嵌入javascript的重定向
    <?
    echo "<!--<SCRIPT LANGUAGE="JavaScript">";
    echo "location.href=‘$url‘";
    echo "</SCRIPT>-->";
    ?>

<html>
<head><title>正则表达式</title></head>
<body>
<a href="./">返回列表</a>
<form action="<? echo $PHP_SELF; ?>" method="post">
请输入MM/DD/YYYY格式的日期:
<input type="text" name="date" value="<? echo $date; ?>">
<input type="submit" value="转换为YYYY-MM-DD格式">
</form>
<?
if(isset($date)){
    if ( ereg( "([0-9]{1,2})/([0-9]{1,2})/([0-9]{4})", $date, $regs ) ) {
        echo $regs[0] . "的转换结果为:" . $regs[3] . "-" . $regs[1] . "-" . $regs[2];
    } else {
        echo "$date 的日期格式不对!<br>";
    }
}
?>
</body>
</html>

感谢sadly为我们写出了在GD中输出汉字的函数,
我在使用中发现此版本输出的字符串必须为纯中文,不能夹杂英文。
随修改了此bug,与大家分享。。。
<?
//Program writen by sadly www.phpx.com
//modified by agun 2000/6/20
function gb2utf8($gb)
{
if(!trim($gb))
return $gb;
$filename="gb2312.txt";
$tmp=file($filename);
$codetable=array();
while(list($key,$value)=each($tmp))
$codetable[hexdec(substr($value,0,6))]=substr($value,7,6);
$ret="";
$utf8="";
while($gb)
{
if (ord(substr($gb,0,1))>127)
{
$this=substr($gb,0,2);
$gb=substr($gb,2,strlen($gb));
$utf8=u2utf8(hexdec($codetable[hexdec(bin2hex($this))-0x8080]));
for($i=0;$i<strlen($utf8);$i+=3)
$ret.=chr(substr($utf8,$i,3));
}
else
{
$ret.=substr($gb,0,1);
$gb=substr($gb,1,strlen($gb));
}
}
return $ret;
}
function u2utf8($c)
{
for($i=0;$i<count($c);$i++)
$str="";
if ($c < 0x80) {
$str.=$c;
}
else if ($c < 0x800) {
$str.=(0xC0 | $c>>6);
$str.=(0x80 | $c & 0x3F);
}
else if ($c < 0x10000) {
$str.=(0xE0 | $c>>12);
$str.=(0x80 | $c>>6 & 0x3F);
$str.=(0x80 | $c & 0x3F);
}
else if ($c < 0x200000) {
$str.=(0xF0 | $c>>18);
$str.=(0x80 | $c>>12 & 0x3F);
$str.=(0x80 | $c>>6 & 0x3F);
$str.=(0x80 | $c & 0x3F);
}
return $str;
}
Header("Content-type: image/gif");
$im = imagecreate(300,150);
$bkg = ImageColorAllocate($im, 0,0,0);
$clr = ImageColorAllocate($im, 255,255,255);
$fnt = "c:windowsfontssimsun.ttf";
//include("gb2utf8.php");
$str = gb2utf8("中国agun阿棍");
ImageTTFText($im, 30, 0, 50,50, $clr, $fnt, $str);
ImageGif($im);
ImageDestroy($im);
?>

标签:[!--infotagslink--]

您可能感兴趣的文章: