简体   繁体   English

codeigniter可在实时站点上运行,但不能在本地主机上运行

[英]codeigniter works on live site but not localhost

I copied my live Codeigniter project to my local machine to make development a little easier, but it's not displaying right. 我将当前的Codeigniter项目复制到了本地计算机上,以使开发工作更轻松一些,但是显示不正确。 NO changes have been made, so I am not sure why this is happening? 没有进行任何更改,所以我不确定为什么会这样吗? It almost acts like it cant read from the database, but the listings on the bottom come from a select query so I feel like thats not the case.. 它几乎就像无法从数据库中读取一样,但是底部的列表来自选择查询,所以我觉得不是这样。

I am using Windows 10 IIS with PHP. 我正在使用Windows 10 IIS和PHP。

Live site: http://beta.btcbidder.com/ 直播网站: http//beta.btcbidder.com/

Localhost image: Localhost图片: 在此处输入图片说明

There may be something wrong with your php tags because of the raw output in your image above. 由于上面图像中的原始输出,您的php标记可能存在问题。 This could be down to the use of shorthand php tags which are generally considered bad practice. 这可能归因于速记php标签的使用,通常认为这是不好的做法。

<? ?> & <?= ?>

Shorthand php tags are disabled on some server configurations so for this reason it is best to use a templating engine or at least use the full php markup. 速记php标记在某些服务器配置上被禁用,因此出于这个原因,最好使用模板引擎或至少使用完整的php标记。

Do a find and replace and replace all <? ... ?> 查找并替换并替换所有<? ... ?> <? ... ?> or <?= ?> tags with the full php tags <?php ... ?> <? ... ?><?= ?>标记以及完整的php标记<?php ... ?>

You can also use .htaccess for the same 您也可以使用.htaccess

<IfModule mod_php5.c>
  php_value short_open_tag 1
</IfModule>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 JavaScript可在Localhost上使用,但不能在实时站点上使用 - JavaScript works on Localhost, but not on live site CodeIgniter POST可在localhost上运行,但不能在实时服务器上运行 - CodeIgniter POST works in localhost but not on live server fsockopen whois在本地主机上工作,但在实时站点上不工作 - fsockopen whois works on localhost but not working on live site 会话在实时站点中不起作用并且在本地主机中工作 - session not working in live site and works in localhost 实时网站上的PHP错误,在localhost上正常运行 - PHP errors on live site, works fine on localhost 将我的Codeigniter站点从实时服务器移动到本地主机时出现问题 - Problem in moving my Codeigniter site from live server to localhost PHPMailer似乎不能在实时站点上工作,但可以在localhost上工作? - PHPMailer doesn't seeem to work on live site, but works on localhost? 我的 Codeigniter 网站可以在本地主机上运行,但不能在 web 服务器上运行? 500 内部服务器 - My Codeigniter site works on localhost but not on web server? 500 internal server phpmailer可在localhost上运行,但不能在实时服务器上运行 - phpmailer works on localhost but not on live server 路由在localhost上有效,但在实时服务器上无效 - Routing works on localhost, but not on live server
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM