如何在Ubuntu 14.04上运行的codeigniter中设置基本URL?

时间:2015-12-01 10:57:32

标签: codeigniter ubuntu-14.04

已安装的LAMP堆栈。现在我已经将codeigniter文件提取到/ var / www / ci 但在浏览器http://localhost/ci/上运行时,欢迎页面无法显示。

3 个答案:

答案 0 :(得分:5)

终于找到了答案。必须启用该网站。

在/etc/apache2/sites-available/000-default.conf文件中修改shud如下:

TID: [0] [AM] [2015-12-24 13:47:51,378] ERROR {org.wso2.carbon.apimgt.hostobjects.APIStoreHostObject} - Error while obtaining the application access token for the application:test {org.wso2.carbon.apimgt.hostobjects.APIStoreHostObject} org.wso2.carbon.apimgt.api.APIManagementException: Could not execute Workflow at org.wso2.carbon.apimgt.impl.APIConsumerImpl.requestApprovalForApplicationRegistration(APIConsumerImpl.java:1746) at org.wso2.carbon.apimgt.impl.UserAwareAPIConsumer.requestApprovalForApplicationRegistration(UserAwareAPIConsumer.java:34) at org.wso2.carbon.apimgt.hostobjects.APIStoreHostObject.jsFunction_getApplicationKey(APIStoreHostObject.java:692) at sun.reflect.GeneratedMethodAccessor130.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:126) at org.mozilla.javascript.FunctionObject.call(FunctionObject.java:386) at org.mozilla.javascript.optimizer.OptRuntime.callN(OptRuntime.java:52) at org.jaggeryjs.rhino.store.modules.subscription.c3._c_anonymous_2(/store/modules/subscription/key.jag:34) at org.jaggeryjs.rhino.store.modules.subscription.c3.call(/store/modules/subscription/key.jag) at org.mozilla.javascript.ScriptRuntime.applyOrCall(ScriptRuntime.java:2430) at org.mozilla.javascript.BaseFunction.execIdCall(BaseFunction.java:269) at org.mozilla.javascript.IdFunctionObject.call(IdFunctionObject.java:97) at org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:42) at org.jaggeryjs.rhino.store.modules.subscription.c0._c_anonymous_8(/store/modules/subscription/module.jag:29) at org.jaggeryjs.rhino.store.modules.subscription.c0.call(/store/modules/subscription/module.jag) at org.mozilla.javascript.optimizer.OptRuntime.callN(OptRuntime.java:52) at org.jaggeryjs.rhino.store.site.blocks.subscription.subscription_add.ajax.c0._c_anonymous_1(/store/site/blocks/subscription/subscription-add/ajax/subscription-add.jag:155) at org.jaggeryjs.rhino.store.site.blocks.subscription.subscription_add.ajax.c0.call(/store/site/blocks/subscription/subscription-add/ajax/subscription-add.jag) at org.mozilla.javascript.optimizer.OptRuntime.call0(OptRuntime.java:23) at org.jaggeryjs.rhino.store.site.blocks.subscription.subscription_add.ajax.c0._c_script_0(/store/site/blocks/subscription/subscription-add/ajax/subscription-add.jag:3) at org.jaggeryjs.rhino.store.site.blocks.subscription.subscription_add.ajax.c0.call(/store/site/blocks/subscription/subscription-add/ajax/subscription-add.jag) at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:394) at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3091) at org.jaggeryjs.rhino.store.site.blocks.subscription.subscription_add.ajax.c0.call(/store/site/blocks/subscription/subscription-add/ajax/subscription-add.jag) at org.jaggeryjs.rhino.store.site.blocks.subscription.subscription_add.ajax.c0.exec(/store/site/blocks/subscription/subscription-add/ajax/subscription-add.jag) at org.jaggeryjs.scriptengine.engine.RhinoEngine.execScript(RhinoEngine.java:570) at org.jaggeryjs.scriptengine.engine.RhinoEngine.exec(RhinoEngine.java:273) at org.jaggeryjs.jaggery.core.manager.WebAppManager.execute(WebAppManager.java:432) at org.jaggeryjs.jaggery.core.JaggeryServlet.doPost(JaggeryServlet.java:29) at javax.servlet.http.HttpServlet.service(HttpServlet.java:755) at javax.servlet.http.HttpServlet.service(HttpServlet.java:848) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:749) at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:487) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:379) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:339) at org.jaggeryjs.jaggery.core.JaggeryFilter.doFilter(JaggeryFilter.java:21) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99) at org.wso2.carbon.tomcat.ext.valves.CompositeValve.continueInvocation(CompositeValve.java:178) at org.wso2.carbon.tomcat.ext.valves.CarbonTomcatValve$1.invoke(CarbonTomcatValve.java:47) at org.wso2.carbon.webapp.mgt.TenantLazyLoaderValve.invoke(TenantLazyLoaderValve.java:56) at org.wso2.carbon.tomcat.ext.valves.TomcatValveContainer.invokeValves(TomcatValveContainer.java:47) at org.wso2.carbon.tomcat.ext.valves.CompositeValve.invoke(CompositeValve.java:141) at org.wso2.carbon.tomcat.ext.valves.CarbonStuckThreadDetectionValve.invoke(CarbonStuckThreadDetectionValve.java:156) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936) at org.wso2.carbon.tomcat.ext.valves.CarbonContextCreatorValve.invoke(CarbonContextCreatorValve.java:52) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1653) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:744) Caused by: org.wso2.carbon.apimgt.impl.workflow.WorkflowException: Error occured when updating the status of the Application creation process at org.wso2.carbon.apimgt.impl.workflow.ApplicationRegistrationSimpleWorkflowExecutor.complete(ApplicationRegistrationSimpleWorkflowExecutor.java:79) at org.wso2.carbon.apimgt.impl.workflow.ApplicationRegistrationSimpleWorkflowExecutor.execute(ApplicationRegistrationSimpleWorkflowExecutor.java:52) at org.wso2.carbon.apimgt.impl.APIConsumerImpl.requestApprovalForApplicationRegistration(APIConsumerImpl.java:1742) ... 62 more Caused by: org.wso2.carbon.apimgt.api.APIManagementException: Error occurred while creating an Application Registration Entry for Application : test at org.wso2.carbon.apimgt.impl.dao.ApiMgtDAO.handleException(ApiMgtDAO.java:5832) at org.wso2.carbon.apimgt.impl.dao.ApiMgtDAO.createApplicationRegistrationEntry(ApiMgtDAO.java:284) at org.wso2.carbon.apimgt.impl.workflow.ApplicationRegistrationSimpleWorkflowExecutor.complete(ApplicationRegistrationSimpleWorkflowExecutor.java:74) ... 64 more Caused by: org.h2.jdbc.JdbcSQLException: Unique index or primary key violation: "CONSTRAINT_INDEX_F9 ON PUBLIC.AM_APPLICATION_REGISTRATION(SUBSCRIBER_ID, APP_ID, TOKEN_TYPE)"; SQL statement: INSERT INTO AM_APPLICATION_REGISTRATION (SUBSCRIBER_ID,WF_REF,APP_ID,TOKEN_TYPE,ALLOWED_DOMAINS,VALIDITY_PERIOD) VALUES(?,?,?,?,?,?) [23001-140] at org.h2.message.DbException.getJdbcSQLException(DbException.java:327) at org.h2.message.DbException.get(DbException.java:167) at org.h2.message.DbException.get(DbException.java:144) at org.h2.index.BaseIndex.getDuplicateKeyException(BaseIndex.java:157) at org.h2.index.PageBtree.find(PageBtree.java:121) at org.h2.index.PageBtreeLeaf.addRow(PageBtreeLeaf.java:138) at org.h2.index.PageBtreeLeaf.addRowTry(PageBtreeLeaf.java:93) at org.h2.index.PageBtreeIndex.addRow(PageBtreeIndex.java:90) at org.h2.index.PageBtreeIndex.add(PageBtreeIndex.java:81) at org.h2.table.RegularTable.addRow(RegularTable.java:116) at org.h2.command.dml.Insert.insertRows(Insert.java:120) at org.h2.command.dml.Insert.update(Insert.java:82) at org.h2.command.CommandContainer.update(CommandContainer.java:70) at org.h2.command.Command.executeUpdate(Command.java:199) at org.h2.jdbc.JdbcPreparedStatement.execute(JdbcPreparedStatement.java:179) at org.wso2.carbon.apimgt.impl.dao.ApiMgtDAO.createApplicationRegistrationEntry(ApiMgtDAO.java:267) ... 65 more TID: [0] [AM] [2015-12-24 13:47:51,383] ERROR {JAGGERY.site.blocks.subscription.subscription-add.ajax.subscription-add:jag} - org.jaggeryjs.scriptengine.exceptions.ScriptException: Error while obtaining the application access token for the application:test {JAGGERY.site.blocks.subscription.subscription-add.ajax.subscription-add:jag}

这对我有用!谢谢大家。

答案 1 :(得分:1)

如果你在var / www / html中使用ubuntu 14.04 web服务器,那么将你的文件夹移动到var / www / html / ci。

在ci folder.paste中打开.htaccess文件以下代码

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /ci/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule> 

答案 2 :(得分:0)

您可以在第26行的/application/config/config.php中设置基本网址。

$config['base_url'] = 'http://localhost/ci/';

如果没有解决问题,你必须发布更多信息。

新鲜的codeigniter安装?
没有第三方插件?
路线没有变化? (在/application/config/routes.php中)
控制器没有变化?
视图没有变化?

你有错误吗?
如果没有检查index.php中是否启用了错误报告(将其设置为开发以进行测试)

您是否在/ var / www / ci /文件夹中的.htaccess中使用重写规则?

你自动加载任何东西吗?图书馆,模特,语言,助手?

如果找不到任何内容,请将其设置为4:

$config['log_threshold'] = 4;

在第216行的/application/config/config.php中。

日志文件写入/ application / logs /.

发布该日志,可能会有所帮助。