Home FreeBSD How to Fix Cacti error Invalid PHP_SELF Path on FreeBSD 7.0
formats

How to Fix Cacti error Invalid PHP_SELF Path on FreeBSD 7.0

Published on 09/01/2009 by in FreeBSD

I have just installed Cacti on a new FreeBSD 6.3 machine that I’ve been playing with, and the latest version from ports seems to be broken, displaying the error “Invalid PHP_SELF Path” when I browse to it with a web browser.

A Google search reveals that it seems to be a common problem. This post on the Cacti forums proposes a temporary fix, which I have implemented and seems to work without any problems. It may expose your cacti installation to security problems, but I haven’t looked in to this, and I suspect that most Cacti installations (like mine) are protected by htaccess authentication anyway.

The fix:

In the file /usr/local/share/cacti/includes/global.php, comment out (by prepending //), or delete line 113:

if (!((is_file($_SERVER["SCRIPT_FILENAME"])) && (substr_count($_SERVER["SCRIPT_FILENAME"], $_SERVER["PHP_SELF"])))) {

And replace it with this one:

if (!((is_file($_SERVER["SCRIPT_FILENAME"])))) {

Hopefully a new version of Cacti is out soon that fixes this problem.

cradit : http://www.sysadmindiary.com/2008/03/cacti-087b-on-freebsd-invalid-php_self-path/

Related posts:

  1. รัน net-snmp แล้ว error
 
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
No Comments  comments