免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 25463 | 回复: 5

ASP转PHP手记 [复制链接]

论坛徽章:
0
发表于 2008-11-17 21:02 |显示全部楼层
打算将动易网站管理系统移植到PHP环境中,寻寻觅觅了很多PHP内容管理网站,发现网上有动易转PHPCMS的代码,所以就拿定注意用PHPCMS的在google上找到一转换程序,动手做来还成功了,现将此次转换的经验与教训总结如下:
   1.在http://www.otand.com/html/php/cms/20080605/2852.html下载完美动易2006 Sp6  SiteWeaver CMS6.5 Access MSSQL转 PHPCMS 2007 SP6程序解压缩备用,请不要下载PHPCMS官网的转换程序,因其有很多错误,还是完美的好。
   2.先在windows下调试,求方便直接下载的PHPCMS集成包, http://soft.phpcms.cn/2008/0116/soft_138.html,一键安装后直接可以用。
   (后在linux下证实,直接将MYSQL数据库复制过去是可行的)
将完美转换程序解压后,找到里面的config.php,因我以前用的是ACCESS数据库,所以这里将ACCESS以外的MSSQL全部注释掉,例如:
// 访问 访问数据库类型   数据库类型支持Access,MsSQL   请选择数据库类型并认真填写下列信息
$_CONFIG['db_type'] = 'Access';
//$_CONFIG['db_type'] = 'MsSQL';
// 访问 MsSQL  的主机名,如果是本机为localhost
//$_CONFIG['db_sql_host'] = 'localhost';
// 访问 MsSQL  的数据库名
//$_CONFIG['db_sql_name'] = 'powereasy';
// 访问 MsSQL  的用户名
//$_CONFIG['db_sql_user'] = 'powereasy';
// 访问 MsSQL  的密码
//$_CONFIG['db_sql_pass'] = 'powereasy5598';
//是否使用持久连接
//$_CONFIG['db_pconnect'] = '1';

然后将ACCESS数据库放在D盘根目录下,例如:
// 访问 access 数据库文件名,绝对地址: D:\改成D:/
$_CONFIG['access_mdb'] = 'd:/danweishujuku.mdb';
//红字地方是自己数据库名称
// 访问 access 数据库文件的用户名,一般默认为空
$_CONFIG['access_uid'] = '';
// 访问 access 数据库文件的密码,一般默认为空
$_CONFIG['access_pwd'] = '';
// PE 数据表前缀 一般不需要修改
$_CONFIG['access_tablepre'] = 'PE_';
// 每次需要转换的数据量,如果您的服务器比较慢,请将这个值调小
$CONFIG['rpp'] = '1000';
?>

仅仅更改这两项。

然后将整个解压后的包放在网站根目录下,我这里是phproot所以直接放PHProot下即可。

比较笨的我,刚开始是这么做的,人家readme上是这么写的“将本程序解压到PHPCMS根目录”我呢,没有把一整包放在根目录下,而是把一堆文件拷到了PHPROOT下,这样肯定会覆盖原有的INDEX.PHP啊,我又把原index.php做了个备份,然后运行之,然后会有错误提示若干:
Warning: include_once(../include/common.inc.php) [function.include-once]: failed to open stream: No such file or directory in D:\PC_webserver\phproot\index.php on line 14

Warning: include_once() [function.include]: Failed opening '../include/common.inc.php' for inclusion (include_path='.;C:\php5\pear') in D:\PC_webserver\phproot\index.php on line 14

Warning: include_once(PHPCMS_ROOT/config.inc.php) [function.include-once]: failed to open stream: No such file or directory in D:\PC_webserver\phproot\index.php on line 15

Warning: include_once() [function.include]: Failed opening 'PHPCMS_ROOT/config.inc.php' for inclusion (include_path='.;C:\php5\pear') in D:\PC_webserver\phproot\index.php on line 15

Warning: include_once(PHPCMS_ROOT/include/cache.func.php) [function.include-once]: failed to open stream: No such file or directory in D:\PC_webserver\phproot\index.php on line 16

Warning: include_once() [function.include]: Failed opening 'PHPCMS_ROOT/include/cache.func.php' for inclusion (include_path='.;C:\php5\pear') in D:\PC_webserver\phproot\index.php on line 16

