用户
 找回密码
 入住 CI 中国社区
搜索
查看: 2973|回复: 9
收起左侧

[HELP] 求问怎么部署现成的网站源码啊

[复制链接]
发表于 2013-4-2 17:43:34 | 显示全部楼层 |阅读模式
http://codeigniter.org.cn/forums/thread-13189-1-1.html

这个看了半天    网站挺好    就是不会部署
----------------------------------------------------------------------------------------------------------
使用方法:

1. 将脚本部署到web目录下

2. 根据你的url编辑根目录下.htaccess 文件

3. 修改application/config/config.php 中的site_url 和  base_url

3. 将source目录下Jia2.sql 导入mysql数据库

4. 修改application/config/database.php 中的数据库配置

5. 请确保服务器进程对部署目录可读写权限

6. 部署时请将根目录下以及application/config 目录下.default结尾的文件复制一份去掉.default 并根据实际情况修改这几个配置文件

--------------------------------------------------------------------------------------------------------------
我把网站全部解压到    'web目录/ci/sns'下了

.htaccess哪些需要修改?

site_url 和  base_url  到底应该怎么改?我改成了'http://localhost/ci/sns/'   

改完后运行http://localhost/ci/sns/index.php报错

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at admin@example.com to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.


发表于 2013-4-2 17:46:48 | 显示全部楼层
你没有安装 url rewrite 模块吧?
你是 Apache 吗
 楼主| 发表于 2013-4-2 18:22:43 | 显示全部楼层
Hex 发表于 2013-4-2 17:46
你没有安装 url rewrite 模块吧?
你是 Apache 吗

是啊   wamp

我把  url rewrite 模块   安装了一下   又把.htaccess改成这样

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /ci/sns/index.php/$1 [L]


还是报错   错误不变。。
发表于 2013-4-2 18:24:56 | 显示全部楼层
camrmen 发表于 2013-4-2 18:22
是啊   wamp

我把  url rewrite 模块   安装了一下   又把.htaccess改成这样

重启apache了吗?
 楼主| 发表于 2013-4-2 18:33:36 | 显示全部楼层
Hex 发表于 2013-4-2 18:24
重启apache了吗?

重启了呀  。。
发表于 2013-4-2 18:34:34 | 显示全部楼层
camrmen 发表于 2013-4-2 18:33
重启了呀  。。

那你删了 .htaccess 试试
 楼主| 发表于 2013-4-2 18:43:03 | 显示全部楼层
Hex 发表于 2013-4-2 18:34
那你删了 .htaccess 试试

删除后   报错  

HTTP 错误 500(Internal Server Error):服务器尝试执行请求时遇到了意外情况。
发表于 2013-4-3 10:07:50 | 显示全部楼层
camrmen 发表于 2013-4-2 18:43
删除后   报错  

HTTP 错误 500(Internal Server Error):服务器尝试执行请求时遇到了意外情况。 ...

你用 xampp 试试吧,这个肯定可以用,你的服务器不知道怎么配置的,没有你的电脑说不好。。。
发表于 2013-4-6 13:59:02 | 显示全部楼层
site_url 和  base_url  到底应该怎么改?我改成了'http://localhost/ci/sns/'   

改完后运行http://localhost/ci/sns/index.php报错


你这都已经设置了 访问的时候应该是直接访问http://localhost/index.php就可以了吧
 楼主| 发表于 2013-4-9 15:51:37 | 显示全部楼层
解决了   感谢HEX及ls!

  还是url rewrite 没弄好    正确的做法是去掉apache中http.conf中的rewrite行的#号

后面还遇到了syntax error, unexpected end of file( ...)index.php on line 360

如果错误恰好指向最后一行可能是你没有打开php的short_open_tag

本版积分规则