Linux部署ThinkPHP 驗證碼不顯示

1、分析php

 一、先確保是否開啓了 gd庫spa

        能夠經過phpinfo();查看
調試

 二、頁面是否存在bom頭rest

           <?php orm

                /*清除rom*/rem

                if(isset($_GET['dir'])){ get

                    $basedir=$_GET['dir']; it

                }else{ io

                    $basedir = '.'; function

                }   

                $auto = 1;   

                checkdir($basedir); 

                function checkdir($basedir){ 

                    if($dh = opendir($basedir)){ 

                        while(($file = readdir($dh)) !== false){ 

                            if($file != '.' && $file != '..'){ 

                                if(!is_dir($basedir."/".$file)){ 

                                    echo "filename: $basedir/$file ".checkBOM("$basedir/$file")." <br>"; 

                                }else{ 

                                    $dirname = $basedir."/".$file; 

                                    checkdir($dirname); 

                                } 

                            } 

                        }//end while 

                    closedir($dh); 

                    }//end if($dh 

                }//end function 

                function checkBOM($filename){ 

                    global $auto; 

                    $contents = file_get_contents($filename); 

                    $charset[1] = substr($contents, 0, 1);   

                    $charset[2] = substr($contents, 1, 1);   

                    $charset[3] = substr($contents, 2, 1);   

                    if(ord($charset[1]) == 239 && ord($charset[2]) == 187 && ord($charset[3]) == 191){ 

                        if($auto == 1){ 

                            $rest = substr($contents, 3); 

                            rewrite ($filename, $rest); 

                            return "<font color=red>BOM found, automatically removed.</font>"; 

                        }else{ 

                            return ("<font color=red>BOM found.</font>"); 

                        } 

                    }   

                    else return ("BOM Not Found."); 

                }//end function 

                function rewrite($filename, $data){ 

                    $filenum = fopen($filename, "w"); 

                    flock($filenum, LOCK_EX); 

                    fwrite($filenum, $data); 

                    fclose($filenum); 

                }

             ?>

 三、導入的ORG.Util.Image是否存在

 四、入口文件中是否有define('APP_DEBUG', TRUE); //是否開啓調試模式

  上線時必須爲FALSE(注:我就是犯了這個錯誤折騰了老半天才找到)

相關文章
相關標籤/搜索