[CI]CMS应用部署,FCkeditor上传图片不成功|php5.2.13使用mysqli扩展|CI部署到生产环境各种不显示

  首先说几个好的习惯。希望以后能坚持!

      每日工作+做个大概的记录,完成了什么功能?什么目录添加了什么文件?.php?.js?.xml? 各部分操作了“增删改查”哪种数据库交互,用到的存储过程。

      开发完毕+及时书写配置说明。尽量详细。

      协助运营+部署环境,一定做修改记录。


      [PHP中使用存储过程] - 如果你需要在php代码中使用mysql存储过程,那么你最优的选择是采用mysqli来操作你的mysql数据库。特别是返回多个结果集的情况下,会出现无法第二次执行存储过程,报错:

Commands out of sync; you can't run this command now 

      原因:获取的结果集并没有完全释放掉。

      纠结:你会发现无论怎么改,就算是使用mysql_free_result()也无济于事。最终你会妥协于下面的解决办法...

      解决方法:改用mysqli操作mysql,使用mysqli_muliti_query()来执行存储过程同时释放结果集;

     <详细解决方法-百度搜索:mysqli执行mysql存储过程>

     [版本差异 - php5.2.13] - 该版本下使用mysqli_connect();不要在第一个参数使用端口号.也就是说:mysqli_connect('127.0.0.1:3306','root','')是不行的。但是5.3.6以及本机5.3.8版本就可以。

 


     [FCKediotr上传图片] - 这里我使用的是php的方法,如果用的js调用,可能不适用!

      [不成功的原因] -

  1.多为IIS服务器  ckeditor/kcfinder/config.php 中的$_SERVER['SERVER_NAME']空值

$_CONFIG = array(
...

'uploadURL' => 'http://' . $_SERVER['SERVER_NAME'] . '/uploadFile/',
'uploadDir' => $_SERVER['DOCUMENT_ROOT']. '/uploadfile/',

...

     解决方法:可以直接把这里修改你的站点。注意:如果是ip:端口的话,这里你只需在$_SERVER['SERVER_NAME'] . 后面加上 $_SERVER['SERVER_PORT']. 即可。

      2.PHP.ini中upload_tmp_file 没有设置,或者该目录没有写权限。同时也有说该目录-属性-高级->可以存档文件也是必选项。

 1 ;;;;;;;;;;;;;;;;
2 ; File Uploads ;
3 ;;;;;;;;;;;;;;;;
4
5 ; Whether to allow HTTP file uploads.
6 ; http://php.net/file-uploads
7 file_uploads = On
8
9 ; Temporary directory for HTTP uploaded files (will use system default if not
10 ; specified).
11 ; http://php.net/upload-tmp-dir
12 ;upload_tmp_dir =
13 upload_tmp_dir = “E:/site/tmp”
14
15 ; Maximum allowed size for uploaded files.
16 ; http://php.net/upload-max-filesize
17 upload_max_filesize = 2M
18
19 ; Maximum number of files that can be uploaded via a single request
20 max_file_uploads = 20

    解决方法:去掉第12行(并非php.ini中行号),引号注释,修改为指定文件夹,如第13行所示.


    [Codeigniter显示空白页] - 你首先需要做的,让错误暴露出来。打开index.php,然后查找到下列代码:

 1 <?php
2 /*
3 *---------------------------------------------------------------
4 * APPLICATION ENVIRONMENT
5 *---------------------------------------------------------------
6 *
7 * You can load different configurations depending on your
8 * current environment. Setting the environment also influences
9 * things like logging and error reporting.
10 *
11 * This can be set to anything, but default usage is:
12 *
13 * development
14 * testing
15 * production
16 *
17 * NOTE: If you change these, also change the error_reporting() code below
18 *
19 */
20 define('ENVIRONMENT', 'development');
21 /*
22 *---------------------------------------------------------------
23 * ERROR REPORTING
24 *---------------------------------------------------------------
25 *
26 * Different environments will require different levels of error reporting.
27 * By default development will show errors but testing and live will hide them.
28 */
29
30 if (defined('ENVIRONMENT'))
31 {
32 switch (ENVIRONMENT)
33 {
34 case 'development':
35 error_reporting(E_ERROR | E_PARSE | E_WARNING);
36 break;
37
38 case 'testing':
39 case 'production':
40 error_reporting(0);
41 break;
42
43 default:
44 exit('The application environment is not set correctly.');
45 }
46
47 }

      解决方案:

          你可以将第20行

      define('ENVIRONMENT', 'development');

    修改为:

      define('ENVIRONMENT', 'testing'); 
    以此来使CI使用php.ini中配置的错误监听等级。但我想你不如直接修改35行

      error_reporting(E_ERROR | E_PARSE | E_WARNING);

          为:

                error_reporting(E_ALL);

    然后根据提示错误一个个解决吧!可能经常出错的几个地方:

    1.config.php中你需要给ci_session配置一个密匙: encryption_key 这个通常在 config.php第227行。

    2.再次确定你的database.php中数据库配置正确。

    3.autoload.php中的那些helper,config,library是否可能出错。

  [完]



posted @ 2011-11-01 19:54  许乐言  阅读(1293)  评论(0编辑  收藏  举报