problem starting CI on php 5.3.9 |
[eluser]alainb[/eluser]
Hi I installed CI 2.1.0 on two server one who have php 5.1.6 and it work OK I restored the entire folder on another server who run php 5.3.9 but this time i see code like <? $this->lang->load('main', $this->SITE_LANGUAGE); ?> <?= $this->load->view('layout/header.php'); ?> <?= $this->load->view('layout/top_menu.php'); ?> <?= $this->load->view('layout/left_nav.php'); ?> etc. my error.log file dont show any error what do I have to do
[eluser]tomcode[/eluser]
Your new server has the PHP ini setting short_open_tag set to off. Either change that or change Your markup: <? becomes <?php <?= becomes <?php echo
[eluser]alainb[/eluser]
Thanks it getting somewhere now Now i have error like Message: Undefined property: CI_Loader::$SITE_PATH
[eluser]tomcode[/eluser]
SITE_PATH does not exist in CodeIgniter. Did You add it somewhere ? The error message should indicate You the file name and the line number.
[eluser]alainb[/eluser]
Hi tomcode Thanks for your help I dont know why but it seem that some variable like IMAGES_PATH SITE_PATH etc are undefined I tryed to add them into the config.php file without success I guess I will have to edit all my php file and replace them Otherwisr what is the file I should add them?
[eluser]alainb[/eluser]
UPDATE Hi Finaly I found where was the problem before I was using CI 1.6 and updated to 2.1.0 During the conversion I had to convert supercontroller() to controler() So i looked at the supercontroller.php and found there all the declaration of the missing variable.
[eluser]tomcode[/eluser]
For commonly used variables which are not directly related to a library I create the config file application/config/application.php. Example : Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); I autoload the file and can then access them with Code: $media_path = $this->config->item('media_path'); When I need to access them inside helper functions, I use Code: $media_path = config_item('media_path'); |
Welcome Guest, Not a member yet? Register Sign In |