Welcome Guest, Not a member yet? Register   Sign In
A PHP Error was encountered
#1

[eluser]suzie[/eluser]
Dear Friends,
am new to CI, after downloading CI and running it, without touching any file on it
am receiving this error before the welcome message


A PHP Error was encountered

Severity: Notice

Message: Undefined variable: count

Filename: core/Common.php

Line Number: 496


Any Help please....
#2

[eluser]John_Betong_002[/eluser]
Try this:

file: ./application/config/config.php
Code:
error_reporting(-1);
ini_set('dispay_errors',1);

$config['log_threshold'] = 4;

$config['log_path'] = getcwd() .'/' .APPPATH ;

Copy and post your "./application/log-2011-mm-dd.php" log file.
 
 
#3

[eluser]suzie[/eluser]
Thanks a lot for your help

but really i didn't understand what to do...
am new to CI, please can you give me more details..

thank you very much
#4

[eluser]webnology[/eluser]
Hi John,

I'm having the same issue here. Can you help me out, please? Do I need to add that piece of cod to the config file?

Regards,
Michel
#5

[eluser]John_Betong_002[/eluser]
A little bit more information:

Find file: ./application/config/config.php

Code:
<?php
// add following lines to the top of the file
  error_reporting(-1);
  ini_set('dispay_errors',1);

// find the following line and replace with following line:
  $config['log_threshold'] = 4;

// find the following line and replace with following line:
  $config['log_path'] = getcwd() .'/' .APPPATH ;

Run your program and view the following file:
./application/log-2011-mm-dd.php” log file.
NB: please note that it maybe best to clear/empty the log file before running your application.

If on the off-chance you cannot solve the problem then copy and paste the error log file.
#6

[eluser]webnology[/eluser]
Thank you very much for helping John.

This is the content of my Log file, right up to the first error (I can't paste it completely, not enough space in the field):

Code:
<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed'); ?>

DEBUG - 2011-07-22 10:40:41 --> Config Class Initialized
DEBUG - 2011-07-22 10:40:41 --> Hooks Class Initialized
DEBUG - 2011-07-22 10:40:41 --> Utf8 Class Initialized
DEBUG - 2011-07-22 10:40:41 --> UTF-8 Support Enabled
DEBUG - 2011-07-22 10:40:41 --> URI Class Initialized
DEBUG - 2011-07-22 10:40:41 --> Router Class Initialized
ERROR - 2011-07-22 10:40:41 --> Severity: Notice  --> Undefined variable: count /var/www/html/system/core/Common.php 496
ERROR - 2011-07-22 10:40:41 --> Severity: Notice  --> Undefined variable: count /var/www/html/system/core/Common.php 498

Regards,
Michel
#7

[eluser]toopay[/eluser]
Did you have pcre in your php ext?
#8

[eluser]John_Betong_002[/eluser]
I will hazard a guess and think that the problem is with:

./application/config/routes.php

Open routes.php and search for count.

1. prefix all lines that have count with a //
2. clear your log file
3. try running your application again.
4. note the contents of the new error log file
 
 
#9

[eluser]toopay[/eluser]
Theres nothing to do with config or route files! Look at the line, which the error log said : $count is a variable which used in simple PCRE Regex pattern. I guess, someone which receive that error, didnt have PCRE installed in their php ext. To confirm, just paste your phpinfo() here.
#10

[eluser]webnology[/eluser]
Hi,

which line should I be looking for in the phpinfo. The file is too large to paste in the forum field.

MAy thx for your advice!

Michel




Theme © iAndrew 2016 - Forum software by © MyBB