Warning: include_once(PHPCMS_ROOT/admin/include/global.func.php) [function.include-once]: failed to open stream: No such file or directory in D:\PC_webserver\phproot\index.php on line 17

Warning: include_once() [function.include]: Failed opening 'PHPCMS_ROOT/admin/include/global.func.php' for inclusion (include_path='.;C:\php5\pear') in D:\PC_webserver\phproot\index.php on line 17
Access Denied

这些东西说明找不到某个文件,看了转换程序的index.php原来在这里

第14行的include_once(PHPCMS."/include/common.inc.php");

而PHPCMS.的定义是“..”这样的话直接就出了phproot这个目录了,所以会提示找不到文件

有两个方法可以解决:
  1:将index.php文件的include_once(PHPCMS."/include/common.inc.php");的(PHPCMS."/include/common.inc.php");改为include_once("include/common.inc.php");
然后再运行http://127.0.0.1/index.php

  2:解压转换程序后更改config.php文件,然后将整个包拷到网站根目录下例如:
    http://127.0.0.1/完美动易2006 Sp6 SW6.5 Access MSSQL转 PHPCMS 2007 SP6 /index.php

第二种是最简单的,定义好自己数据库后运行下即可,省去了寻找问题的时间。



转换完后登陆后台,此时切记切记要更新全部缓存否则当管理频道--重建目录时会提示如下错误:
Warning: require(D:/PC_webserver/phproot/languages//phpcms.lang.php) [function.require]: failed to open stream: No such file or directory in D:\PC_webserver\phproot\include\common.inc.php on line 28

Fatal error: require() [function.require]: Failed opening required 'D:/PC_webserver/phproot/languages//phpcms.lang.php' (include_path='.;C:\php5\pear') in D:\PC_webserver\phproot\include\common.inc.php on line 28

非常要命的错误啊!!!!出现后刷新页面整个后台都无法登陆了!!!
刷新后的错误提示:

Warning: require(D:/PC_webserver/phproot/languages//phpcms.lang.php) [function.require]: failed to open stream: No such file or directory in D:\PC_webserver\phproot\include\common.inc.php on line 28

Fatal error: require() [function.require]: Failed opening required 'D:/PC_webserver/phproot/languages//phpcms.lang.php' (include_path='.;C:\php5\pear') in D:\PC_webserver\phproot\include\common.inc.php on line 28
此时只有重新安装PHPCMS了!!

        
再强调一下:转换完后登陆后台首先是更新缓存!!!!!                     jinscan       2008.11.17

                                                                                                             jinscan   2008.11.19翻看自己帖子时发现有一小小错误,稍作更改,不好意思。

[ 本帖最后由 jinscan 于 2008-11-19 08:10 编辑 ]

评分

参与人数 1可用积分 +1 收起 理由
Digico + 1 我很赞同

查看全部评分

论坛徽章:
52
码神
日期:2017-03-28 10:27:10综合交流区版块每日发帖之星
日期:2015-10-11 06:20:00综合交流区版块每日发帖之星
日期:2015-09-28 06:20:00综合交流区版块每日发帖之星
日期:2015-09-22 06:20:00每日论坛发贴之星
日期:2015-09-12 06:20:00综合交流区版块每日发帖之星
日期:2015-09-12 06:20:00综合交流区版块每日发帖之星
日期:2015-09-08 06:20:00综合交流区版块每日发帖之星
日期:2015-09-05 06:20:00综合交流区版块每日发帖之星
日期:2015-09-04 06:20:002015亚冠之德黑兰石油
日期:2015-09-01 10:41:53每日论坛发贴之星
日期:2015-10-11 06:20:00综合交流区版块每日发帖之星
日期:2015-10-12 06:20:00
发表于 2008-11-17 23:24 |显示全部楼层

回复 #1 jinscan 的帖子

收藏了,感谢。。。

论坛徽章:
0
发表于 2008-11-21 15:08 |显示全部楼层
先留个脚印。

论坛徽章:
0
发表于 2008-11-21 22:47 |显示全部楼层
留个爪子

论坛徽章:
0
发表于 2008-11-24 14:51 |显示全部楼层
记录,作个标记先

论坛徽章:
0
发表于 2011-08-30 13:28 |显示全部楼层
感谢lZ的帖子,使我得到了启发,解决了类似路径问题。谢谢
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP