Welcome Guest, Not a member yet? Register   Sign In
problem starting CI on php 5.3.9
#1

[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

#2

[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
#3

[eluser]alainb[/eluser]
Thanks it getting somewhere now

Now i have error like

Message: Undefined property: CI_Loader::$SITE_PATH

#4

[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.
#5

[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?
#6

[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.


#7

[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');

/*
|--------------------------------------------------------------------------
| The Path to the Media Files
|--------------------------------------------------------------------------
|
| A relative path from the web root on, without a trailing slash.
|
| 'media'
|
*/
$config['media_path'] = "media";

I autoload the file and can then access them with
Code:
$media_path = $this->config->item('media_path');
See Config Class : User Guide.


When I need to access them inside helper functions, I use
Code:
$media_path = config_item('media_path');
See Common Functions : User Guide




Theme © iAndrew 2016 - Forum software by © MyBB