• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PHP works but not inside include file

I have a CI 1.7.3 site that worked perfectly in Ubuntu but is now being migrated to Suse Enterprise server (SLES 11 SP1 64 bit mode).

The site STARTS working fine - until I get to the view where I include the header:
<?PHP include "header.tpl.php" ;?>
That file is included BUT the php IN THE INCLUDED FILE is not executed. I tried renaming the file and changing permissions - all without success.
For example when I want to pull in a css file the url that gets sent to the browser is:


Any suggestions on how to tackle this?? I've hit a wall.


PHP has a short tags option:
<?php= or <?=
some newer php installations that I've come across have done away with it. In CI 2.0 you have the following in config.php:
| Rewrite PHP Short Tags
| If your PHP installation does not have short tag support enabled CI
| can rewrite the tags on-the-fly, enabling you to utilize that syntax
| in your view files.  Options are TRUE or FALSE (boolean)
$config['rewrite_short_tags'] = FALSE;

try changing it to TRUE and see if that helps you.

I'll try that (although I've been using the long tag) when I get a chance. I'm under the gun to get this working so I just hard code the base_url for now :-(

I'll also try <?PHP echo base_url(); ?> in the event that the = after the PHP is the problem here.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.