Search code examples
phpcodeigniterphp4

__construct() { issue for PHP4 and PHP5. maybe an another reason


I have weird issue with CodeIgniter,

here is a start part of my controller

class Home extends Controller
{
    /** 
    * Constructor
    */ 
    public function __construct() {
        parent::Controller();

    }

...

everything is working fine at localhost, but when I try same at server, I come cross with an error like below:

Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home3/blabla/public_html/blablabla/applications/frontend/controllers/home.php on line 22

I researched and people say it is about PHP4.. it should be PHP5. but my server has PHP5 on. what can be the reason?

appreciate helps! thanks a lot!


Solution

  • I'm so sorry! I dont know how come, but Bluehost info panel says PHP 5 is active. and i just believed that. when I make a php_info(); page just in case, i saw actually it is php 4 :/

    I updated server for PHP5 and now everything is fine.

    I'm sorry for messing. and thanks all you for great support!!!