cacti viewing error

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
s0lid
Posts: 4
Joined: Thu May 19, 2005 11:04 am
Location: Coruscant
Contact:

cacti viewing error

Post by s0lid »

i installed cacti following the INSTALL file but if i try to view
cacti url it shows this error:

Warning: mb_ereg_replace(): mbregex compile err: premature end of
regular expression in /var/www/html/cacti/include/config.php on line
43

Warning: mb_ereg_replace(): mbregex compile err: premature end of
regular expression in /var/www/html/cacti/include/config.php on line
44

Warning: Cannot modify header information - headers already sent by
(output started at /var/www/html/cacti/include/config.php:43) in
/var/www/html/cacti/include/config.php on line 67

Warning: Cannot modify header information - headers already sent by
(output started at /var/www/html/cacti/include/config.php:43) in
/var/www/html/cacti/include/config.php on line 68

Warning: Cannot modify header information - headers already sent by
(output started at /var/www/html/cacti/include/config.php:43) in
/var/www/html/cacti/include/config.php on line 69

Warning: Cannot modify header information - headers already sent by
(output started at /var/www/html/cacti/include/config.php:43) in
/var/www/html/cacti/include/config.php on line 70

Warning: Cannot modify header information - headers already sent by
(output started at /var/www/html/cacti/include/config.php:43) in
/var/www/html/cacti/include/config.php on line 71

Warning: session_start(): Cannot send session cookie - headers already
sent by (output started at /var/www/html/cacti/include/config.php:43)
in /var/www/html/cacti/include/config.php on line 74

Warning: session_start(): Cannot send session cache limiter - headers
already sent (output started at
/var/www/html/cacti/include/config.php:43) in
/var/www/html/cacti/include/config.php on line 74

Warning: main(/adodb/adodb.inc.php): failed to open stream: No such
file or directory in /var/www/html/cacti/include/config.php on line
103

Warning: main(): Failed opening '/adodb/adodb.inc.php' for inclusion
(include_path='.:/usr/share/pear') in
/var/www/html/cacti/include/config.php on line 103

Warning: main(/database.php): failed to open stream: No such file or
directory in /var/www/html/cacti/include/config.php on line 104

Warning: main(): Failed opening '/database.php' for inclusion
(include_path='.:/usr/share/pear') in
/var/www/html/cacti/include/config.php on line 104

Warning: main(/functions.php): failed to open stream: No such file or
directory in /var/www/html/cacti/include/config.php on line 105

Warning: main(): Failed opening '/functions.php' for inclusion
(include_path='.:/usr/share/pear') in
/var/www/html/cacti/include/config.php on line 105

Fatal error: Call to undefined function: db_connect_real() in
/var/www/html/cacti/include/config.php on line 111

i'm not sure if it's cacti or php error anyone encountered the same problem?
chwon -R us.us ./base
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

Version of:

Cacti?
OS?
PHP?
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
s0lid
Posts: 4
Joined: Thu May 19, 2005 11:04 am
Location: Coruscant
Contact:

Post by s0lid »

oh yeah i forgot.

it's cacti-0.8.6d(i got the tar.gz) running in CentOS-4 and my php is 4.3.9-3.6
chwon -R us.us ./base
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

Um... Try upgrading PHP to 4.3.11

Also, make sure that if you have FastCGI enabled that you set "cgi.fix_pathinfo = 1" in your php.ini file.
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
s0lid
Posts: 4
Joined: Thu May 19, 2005 11:04 am
Location: Coruscant
Contact:

Post by s0lid »

rony wrote:Um... Try upgrading PHP to 4.3.11

Also, make sure that if you have FastCGI enabled that you set "cgi.fix_pathinfo = 1" in your php.ini file.
hi it worked with centos but not in fedora. i haven't upgraded it to php 4.3.11 because i can't find rpm for fedora that version is 4.3.11
chwon -R us.us ./base
arti
Posts: 9
Joined: Sat May 21, 2005 5:21 am

Post by arti »

check your config file, this sounds like you got a huge blank space at the end of it, causing the premature end of headers error. remove it, save the file and try again :)
s0lid
Posts: 4
Joined: Thu May 19, 2005 11:04 am
Location: Coruscant
Contact:

Post by s0lid »

arti wrote:check your config file, this sounds like you got a huge blank space at the end of it, causing the premature end of headers error. remove it, save the file and try again :)
what do you mean? i checked config.php but there's no line after ?>
chwon -R us.us ./base
adaptr
Posts: 4
Joined: Tue Jun 07, 2005 5:02 pm

Solved this sucker!

Post by adaptr »

I figured it out after a quick look on the ereg_replace manual page ;-)

The first offending line (43) is:

Code: Select all

$config["base_path"] = ereg_replace("(.*)[\/\\]include", "\\1", dirname(__FILE__));
which the manual says means that the \\1 will be replaced with the first bit between (), i.e. anything before the "include" part.
BUT - cacti thinks to be smart and figure out for itself whether it is running on WinDOS ( \ path separator) or Unix ( / path separator).


Needless to say, this fails - miserably.

If you read the above, you'll see that ereg_replace is apt to get confused by this - does he (that's you) want a string with "number" \\], or does he want an actual escaped backslash (\\)?

My guess is it tries the former, and gives up ;-)
If this is a parsing error then it's an actual PHP bug.

I solved it by removing the [] and the separator that is not for my platform (Linux), and voila - glorious install screens are here!


In case this much code confuses you, here's the new line:

Code: Select all

$config["base_path"] = ereg_replace("(.*)\/include", "\\1", dirname(__FILE__));
Note that this only works on Linux!
For WinDOS you'll have to use \\ instead of \/

Modify the second line(with the /lib path) in the same way.
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

Um....

If this was a problem, more people would report it. I think it's related to your version of php.
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
adaptr
Posts: 4
Joined: Tue Jun 07, 2005 5:02 pm

Post by adaptr »

rony wrote:Um....

If this was a problem, more people would report it.
Sure, like a Linux system consists of a few, small, known-state parts ;-)

And an EDIT: that's actually pretty insulting to the OP of this thread: he reported this problem.
Now you're saying it must be my problem ?
rony wrote: I think it's related to your version of php.
Well duh - that's why I said it may be a PHP bug.

I'm running php 4.3.11, by the way - the version you repeatedly recommend to upgrade to.
jaix
Posts: 1
Joined: Thu Oct 27, 2005 6:46 am

viewing error

Post by jaix »

adaptr wrote:
rony wrote:Um....

If this was a problem, more people would report it.
Sure, like a Linux system consists of a few, small, known-state parts ;-)

And an EDIT: that's actually pretty insulting to the OP of this thread: he reported this problem.
Now you're saying it must be my problem ?
rony wrote: I think it's related to your version of php.
Well duh - that's why I said it may be a PHP bug.

I'm running php 4.3.11, by the way - the version you repeatedly recommend to upgrade to.
Thanks - I'm running php 4.3.9 on FC3 and that solved my problem , so ... :wink:
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest